I am having a difficult time finding documentation regarding how to return street addresses from a Reverse Geocode request to my custom locator. I am only able to get a City & State in the REST response.
For example:
(1) First, I'll visit my custom locator's findAddressCandidates operation, and I'll GET in an address that my locator can return, (i.e. "5905 Wilshire Blvd, 90036" - the LA County Museum of Art). A point candidate is returned with a score of 100 and coordinates of {"x": -118.357929, "y": 34.062822}. My custom locator uses GCS_WGS_1984, wkid 4326.
(2) Next, I visit my custom locator's reverseGeocode operation and in the location field, I GET a request with the location parameter set to {"x":-118.357929,"y":34.062822,"spatialReference":{"wkid":4326}}.
(3) The value that is returned from the REST call in JSON format is pasted below. The original address is not returned, only the city and state.
{
"address": {
"Match_addr": "Los Angeles, California",
"LongLabel": "Los Angeles, CA",
"ShortLabel": "Los Angeles",
"Addr_type": "Locality",
"Type": "City",
"PlaceName": "Los Angeles",
"AddNum": "",
"Address": "",
"Block": "",
"Sector": "",
"Neighborhood": "",
"District": "",
"City": "Los Angeles",
"MetroArea": "",
"Subregion": "",
"Region": "California",
"RegionAbbr": "CA",
"Territory": "",
"Postal": "",
"PostalExt": "",
"CntryName": "USA",
"CountryCode": ""
},
"location": {
"x": -118.357929,
"y": 34.062822,
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
}
}
}
As I mentioned, I have looked through the reverse geocoding documentation and I haven't been able to identify why my locator won't return street address, postcode, etc. Has anybody else experienced this? @ShanaBritt do you have any input on how to configure the locator so that street address is returned from the reverse geocode operation? I am running ArcGIS Enterprise 11.3.
Solved! Go to Solution.
Do you get the same result in ArcGIS Pro with the locator you created? Right-click in the map at the LACMA location and select "What's here?" and the pop-up will display the results.
https://pro.arcgis.com/en/pro-app/latest/help/data/geocoding/fundamentals-of-reverse-geocoding.htm
Which roles were used to create the custom locator?
What was the Addr_type value that was returned for the findAddressCandidates request for the LACMA address?
If the locator includes the StreetAddress role, you can specify 'Street Address' as the Feature Type parameter in your reverseGeocode REST request. https://developers.arcgis.com/rest/services-reference/enterprise/reverse-geocode/#choose-specific-ou...
Do you get the same result in ArcGIS Pro with the locator you created? Right-click in the map at the LACMA location and select "What's here?" and the pop-up will display the results.
https://pro.arcgis.com/en/pro-app/latest/help/data/geocoding/fundamentals-of-reverse-geocoding.htm
Which roles were used to create the custom locator?
What was the Addr_type value that was returned for the findAddressCandidates request for the LACMA address?
If the locator includes the StreetAddress role, you can specify 'Street Address' as the Feature Type parameter in your reverseGeocode REST request. https://developers.arcgis.com/rest/services-reference/enterprise/reverse-geocode/#choose-specific-ou...
(1) "What's here" in ArcGIS Pro returns the address as expected (as a PointAddress), it also returns the LACMA record from my POI dataset.
(2) The custom locator is a composite street address locator with StreetAddress, PointAddress, POI, and City (Locality) roles.
(3) FindAddressCandidates did not expclitly return an Addr_type, only XY coordinates and a score.
(4) This is what I was looking for! I should have noted - I am still working with the ArcGIS API for Javascript 3.x and I'm using the retired Web Appbuilder. The WABs Locator class's locationToAddress() method does not accept a Feature Type parameter by default. I was able to define a "CustomLocator" class that includes a FeatureType in the reverseGeocode REST request and was able to filter out the "Locality" Addr_type that was being returned, and stick to "PointAddress" and "StreetAddress". I am in the process of migrating to ExB using the ArcGIS SDK for Javascript 4.30 and it appears that the Locator class's locationToAddress() method does, by default, take a Feature Type parameter.
Is there a reason why you are using a composite locator instead of a multirole locator of the same roles (Street Address, Point Address, POI, and City)?
https://pro.arcgis.com/en/pro-app/latest/help/data/geocoding/tutorial-create-a-multirole-locator.htm
Yes, I have multiple reference data layers that require a PointAddress role, but the reference data can't be combined into a single dataset