<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reverse Geocode from geoshape in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/1158284#M41653</link>
    <description>&lt;P&gt;Hi Chris, I wonder if you could elaborate on "&lt;EM&gt;In the launch url I&amp;nbsp;parse the poly centroid xy to the hidden lat and long fields". &lt;/EM&gt;I am attempting to extract the geoshape centroid and not sure how to do this.&lt;/P&gt;&lt;P&gt;Thanks very much for your help&lt;/P&gt;</description>
    <pubDate>Mon, 28 Mar 2022 09:11:22 GMT</pubDate>
    <dc:creator>CherylWheeler11</dc:creator>
    <dc:date>2022-03-28T09:11:22Z</dc:date>
    <item>
      <title>Reverse Geocode from geoshape</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/865484#M26905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am hoping that someone has a bright idea here, because I am out of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Collector/Explorer app with a link on the pop up for the Parcel Layer, that parses the boundary coordinates to a geoshape question in Survey123 .. that bit works great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is in&amp;nbsp;Survey123 is perform a reverse geocode on the Geoshape to get the street address.&amp;nbsp; It would appear, obviously, that the pulldata("@geoshape",${location},"reverseGeocode.address.Street","https://xxxxxxxx/server/rest/services/Locators/xxxxxxx/GeocodeServer")&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;&amp;nbsp;calculation doesn't work for a geoshape question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;So I came up with a solution to add a geopoint question inside a repeat (because you cant have a geoshape and geopoint in the same form unless one is in a repeat) and use that to reverse geocode on. Now that works in the form itself, so tick!. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;Then I thought I could&amp;nbsp;calculate&amp;nbsp;XY centroid of the poly in Collector using Arcade, tick, then parse that to the geopoint question.&amp;nbsp; HOWEVER, I have since found out that parsing information from Collector to Survey123 to questions inside a repeat isn't supported.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; background-color: #ffffff; font-weight: inherit;"&gt;Anyone have any solutions?&amp;nbsp; Any help would be greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2020 01:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/865484#M26905</guid>
      <dc:creator>ChrisRoberts2</dc:creator>
      <dc:date>2020-07-10T01:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse Geocode from geoshape</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/865485#M26906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I cracked it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For those that are interested:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added two lat and long&amp;nbsp; hidden null fields outside the Repeat in the survey.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the geopoint question added a concat calculation 'concat(${latitude}," ", ${longitude})' using&amp;nbsp; those two fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then just use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;pulldata("@geopoint",${location},"reverseGeocode.address.Street","&lt;/SPAN&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fxxxxxxxx%2Fserver%2Frest%2Fservices%2FLocators%2Fxxxxxxx%2FGeocodeServer" rel="nofollow" style="color: #287433; background-color: #ffffff; border: 0px; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;https://xxxxxxxx/server/rest/services/Locators/xxxxxxx/GeocodeServer&lt;/A&gt;&amp;nbsp;to grab the street address&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the launch url I&amp;nbsp;parse the poly centroid xy to the hidden lat and long fields in the Survey form and&amp;nbsp;a geopoint is created at the centre of the polygon and the address is populated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy Days!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2020 04:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/865485#M26906</guid>
      <dc:creator>ChrisRoberts2</dc:creator>
      <dc:date>2020-07-10T04:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse Geocode from geoshape</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/1158284#M41653</link>
      <description>&lt;P&gt;Hi Chris, I wonder if you could elaborate on "&lt;EM&gt;In the launch url I&amp;nbsp;parse the poly centroid xy to the hidden lat and long fields". &lt;/EM&gt;I am attempting to extract the geoshape centroid and not sure how to do this.&lt;/P&gt;&lt;P&gt;Thanks very much for your help&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 09:11:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/1158284#M41653</guid>
      <dc:creator>CherylWheeler11</dc:creator>
      <dc:date>2022-03-28T09:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse Geocode from geoshape</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/1158650#M41691</link>
      <description>&lt;P&gt;Hi Cheryl&lt;/P&gt;&lt;P&gt;I extract the lats and longs for the centroid of the Parcel Polygon in Field Maps/Explorer using Arcade (I found on the forums and slightly tweaked):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;function MetersToLatLon(mx, my) {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;// Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;// Fuente: &lt;A href="http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/" target="_blank"&gt;http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var originShift = 2.0 * PI * 6378137.0 / 2.0;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var lon = (mx / originShift) * 180.0;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var lat = (my / originShift) * 180.0;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return [lat, lon];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;var poly = Geometry($feature);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var result = "";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if (!IsEmpty(poly)) {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var pnt_centr = Centroid(poly);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var latlon = MetersToLatLon(pnt_centr.x, pnt_centr.y);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;result = latlon[0] ; //returns latitude replace with [1] to get longitude&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;} else {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;result = "";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;return result;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and in the launch url I parse those expressions to the lats and long fields in the Survey123 form.&lt;/P&gt;&lt;P&gt;eg&lt;/P&gt;&lt;P&gt;&lt;A href="https://survey123.arcgis.com/share/xxxxx?portalUrl=https://xxxxx/portal&amp;amp;amp;open=menu&amp;amp;field:longitude={expression/expr1}&amp;amp;field:latitude={expression/expr0}" target="_blank"&gt;https://survey123.arcgis.com/share/xxxxx?portalUrl=https://xxxxx/portal&amp;amp;amp;open=menu&amp;amp;field:longitude={expression/expr1}&amp;amp;field:latitude={expression/expr0}&lt;/A&gt;&lt;/P&gt;&lt;P&gt;hope that helps&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 00:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/reverse-geocode-from-geoshape/m-p/1158650#M41691</guid>
      <dc:creator>ChrisRoberts2</dc:creator>
      <dc:date>2022-03-29T00:21:57Z</dc:date>
    </item>
  </channel>
</rss>

