Select to view content in your preferred language

Create Bezier Polygons (Spline Polygons) using Survey123 for Arboriculture Surveys

429
1
02-17-2024 01:42 AM
galiGIS
Emerging Contributor

Hi All,

I’m working on a Survey123 survey to capture the tree canopy based on the centroid (Lat, Long), Norh, South, East and West distances in meters. The idea is the mobile worker locates a point in the map and add the other fours readings manually (N,S, E, W) in meters and Survey123 would create a Bezier polygon (spline polygon) based on the readings.

After doing some research, I think this could be possible by using JavaScript functions in Survey123 connect app. Some examples can be found here: https://community.esri.com/t5/arcgis-survey123-blog/extending-survey123-smart-forms-with-custom-js/b...

The ConvexHull example (script attached for reference) could be a good starting point to modify the code but I’m after a Bezier polygon instead of ConvexHull,

Below an example of the ConvexHull javascript example by ESRI:

galiGIS_1-1708163195910.png

Below an example of spline curve (not closed) although my aim is having a close smooth polygon:

galiGIS_0-1708162888616.png

 

Any idea how to achieve this?

Thanks 😊

0 Kudos
1 Reply
IsmaelChivite
Esri Notable Contributor

Hi. Creating the bezier curve using JS will be quite a fun challenge! Check this out: https://javascript.info/bezier-curve 

Alternatively, you can also take advantage of a couple of features that may work for your use case:

In your geoshape question type try the different body::esri:style methods available:

  • vertex: draw a polygon one vertex at a time. Generates polygons with sharp corners
  • sketch: draw a polygon using a freehand tool. Corners will be smoother, although not quite Bezier curves

IsmaelChivite_0-1708276137774.png

You can also try the streaming method as described here: https://doc.arcgis.com/en/survey123/desktop/create-surveys/geotracegeoshape.htm  With streaming, mobile users can create a polygon or line while they walk.