<?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 Get Latitude and Longitude from geometry in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561004#M1636</link>
    <description>&lt;P&gt;I would like to get the Latitude and Longitude from my feature geometry in&amp;nbsp;NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet (EPSG:2264). I came across a solution that gets the lat lon from a feature geometry in Web Mercator at the below location.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcade-expressions/blob/master/form_calculation/GeometryAsAttribute.md" target="_blank"&gt;https://github.com/Esri/arcade-expressions/blob/master/form_calculation/GeometryAsAttribute.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I was wondering if something like that would be a available for extracting lat lon from State Plane geometry.&lt;/P&gt;&lt;P&gt;-lak&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2024 21:08:43 GMT</pubDate>
    <dc:creator>lakshmanankrishnan</dc:creator>
    <dc:date>2024-11-20T21:08:43Z</dc:date>
    <item>
      <title>Get Latitude and Longitude from geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561004#M1636</link>
      <description>&lt;P&gt;I would like to get the Latitude and Longitude from my feature geometry in&amp;nbsp;NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet (EPSG:2264). I came across a solution that gets the lat lon from a feature geometry in Web Mercator at the below location.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcade-expressions/blob/master/form_calculation/GeometryAsAttribute.md" target="_blank"&gt;https://github.com/Esri/arcade-expressions/blob/master/form_calculation/GeometryAsAttribute.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I was wondering if something like that would be a available for extracting lat lon from State Plane geometry.&lt;/P&gt;&lt;P&gt;-lak&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 21:08:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561004#M1636</guid>
      <dc:creator>lakshmanankrishnan</dc:creator>
      <dc:date>2024-11-20T21:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get Latitude and Longitude from geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561043#M1637</link>
      <description>&lt;P&gt;Below is an Arcade function that I use for EPSG 6588. This comes from a SQL function that I found on GeoNet years ago in this thread &lt;A href="https://community.esri.com/t5/coordinate-reference-systems-questions/formula-for-state-plane-to-lat-lon-conversion/m-p/870543" target="_blank"&gt;https://community.esri.com/t5/coordinate-reference-systems-questions/formula-for-state-plane-to-lat-lon-conversion/m-p/870543&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I converted it to an Arcade function. My understanding is that it only works with Lambert Conformal Conic projections. You will need to update the constant values at the beginning of the function with EPSG 2264 values.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function StatePlaneToLatLong(x, y) {
    // false origin values
    var fx = 1968500.0 /* Enter false easting value */
    var fy = 13123333.33333333 /* Enter false northing value */
    // latitude of origin values
    var loD = 27.83333333333333 /* Enter latitude of origin value */
    var loR = loD * PI / 180
    // central meridian values
    var cmD = -99.0 /* Enter central meridian value */
    var cmR = cmD * pi / 180
    // standard parallel values
    var sp1D = 28.383333333333333 /* Enter standard parallel 1 value */
    var sp1R = sp1D * PI / 180
    var sp2D = 30.283333333333333 /* Enter standard parallel 2 value */
    var sp2R = sp2D * PI / 180
    // semimajor axis values
    var smjrM = 6378137.0 /* Enter semimajor axis value in meters */
    var smjrF = smjrM * 3.2808333
    // semiminor axis values
    var smnrM = 6356752.314140356 /* Enter semiminor axis value in meters */
    // inverse flattening value
    var iflat = smjrM / (smjrM - smnrM)
    // flattenging value
    var flat = 1 / iflat
    // eccentricity value
    var e = Sqrt(2 * flat - Pow(flat,2))
    // m values
    var m1 = Cos(sp1R) / Pow((1 - Pow(e,2) * Pow(Sin(sp1R),2)), 0.5)
    var m2 = Cos(sp2R) / Pow((1 - Pow(e,2) * Pow(Sin(sp2R),2)), 0.5)
    // t values
    var t1 = Tan((PI / 4) - (sp1R / 2)) / Pow((1 - (e * Sin(sp1R))) / (1 + (e * Sin(sp1R))), (e / 2))
    var t2 = Tan((PI / 4) - (sp2R / 2)) / Pow((1 - (e * Sin(sp2R))) / (1 + (e * Sin(sp2R))), (e / 2))
    var tf = Tan((PI / 4) - (loR / 2)) / Pow((1 - (e * Sin(loR))) / (1 + (e * Sin(loR))), (e / 2))
    // n value
    var n = (Log(m1) - Log(m2)) / (Log(t1) - Log(t2))
    // f value
    var F = m1 / (n * Pow(t1, n))
    // r value
    var rf = smjrF * F * Pow(tf, n)
    // r' value
    var rz = Pow(Pow((x - fx), 2) + Pow((rf - (y - fy)), 2), 0.5)
    // t' value
    var tz = Pow((rz / (smjrF * F)), (1 / n))
    // thetha' value
    var zz = Atan((x - fx) / (rf - (y - fy)))
    // latitude trial value in radians
    var latTR = (PI / 2) - (2 * Atan(tz))
    // latitude iteration 1 value in radians
    var lat1R = (PI / 2) - (2 * Atan((tz * Pow((1 - (e * Sin(latTR))) / (1 + (e * Sin(latTR))), (e / 2)))))
    // latitude iteration 2 value in radians
    var lat2R = (PI / 2) - (2 * Atan((tz * Pow((1 - (e * Sin(lat1R))) / (1 + (e * Sin(lat1R))), (e / 2)))))
    // latitude iteration 3 value in radians
    var lat3R = (PI / 2) - (2 * Atan((tz * Pow((1 - (e * Sin(lat2R))) / (1 + (e * Sin(lat2R))), (e / 2)))))
    // latitude iteration 4 value in radians
    var lat4R = (PI / 2) - (2 * Atan((tz * Pow((1 - (e * Sin(lat3R))) / (1 + (e * Sin(lat3R))), (e / 2)))))
    // latitude final iteration value in radians
    var latFR = (PI / 2) - (2 * Atan((tz * Pow((1 - (e * Sin(lat4R))) / (1 + (e * Sin(lat4R))), (e / 2)))))
    // latitude value in degrees
    var latFD = (latFR * 180) / PI
    // longitude value in radians
    var lonR = ((zz / n) + cmR)
    // longitude value in degrees
    var lonD = (lonR * 180) / pi
    // Return the latitude in degrees
    return [lonD,latFD];
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 22:22:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561043#M1637</guid>
      <dc:creator>Joshua-Young</dc:creator>
      <dc:date>2024-11-20T22:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get Latitude and Longitude from geometry</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561477#M1638</link>
      <description>&lt;P&gt;That worked great. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 20:54:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/get-latitude-and-longitude-from-geometry/m-p/1561477#M1638</guid>
      <dc:creator>lakshmanankrishnan</dc:creator>
      <dc:date>2024-11-21T20:54:18Z</dc:date>
    </item>
  </channel>
</rss>

