Set distance parameter in Geocode operation

04-05-2018 08:43 AM
New Contributor II

UWP runtime, version 100.2.1.

I am geocoding an address using Esri.ArcGISRuntime.Tasks.Geocoding.LocatorTask and would like to adjust the scores of the results using the location and distance parameters available in Geocode REST API

However, I cannot see a way that the distance parameter can be set. The parameters class (Esri.ArcGISRuntime.Tasks.Geocoding.GeocodeParameters) contains a PreferredSearchLocation property that will set the location parameter for the request, but it doesn't have a property for setting the distance. Using fiddler to inspect the request, I can see that the distance parameter is set to 50000 by default. This does not appear to be in any of the examples.

How can I set the distance parameter of a geocode request when using the LocatorTask?



0 Kudos
1 Reply
Occasional Contributor III

Hi Jeff,

As you see from REST API documentation, findAddressCandidates—ArcGIS REST API: World Geocoding Service | ArcGIS for Developers , "the default distance is 50,000 meters; this value is not configurable.". Also please look at the note where it is mentioned that "The distance parameter is deprecated and no longer recognized by the service. A default distance of 50,000 meters is now used internally by the service to boost candidate priority for all requests with location." So it isn't possible to set distance parameter in geocoding operation.

Hope that helps.

0 Kudos