Select to view content in your preferred language

Buffer tool for Survey123 Map

1807
6
11-03-2017 03:46 AM
MicheleDe_Santis
Emerging Contributor

Hi to all,

is it possible to add a buffer tool on a Suvey123 Map? I would like to draw a buffer (radius 100m) on my position when the user click on a button. The buffer should be stay fixed on map and erased when the user click on another button. How Can I implement this function?

Thanks to all

0 Kudos
6 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Michelle

Currently we don't support this functionality. I could get this added as an enhancement request - but in order to do so, could you provide more details of your workflow and what you are trying to acheive.

Thanks

John

0 Kudos
MicheleDe_Santis
Emerging Contributor

Hi John,


in our application surveyors go into field to sample trees and plants. They wants create a buffer on the map because they wants move inside it. The law imposes samples along 100m from sick plant. Inside our organization does we can modify the source code for this need?

Thanks

Michele

0 Kudos
DanielDery
Occasional Contributor

I developed some Javascript functions to create a buffer around a point/current position. This script uses the UTM coordinates from the point, calculates the UTM coordinates of 360 points around it, converts them all to Lat/Lon and creates a text string to be used in the geoshape Calculate column. You will need to save the .txt file as .js because javascript attachments are surprisingly not supported here.

Please note that this script is not perfect and can be improved. It can also be used in a Repeat to create multiple buffers around the center point. 

DanielDery_0-1708980590702.png

Daniel Dery

Tags (3)
MonmouthNJGIS
Occasional Contributor

Good Morning Daniel! We love this approach and gave it a try in one of our org's surveys, but we can't get the desired results. We tried on a blank survey as well using the files provided and could not replicate that either. If you're able to take a look at our survey file, do you see any glaring issues? 

Thanks in advance for any advice! 

0 Kudos
rrhee_bcfpd
Emerging Contributor

Not sure if you're still looking for a solution, but I got it working on Survey123Connect 3.18 with a few tweaks.

  1. Change "round((...), 7)" to (...).toFixed(7) in lines 114 and 115
  2. If you want to run it on a web-based form, replace "center_X" with "parseFloat(center_X)" in line 112 and 113
  3. * I currently have the question that runs the javascript script to have a field length of 10000 on a null field, but it doesn't look like Daniel did the same. Not 100% sure if it's required, but might be worth a try
  4. * I also added a second question that takes the text from the question running the javascript and uses substr(${...}, 0, string-length(${...} - 2)) to trim off the trailing "; " that gets appended to the last coordinate pair, but again, it doesn't look like Daniel did the same. 

I attached my modification of the script below, but I did shrink the script down to a single function so it will look different, but it's doing the same thing. No guarantee it will work, but I also ran into a few issues, but this solution is possible with a little tweaking and experimentation with the script.

0 Kudos
MichelleWilliamsERM
Frequent Contributor

WOW, and thank you @DanielDery that looks sexy.

 

0 Kudos