How to determine geographic coordinates of an object found using a local locator (.loc file)

457
1
06-06-2017 06:37 PM
New Contributor II
I search for objects on the map using the local locator. The search works and finds objects. But I can not understand how to extract the geographical coordinates of the found volume from the search results.
Reply
0 Kudos
1 Reply
Occasional Contributor III

Hi Yuri,

You could set the OutputSpatialReference of the GeocodeParameters to "SpatialReferences.Wgs84" to get the geographical coordinates

GeocodeParameters gcParams = new GeocodeParameters();
gcParams.OutputSpatialReference = SpatialReferences.Wgs84;

IReadOnlyList<GeocodeResult> results = await localLocatorTask.GeocodeAsync("address", gcParams);

Debug.WriteLine("Latitude: " + results[0].InputLocation.Y + " Longitude: " + results[0].InputLocation.X);

Hope that helps. Thanks

Nagma