Reverse Geocoding... What am I doing wrong!?

1561
6
09-29-2021 08:15 AM
JasonCyphers
Occasional Contributor III

I've read through multiple posts about revere geocoding (long press on the map to auto-populate an "address" field within the Survey123 form).  I've tried over and over to get it to work, with no success.

If I enter:

pulldata("@geopoint",${location},"x","https://my company's geocoder URL")

I do get an X coordinate that auto-populates the address field.  If I enter:

pulldata("@geopoint",${location},"reversegeocode.address.singleLineAddressField","https://my company's geocoder URL"

I get nothing.

What am I missing/doing wrong?

6 Replies
IsmaelChivite
Esri Notable Contributor

Hi. The problem sits on the property name you are passing to the pulldata() function. I bet that the property address.singleLineAddressField does not exist in the output returned by the geocode service you are using.

Below, I am copying the output you can expect from the ArcGIS World Geocoding service. I took the example from this blog. If you use this geocoding service, then you will want to use reversegeocode.address.Match_addr for example.

The output of the reverse geocode call changes dependign on the geocoding service you are using. To inspect in detail the output you get, follow instructions from the blog post above. Hope this helps.

 

{
	"address": {
		"Match_addr": "570 St Kilda Rd, Melbourne, Victoria, 3004",
		"LongLabel": "570 St Kilda Rd, Melbourne, Victoria, 3004, AUS",
		"ShortLabel": "570 St Kilda Rd",
		"Addr_type": "PointAddress",
		"Type": "",
		"PlaceName": "",
		"AddNum": "570",
		"Address": "570 St Kilda Rd",
		"Block": "",
		"Sector": "",
		"Neighborhood": "Melbourne",
		"District": "",
		"City": "Melbourne",
		"MetroArea": "",
		"Subregion": "",
		"Region": "Victoria",
		"Territory": "",
		"Postal": "3004",
		"PostalExt": "",
		"CountryCode": "AUS"
	},
	"location": {
		"x": 144.97914150000003,
		"y": -37.847384999999996,
		"spatialReference": {
			"wkid": 4326,
			"latestWkid": 4326
		}
	}
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

JasonCyphers
Occasional Contributor III

Thanks for the reply.

My company's geocoder has a "Match_addr" field, but even putting that (reversegeocode.address.Match_addr) into the calculation doesn't return any results.

I've even tried takin the geocoder URL out and just used pulldata("@geopoint",${location},"reversegeocode.address.Match_addr"), and that doesn't work.  If I modify the "reversegeocode.address.Match_addr" to pull coordinates, it works.

LeonardBarnhill
Occasional Contributor

I may be missing the point also but have you tried  pulldata("@geopoint",${address},"reversegeocode.address.Match_addr","https://my company's geocoder URL")

JasonCyphers
Occasional Contributor III

I thought the ${address} field you mentioned was the name of the geopoint field?

JasonCyphers_0-1633089865818.png

 

 

ThomasHamill
Occasional Contributor II

@JasonCyphers, here's how I've configured it.  Right column is the calculation column.  Hope this helps.

ThomasHamill_0-1633440496459.png

 

Kindest Regards,

t
0 Kudos
JasonCyphers
Occasional Contributor III

Thanks.  That's pretty much exactly what I have.  I can get coordinates to work, but not address.  I've tried Match_addr and ShortLabel, neither work.

JasonCyphers_0-1634751459872.png

 

JasonCyphers_1-1634751520860.png

Oddly, it works in the web form, but in Connect and on the mobile app, I do get an error when long pressing on the map that "Reverse geocoding is not available when searching all geocoders.  Please select a single geocoder."