Select to view content in your preferred language

GeocodeResult object doesnt return all available info

967
4
Jump to solution
06-02-2023 09:36 AM
SOTIRIOSTRIANTOS
Regular Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor

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

View solution in original post

0 Kudos
4 Replies
DiveshGoyal
Esri Regular Contributor

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?

0 Kudos
SOTIRIOSTRIANTOS
Regular Contributor

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

SOTIRIOSTRIANTOS_0-1686572617024.png

 

The result only returns the following info 

SOTIRIOSTRIANTOS_2-1686572719008.png

When using the locator through ArcGIS Pro i get all the available info. It appears that .net locator task returns only PlaceName.

 

 

 

 

 

 

0 Kudos
DiveshGoyal
Esri Regular Contributor

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

0 Kudos
SOTIRIOSTRIANTOS
Regular Contributor

i am adding a code snippet 

            GeocodeParameters geocodeParams = new GeocodeParameters();
            geocodeParams.ResultAttributeNames.Add("*");
0 Kudos