I would like to get the Latitude and Longitude from my feature geometry in 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.
https://github.com/Esri/arcade-expressions/blob/master/form_calculation/GeometryAsAttribute.md
I was wondering if something like that would be a available for extracting lat lon from State Plane geometry.
-lak
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 https://community.esri.com/t5/coordinate-reference-systems-questions/formula-for-state-plane-to-lat-lon-conversion/m-p/870543
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.
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]; }
That worked great. Thanks.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.