Select to view content in your preferred language

Arcade projectAs Geometry Function

6659
28
05-06-2022 12:23 AM
Status: Under Consideration
Labels (1)
JacobFougstrupNicolajsen
New Contributor II

Working primarily with data in UTM projection, I often need ways to convert UTM coordinates to WGS to create deep links to various online services. 

Having to create duplicate datasets, or running python scripts as regular intervals is tedious and time consuming.

And arcade equivalent of the python projectAs method would solve almost all these issues.

 

28 Comments
ZachEdwards_WDSGIS

It would be nice to go the other way too! Convert from Lat/Long to UTM meters or state plane feet/USfeet. It's not always easy to produce a web map that's in a projected coordinate system when using AGOL. You have to create a basemap that is in the projected coordinate system (UTM zone 12N, Nad83 2011, meters). Without enterprise/portal, I haven't figured out an easy way to do this without finding a public layer in the CRS that you want that can be used as a basemap.

ZachEdwards_WDSGIS

I agree with @JasonClemis here. I need the inverse. I have been working on this because many folks are beholden to web Mercator WGS1984 and would like to project (live in Field Maps) via Arcade to a specific state plane coordinate system in US or INTL Feet. It would likely be the inverse of the following section: // Latitude iterations in radians.  Then again, my state has transverse Mercator so there aren't two parallels which affects the SP1 and SP2 portion. 

Also, @DavidColey to get Longitude, add the following after the latitude iterations in radians...

// Longitude iteration in radians
var lonTR = degToRad((Atan2((x - false_easting), (rf - (y - false_northing))) / n) + lorR)
 
Finally, replace lines 50-52 with the following:
 
// Latitude and longitude values in degrees
var latitude = radToDeg(latFR)
var longitude = radToDeg(lonTR)
return [latitude,longitude]
 
 

 

 

DavidColey

Thanks for this @ZachEdwards_WDSGIS  - I'm out this week but will look to get this implemented into next week or so and will report back on this thread with what hopefully will be a TM based SP coord sys translation

Bud
by

As a workaround, would you be able to do the projection in a database view?

DaveBarrett1034

I would find this incredible useful and I would anticpate that it works in a similar manner to the coordinate conversion widget in Experience Builder. I would like to be able to get the geometry object back in lat and long but with additional options to specify the format returned e.g "MGRS", "UTM", "GARS", "DDM".

This could also be a standalone function that formats a coordinate to the output e.g. pass in a lat and lon and specify the format keyword. 

Thanks,

Dave

WillAnderson

An emphatic Yes vote here.

LanceKirby2

Yes vote here 

ZachEdwards_WDSGIS

This would be huge and is a long time coming! Can we look into this @JeffShaner ? 🙂