Hi,for an application I have to get the unit of the coordinate system of a featureClass. (I'm using VBA)What I do is: I take the layer with the FeatureClass. Then give the Layer to IGeoDataset. The Reference System of the dataset I pass to IGeographicCoordinateSystem or IProjectedCoordinateSystem. Finaly i get the unit from IUnit.My problem is: Bevor I pass to IGeographicCoordinateSystem or IProjectedCoordinateSystem, I have to know, if it is a GCS or a PCS. Otherwise I get an error.I didn't find out how I can check this before.Does anyone of you have an idea?
If TypeOf pSpatialReference Is IGeographicCoordinateSystem Then MsgBox "GeographicCoordinateSystem" End If If TypeOf pSpatialReference Is IUnknownCoordinateSystem Then MsgBox "UnknownCoordinateSystem" End If If TypeOf pSpatialReference Is IProjectedCoordinateSystem Then MsgBox "ProjectedCoordinateSystem" End If
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.