Hoppa till huvudinnehållet

How to get Spatial Reference of a map service

Kommentarer

4 kommentarer

  • Permanently deleted user
    Did you try GetMapInfo , will get all the required detail
    0
  • Permanently deleted user
    @Khalid, thanks for the suggestion. I tried GetMapInfo and believe it only returns the SR of the map viewer which is the SR of the map service at the bottom of the map service list. In my case I have multiple map services in various projected coordinate system. I just work out one way to get the SR of a specific map service using Queyr Task to return a feature set and then from the feature set get its SR.
    0
  • Permanently deleted user
    Hey Jack,

     

    It seems like you've figured out how to get the WKID of the spatial reference by using something like this after running Query Task: featureSet1.SpatialReference.WKID

     

    You can also use the GetFeatureLayerInfo activity which returns a "results" object that includes information about the spatial reference. The WKID can be accessed like this: 

     

      featureLayerInfo1.DefaultSpatialReference.WKID

     

    This approach involves about the same number of steps as using QueryTask so I don't know if it's particularly useful in this case, but just thought I'd mention it. FeatureLayerInfo is also useful for getting other information like coded domain values, scale range, field names, etc. 

     

     
    0
  • Permanently deleted user
    Thanks Scott, I think GetFeatureLayerInfo is the one to go, as you said it also include other properties of the feature layers. so good to know. thanks!

     

     
    0

Du måste logga in om du vill lämna en kommentar.