I am using ArcGIS runtime .net sdk. I 've created a locator task for offline geocoding.
I noticed that i cannot access all the fields in the returned result. i.e whilst in the poi locator i registered a phone number i cannot access that info through .net. When ArcGIS Pro i can see that info (zip, long label, city region etc).
I want to gain access to phone number field as an insurance policy that locator's score is valid.
Is there something that i am missing when creating the Locator task object or calling the geocoding method?
Solved! Go to Solution.
Ah, you are probably missing setting the ResultAttributeNames property on the GeocodeParameters.
By default the locator task only returns a subset of the attributes in the result to be efficient.
But you can specify which attributes you want using that parameter
Its possible you've encountered a bug. I would expect all the fields in the locator to be available.
The LocatorTask has a locatorInfo property that provides information about the locator. After the task is loaded, can you inspect the ResultAttributes to see if it includes the phone field? If it doesn't, that would explain why you aren't seeing it in the results.
What version of Pro was used to build the locator?
What version of the .net sdk are you using?
I am using ArcGIS Pro 3.1.2 and 200.1.0 .net sdk.
when the locator task is loaded the following can be seen in the ResultAttributes
The result only returns the following info
When using the locator through ArcGIS Pro i get all the available info. It appears that .net locator task returns only PlaceName.
Ah, you are probably missing setting the ResultAttributeNames property on the GeocodeParameters.
By default the locator task only returns a subset of the attributes in the result to be efficient.
But you can specify which attributes you want using that parameter
i am adding a code snippet
GeocodeParameters geocodeParams = new GeocodeParameters();
geocodeParams.ResultAttributeNames.Add("*");