Select to view content in your preferred language

Get X,Y values from point Feature- v100.7 WPF

576
1
Jump to solution
04-21-2020 05:26 AM
PrashantKirpan
Frequent Contributor

Hi All,

I am trying to get X,Y coordinates from point feature object. I ran a query on FeatureLayer and got individual feature from FeatureQueryResult.

I can see geometry property in feature object but couldn't find X,Y values.

Is there any way to extract x,y values from feature service or feature object? 

Any help would be appreciated.

 

Regards,

Prashant

0 Kudos
1 Solution

Accepted Solutions
JoeHershman
MVP Regular Contributor

You need to cast the geometry to a MapPoint

var mapPoint = (MapPoint)feature.Geometry;  //assumes we know it is a point
double x = mapPoint.X;
double y = mapPoint.Y‍‍‍
Thanks,
-Joe

View solution in original post

1 Reply
JoeHershman
MVP Regular Contributor

You need to cast the geometry to a MapPoint

var mapPoint = (MapPoint)feature.Geometry;  //assumes we know it is a point
double x = mapPoint.X;
double y = mapPoint.Y‍‍‍
Thanks,
-Joe