Arcade script to convert Geometry output from one wkid to another wkid id

232
0
02-23-2024 01:23 AM
Labels (2)
AndrewBlakie
New Contributor

Hello

My Arcade skills are limited, I can follow a basic script, however, writing one is often above my pay grade.  I even asked Chat GPT to help and it didn't work out.  Normally ChatGPT manages to figure it out

So, here goes.

This the basic code

AndrewBlakie_0-1708679211193.png

and it creates an output in Web Mercator.  I live in New Zealand and we/I use wkid 2193 -> NZTM2000.  What I want to do is convert the output from wkid 102100 to wkid 2193.

This is how it displays in the popup 

LAST KNOWN POSITION: {"x":19221380.628,"y":-5366791.241,"z":2.3000000000029104,"spatialReference":{"latestWkid":3857,"wkid":102100}} 

What we are converting is hourly pings from a Garmin Mini Inreach2 device which I am displaying on a map to show the bosses the last know locations for our workers.  To explain further why its done on a map is because the portal provider has two factor authoriation.  One of which is an admin email address which isn't monitored overnight and the weekends and the other is my cell phone and sometimes I go to sleep or go hunting where there is no cell phone coverage..  The end result is that the bosses can't access the portal to see the dots. 

I am sure that someone is clever than ChatGPT as its only clever as January 2022.

Thanks for your help

 

Andrew

0 Kudos
0 Replies