Select to view content in your preferred language

X, Y coordinates in Geoshape are swapped when accessed in a custom JS script

138
0
04-30-2025 04:26 AM
TatianaTenEI
Emerging Contributor

Hello Esri Survey123 Community,

I hope someone can help with a potential bug that may have been raised previously, but I couldn't find any information about it.

We have a very simple Javascript script that takes a polygon (geoshape) and checks for overlaps with existing polygons in a hosted feature service. We can successfully run the script in Survey123 Connect, but when the Form is published the results for overlapping checks fail. After digging into the issue, it became evident that the geometry format is different with swapped Lon and Lat coordinates when compared between Survey123 Connect and Web App. 

Survey123 Connect which is working and as you can see the WGS84 coordinates are in Lon (X), Lat (Y) and with Spatial Reference property included:

 TatianaTenEI_0-1746012254772.jpeg

 On the other hand exactly the same script running in the Survey123 Web App returns a differently formatted JSON of the geometry where Lon and Lat are swapped and no Spatial Reference defined. 

 TatianaTenEI_1-1746012254772.jpeg

Has anyone encountered this before and what was the fix for this? Are there any properties I can set for Geoshape in the XLS form? 

I have the form and script attached in this post. Any help or comment appreciated.

Many thanks,

Tanya

 

 

0 Kudos
0 Replies