ThinkGeo.com    |     Documentation    |     Premium Support

Retrieving information about a Feature

Hi,


I am trying to retrieve information about a Feature that is part of my Layer. I took a look at the Zooming to Select Features sample app from this post: gis.thinkgeo.com/Support/Dis...fault.aspx but I do not see how I can retrieve the X and Y coordinates of a feature using any of the QueryTools.


Could you offer some explaination on how to get the X and Y coordinates?



Steve, 



A feature contains a geometry shape and tabular information, you need to extract the shape from a feature first and then get the specific info within it. Here as following shows how to get a shape from a feature: 




BaseShape shape = feature.GetShape();


If the feature is a PointShape, X, Y could be got by the following code: 




PointShape point = (PointShape)feature.GetShape(); 
double x = point.X; 
double y = point.Y; 



If your feature is not a PointShape, you can also get all the specific information within that shape. 



Let me know for more queries. 



Ben