Pulldata + JS Spatial Intersect data from DTM

08-03-2022 02:28 AM
New Contributor

I'm configuring a Survey123 and I wanted to use a javascript function (JS Spatial Intersect) to collect and store the height value, from an image service (DTM), created from the 10k cartography used in my organization (SMAS de Leiria) .
It is possible?
If possible how do I do it?

0 Kudos
1 Reply
New Contributor III

I wrote a function and added it to the default url_requests.js file.  There are a couple things to note.  S123 returns values in WGS84 Decimal Degrees.  If the Image service you are identifying uses a different SR then you'll need to project those coordinates.  There is a project function in the attached file as well.  Edit line 81 to add your own ArcGIS server's geometry service.  If you need to project then edit lines 21 and 22 to se your input and output spatial references.

Keep in mind this will only work for users authenticated into AGOL.  Esri doesn't support running javascript while not authenticated into AGOL for security reasons.

0 Kudos