Survey123 Connect: reverse geocoding, find address candidates

348
2
01-04-2021 10:21 AM
Sean_S
by
New Contributor II

Can anyone give an example of a reverse geocoding, find address candidates example in excel forms, as used with Survey123 connect?

I can user pulldata as in: pulldata("@geopoint",${location},"reversegeocode","...mygeocoderurl.../GeocodeServer")

My idea then was to create a Single line Address which was easy enough.

But the data returned is terse, where when using the REST on the geocodeserver, I can see that there is much more data returned from 'findAddressCandidates'.

So I have attempted to use findAddressCandidates, sending the Single Line Address to get more information.

Does anyone have a example of it used in the 'calculation' area of the excel form?

I have tried a variety of syntax with no positive results, here is one example:

pulldata("@geopoint",${location},"findAddressCandidates","https://mygeocoderurl","SingleLine=" + ${single_line_address},"outFields=*","f=pjson")

2 Replies
Sean_S
by
New Contributor II

Additional Information:

Does anyone have an example, of the syntax, in excel forms for Survey123?

The idea is to:

  1. click on map to get location
  2. build a single line string
  3. send single line string in to Find Address Candidates
  4. Create choices from the top 3 candidates, if they exist.
  5. Extract information and fill in form.

I have the REST endpoint and everything works fine.

I chose a random building in downtown Oslo on the map and this work except that it picks a candidate:

{
"address": {
"Adresse": "Stenersgata 1 A",
"Stedsnavn": null,
"Postnummer": "0050",
"Poststed": "Oslo",
"Kommune": "Oslo",
"GNR": null,
"BNR": null,
"FNR": null,
"SNR": null,
"Loc_name": "Adresse"
},
"location": {
"x": 262514.59061553096,
"y": 6649302.0854366813,
"spatialReference": {
"wkid": 25833,
"latestWkid": 25833,
"vcsWkid": 115700,
"latestVcsWkid": 115700
}
}
}

Single Line = Stenersgata 1, 0050 Oslo

Putting that into REST endpoint to find address candidates:

{
"spatialReference": {
"wkid": 25833,
"latestWkid": 25833,
"vcsWkid": 115700,
"latestVcsWkid": 115700
},
"candidates": [
{
"address": "Stenersgata 1 A, 0050 Oslo",
"location": {
"x": 262514.59061553096,
"y": 6649302.0854366813
},
"score": 94.900000000000006,
"attributes": {
"Loc_name": "Adresse",
"Score": 94.900000000000006,
"Match_addr": "Stenersgata 1 A, 0050 Oslo",
"Gatenavn": "Stenersgata",
"Husnummer": "1 A",
"Postnummer": "0050",
"Poststed": "Oslo",
"Kommune": "Oslo",
"Fylke": "Oslo",
"Adresseid": "285771576",
"Komm_Navn": "Oslo",
"Komm_Nr": "0301",
"GNR": "208",
"BNR": "602",
"FNR": "",
"SNR": "",
"Addr_type": "Address",
"Stedsnavn": "",
"POI": ""
}
},
{
"address": "Stenersgata 1 B, 0050 Oslo",

.

.

And it continues with 2 more... C, and one without a letter.

So how do I access the Find Address Candidates to get make a choice list and or get data?

It also works in the map when searching: 

Sean_S_0-1610042203555.png

Using Fiddler, I can see the Survey123 app parameters and response:

Sean_S_1-1610044340125.png

 

Does the workflow make sense?

If so, how does one reversegeocode with find address candidates in the excel form using pulldata?

 

 

0 Kudos
Sean_S
by
New Contributor II

bump

0 Kudos