français
Numéro de bogue NIM100236
Envoyé Mar 26, 2014
Modified Jun 11, 2020
Gravité High
S’applique à ArcGIS for Desktop
Version trouvée 10.2.1
Langage de programmation All
Plateforme serveur
Plateforme client
Base de données N/D
Paramètre régional N/D
Statut Not in Current Product Plan
Version corrigée
Résolu par le fournisseur

Bogue NIM100236

Synopsis

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


Informations supplémentaires

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


Autre 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