<?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: Arcade Expression to populate longitude and latitude in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1405416#M58458</link>
    <description>&lt;P&gt;where you able to find a script to convert to your desired coordinates.&amp;nbsp; we are trying to do the same.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 19:31:34 GMT</pubDate>
    <dc:creator>MarkGambordella</dc:creator>
    <dc:date>2024-04-03T19:31:34Z</dc:date>
    <item>
      <title>Arcade Expression to populate longitude and latitude</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1199512#M47238</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Pretty new to Arcade. I need to take the geometry of my point feature and populate the field "Latitude" with the y geometry. Then run through that again but take the x geometry and populate the field "Longitude". My point feature was created in ArcPro, the map was in WGS84 for the creation, I verified again that my point feature is WGS84. I'm looking for decimal degrees but I'm not sure what this 5307669.5296 value is. Looking at other posts, sounds like its in meters? There's other posts about converting to what I'm looking for but I'm not sure where in the conversion code to plug in my '$feature'. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;I'm aware of this code here. I'm just not sure where in the expression to plug in my data (the $feature)?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt;function MetersToLatLon(x, y) {
    // Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum
    // Fuente: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
    var originShift = 2.0 * PI * 6378137.0 / 2.0;

    var lon = (x / originShift) * 180.0;
    var lat = (y / originShift) * 180.0;

    lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
    return [lat, lon];
}‍‍‍‍‍‍‍‍‍‍‍&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the page I'm referring to:&amp;nbsp;&lt;A href="https://community.esri.com/t5/developers-questions/lat-long-unit-conversion-with-arcade/m-p/207272?commentID=806053#comment-806053" target="_self"&gt;Lat/Long unit conversion&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Playing around with this code, its not failing but its also not producing any 'results' - and I think I just don't know where to plug in my $feature&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 17:23:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1199512#M47238</guid>
      <dc:creator>KWilliams</dc:creator>
      <dc:date>2022-08-04T17:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to populate longitude and latitude</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1200426#M47285</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've used this code in the past to auto populate a pop-up with Lat, Long. I didn't change anything about the code at all. Except there was a second half to what you have:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;function MetersToLatLon(mx, my) {&lt;BR /&gt;// Converts XY point from Spherical web Mercator EPSG:900913 to lat/lon in WGS84 Datum&lt;BR /&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;BR /&gt;var originShift = 2.0 * PI * 6378137.0 / 2.0;&lt;/P&gt;&lt;P&gt;var lon = (mx / originShift) * 180.0;&lt;BR /&gt;var lat = (my / originShift) * 180.0;&lt;/P&gt;&lt;P&gt;lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);&lt;BR /&gt;return [lat, lon];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var poly = Geometry($feature);&lt;/P&gt;&lt;P&gt;var result = "";&lt;BR /&gt;if (!IsEmpty(poly)) {&lt;BR /&gt;var pnt_centr = Centroid(poly);&lt;/P&gt;&lt;P&gt;var latlon = MetersToLatLon(pnt_centr.x, pnt_centr.y);&lt;/P&gt;&lt;P&gt;result = Round(latlon[0], 6) + "," + Round(latlon[1], 6);&lt;BR /&gt;} else {&lt;BR /&gt;result = "";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return result;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This returned both in one line, but you can tweak the result to only show one. I found it &lt;A href="https://geotalk.cast.uark.edu/latitude-longitude-labels-with-an-arcade-expression-arcgis-online-tips/" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 15:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1200426#M47285</guid>
      <dc:creator>Savannah2019</dc:creator>
      <dc:date>2022-08-08T15:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to populate longitude and latitude</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1379979#M57371</link>
      <description>&lt;P&gt;Is it possible to convert coordinates from EPSG:2881 NAD83(HARN) / Florida East (ftUS) to EPSG4326 using Arcade in ArcGIS Pro?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 20:05:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1379979#M57371</guid>
      <dc:creator>ErnestoCarreras4</dc:creator>
      <dc:date>2024-02-08T20:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to populate longitude and latitude</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1405416#M58458</link>
      <description>&lt;P&gt;where you able to find a script to convert to your desired coordinates.&amp;nbsp; we are trying to do the same.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 19:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1405416#M58458</guid>
      <dc:creator>MarkGambordella</dc:creator>
      <dc:date>2024-04-03T19:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to populate longitude and latitude</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1604923#M64391</link>
      <description>&lt;P&gt;&lt;SPAN&gt;where you able to find a script to convert to your desired coordinates.&amp;nbsp; we are trying to do the same.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 19:43:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1604923#M64391</guid>
      <dc:creator>BigLouC</dc:creator>
      <dc:date>2025-04-10T19:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression to populate longitude and latitude</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1667906#M67182</link>
      <description>&lt;P&gt;Were you able to find a solution?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Nov 2025 16:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-populate-longitude-and/m-p/1667906#M67182</guid>
      <dc:creator>apgis16</dc:creator>
      <dc:date>2025-11-21T16:14:11Z</dc:date>
    </item>
  </channel>
</rss>

