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
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.