Continue in the app
Bug Number NIM100236
Submitted Mar 26, 2014
Modified Mar 30, 2022
Severity High
Applies To ArcGIS for Desktop
Version Found 10.2.1
Prog Language All
Server Platform
Client Platform
Database N/A
Locale N/A
Status Known Limit
Learn more
Version Fixed
SP Fixed

Bug NIM100236


The IGeographicCoordinateSystemEdit.Define method fails on defined spatial references, and is making the geographic system object with empty properties.

Additional Information

Projecting a point from one GCS to another normalizes coordinates to +-180 range (left longitude + 360)

Alternate Solution

Use the Define method on a new geographic coordinate system object. This does not make the properties blank.

Sample Code:

Public Sub CustomGCS()

'create a new spatial regernce factory

Dim pSRF As ISpatialReferenceFactory2

Set pSRF = New SpatialReferenceEnvironment

'create a new WGS 1984 coordinate system for providing inputs

Dim pInPutGC As IGeographicCoordinateSystem2

Set pInPutGC = pSRF.CreateGeographicCoordinateSystem(esriSRGeoCS_WGS1984)

'create a new geographic coridnate system

Dim pOutputGC As IGeographicCoordinateSystem2

Dim pGCS As IGeographicCoordinateSystemEdit

Set pOutputGC = New GeographicCoordinateSystem

'set the new coordinate system to IGeographicCoordinateSystemEdit to define custom projections

Set pGCS = pOutputGC

'Define custom projection by providing inputs

pGCS.Define <a href="http://pInPutGC.Name" target="_blank">pInPutGC.Name</a>, pInPutGC.Alias, pInPutGC.Abbreviation, pInPutGC.Remarks, pInPutGC.Usage, pSRF.CreateDatum(esriSRDatumType.esriSRDatum_Abidjan1987), pInPutGC.PrimeMeridian, pInPutGC.CoordinateUnit

Debug.Print "START"

Debug.Print <a href="http://pOutputGC.Name" target="_blank">pOutputGC.Name</a>

Debug.Print pOutputGC.Abbreviation

Debug.Print pOutputGC.Alias

Debug.Print pOutputGC.CoordinateUnit.FactoryCode

Debug.Print pOutputGC.Datum.FactoryCode

Debug.Print pOutputGC.FactoryCode

Debug.Print pOutputGC.LeftLongitude(True)

Debug.Print pOutputGC.PrimeMeridian.FactoryCode

Debug.Print pOutputGC.RightLongitude(True)

Debug.Print "END"

End Sub