Select to view content in your preferred language

Select a value from a list and create a point in the centroid of the corresponding polygon

244
4
03-27-2025 08:19 AM
PanGIS
by
Frequent Contributor

Hello!

I have a scenario where surveys related to properties are compiled mostly in office and not on site.

 

The Survey is already set up to pull data from a layer when the point is placed on the polygon, but when the survey is submitted from office, the customer is lamenting that the point is not in the correct location.

Of course this could be solved by opening the map and place the point in the right location.

 

so, given the fact that I can pull info from a polygon, I was wondering if the opposite is possible: select a property from a list and create the geopoint of the survey in the centroid of that same property.

This has to be dynamic as property can change quite often.

 

Thanks!

Tags (2)
0 Kudos
4 Replies
AustinAverill
Frequent Contributor

Without DOM support to calculate the centroid through JS and no builtin functions for the XLS form to calculate a centroid, you would need the data to be already present with whichever feature layer you were accessing. 

 

If you set up a column for Lat/Long for centroid on the associated Polygon layer, you should be able to use pulldata to query those values and use them.

0 Kudos
DavidSolari
MVP Regular Contributor

The URL you feed into pulldata("@layer") can accept most URL parameters that work with the REST API's query endpoint. Try adding returnCentroid=true as a parameter so the polygon is transformed into a point. If that fails @AustinAverill's method should work well.

AustinAverill
Frequent Contributor

I have never know that returnCentroid was even a request parameter! Though, I predominantly deal with line and point data...

Learn something new every day.

 

0 Kudos
PanGIS
by
Frequent Contributor

Thanks to both of you!

while the first attempt was on @AustinAverill  suggestion, I then proceeded with @DavidSolari one.

but the result was the same for both, no error whatsoever, just blank fields.
I attached the David's sugg attempt.
if you have time and what to have a look to see what is wrong there.

Thanks again!

0 Kudos