<?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: ArcGIS 3.0.3 - centroid x and y expressions not consistent ArcGIS Pro vs Portal? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1258024#M65501</link>
    <description>&lt;P&gt;Thanks (&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108" target="_self"&gt;@XanderBakker&lt;/A&gt; too). It really helped.In addition, I used a simple if statment in order to display WGS84 lat/lon in decimal degrees in ArcGIS Pro, and once published to Portal using the MetersToLatLon function.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;IIf(centroid($feature).x &amp;lt;= 180 &amp;amp;&amp;amp; centroid($feature).x &amp;gt;= -180, centroid($feature).y + ',' + centroid($feature).x,
MetersToLatLon(centroid($feature).x, centroid($feature).y)[0] + ',' + MetersToLatLon(centroid($feature).x, centroid($feature).y)[1]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2023 15:45:12 GMT</pubDate>
    <dc:creator>VincentLaunstorfer</dc:creator>
    <dc:date>2023-02-14T15:45:12Z</dc:date>
    <item>
      <title>ArcGIS 3.0.3 - centroid x and y expressions not consistent ArcGIS Pro vs Portal?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254867#M65093</link>
      <description>&lt;P&gt;In ArcGIS Pro, I made 2 simple Arcade expressions to display lat and long in PopUps for polygons centroids.&lt;/P&gt;&lt;P&gt;Centroid($feature).x and Centroid($feature).y&lt;/P&gt;&lt;P&gt;As the layer is in WGS84, I get nice decimal degrees coordinates for centroids in pop-ups&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Decimal_Degrees_lat_long.png" style="width: 166px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62040i929C0DAED2C2299E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Decimal_Degrees_lat_long.png" alt="Decimal_Degrees_lat_long.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once published as a Hosted layer, the same pop-ups using same Arcade expressions display funny coordinates, like some sort of projected coordinates in meters/feets&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Decimal_Degrees_lat_long_Portal.png" style="width: 159px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62041i74B9FD022C082673/image-size/large?v=v2&amp;amp;px=999" role="button" title="Decimal_Degrees_lat_long_Portal.png" alt="Decimal_Degrees_lat_long_Portal.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it normal behavior? Is there any way to force Arcade in Portal to display decimal degrees in WGS84?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:35:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254867#M65093</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2023-02-03T15:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 3.0.3 - centroid x and y expressions not consistent ArcGIS Pro vs Portal?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254874#M65095</link>
      <description>&lt;P&gt;The post-publishing coordinates are showing Web Mercator units. When you ask for coordinates in a web map, it will use the coordinates of the web map's projection, not the layer.&lt;/P&gt;&lt;P&gt;It &lt;EM&gt;is &lt;/EM&gt;possible to get AGOL to open a WGS84 basemap, thus altering the map's projection, and your same expression would return decimal degrees.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:47:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254874#M65095</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-02-03T15:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 3.0.3 - centroid x and y expressions not consistent ArcGIS Pro vs Portal?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254878#M65096</link>
      <description>&lt;P&gt;I thought about the web-Mercator projection, it makes sense although not handy! In Arcade, I wonder if there is any function to translate the web-Mercator coordinates back to WGS84 decimal degrees...? Something like GeodeticX and GeodeticY, just like AreaGeodetic functions...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254878#M65096</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2023-02-03T15:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 3.0.3 - centroid x and y expressions not consistent ArcGIS Pro vs Portal?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254887#M65097</link>
      <description>&lt;P&gt;There isn't a built-in one (though that would be really handy!) But you can find a really nice function that &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt; posted &lt;A href="https://community.esri.com/t5/developers-questions/lat-long-unit-conversion-with-arcade/m-p/207272/highlight/true#M1263" target="_self"&gt;over here&lt;/A&gt;, which I am pasting with modifications below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function MetersToLatLon(x, y) {
    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];
}‍‍‍‍‍‍‍‍‍‍‍

var c = Centroid($feature)

var coords = MetersToLatLon(c.x, c.y)

return Concatenate(coords, '\n')&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 Feb 2023 16:10:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1254887#M65097</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-02-03T16:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 3.0.3 - centroid x and y expressions not consistent ArcGIS Pro vs Portal?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1258024#M65501</link>
      <description>&lt;P&gt;Thanks (&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108" target="_self"&gt;@XanderBakker&lt;/A&gt; too). It really helped.In addition, I used a simple if statment in order to display WGS84 lat/lon in decimal degrees in ArcGIS Pro, and once published to Portal using the MetersToLatLon function.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;IIf(centroid($feature).x &amp;lt;= 180 &amp;amp;&amp;amp; centroid($feature).x &amp;gt;= -180, centroid($feature).y + ',' + centroid($feature).x,
MetersToLatLon(centroid($feature).x, centroid($feature).y)[0] + ',' + MetersToLatLon(centroid($feature).x, centroid($feature).y)[1]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 15:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-3-0-3-centroid-x-and-y-expressions-not/m-p/1258024#M65501</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2023-02-14T15:45:12Z</dc:date>
    </item>
  </channel>
</rss>

