In this blog post I will describe how you can configure smart sketching in your surveys, step by step. Smart Sketching was introduced in version 2.4 of Survey123 and allows you to embedquestions in your form where users can draw or sketch. Depending on how you configure your survey, you can let users sketch on top of an empty canvas, on top of predefined diagrams, and even on top of photos.
There are multiple scenarios where sketching can be handy:
Sketches and annotated images and photos are automatically persisted by Survey123 as a geodatabase attachment, ensuring you can access them from other ArcGIS tools.
For the instructions below, some familiarity with XLSForms and Survey123 Connect for ArcGIS is assumed. A series of video-tutorials on XLSForms are available in ourYouTube Survey123 playlist.
In order to add sketching capabilities into your own survey, you need to use thedraworannotateappearances on survey questions of typeimage. It is easier than it sounds: In your XLSFile, using Survey123 Connect, simply add a question of typeimage, and then set the value of itsappearancecolumn to eitherdraworannotate.
In Survey123 Connect, create a New Survey using the Advanced template and add a question as follows:
type | name | label | appearance |
---|---|---|---|
image | accident_diagram | Vehicle Collision Diagram | draw |
Now use the survey preview in Survey123 Connect to exercise the sketching widget.
Thedrawappearance enables a full screen drawing pad where you can use pencils of multiple colors and thickness for your sketches. Thedrawappearance is ideal when you want end users to draw an idea on top of a white canvas. Note that you can:
Theannotateappearance is similar todraw, except that it allows the user to set the background of the canvas with a photo. Use theannotateappearance when you expect users to first take a photo of something, and then sketch on top of it. The same sketching tools available in thedrawappearance are also available forannotate.
Rather than starting with an empty canvas, you can configure your survey to present users with a custom background image in the sketching pad. Before you can reference your image, you must copy it into themediafolder of your survey directory. In Survey123 Connect for ArcGIS, while looking at the preview of your survey, click on the 'Open survey content folder' button.
Once the survey folder is open, look for the media directory and copy all your images in there. To play safe, copy images in either .pngor .jpgformat only. Be considerate with the size of the images: You want images big enough to look good in phones and tablets, but try to reduce their size as much as possible or otherwise the initial download of your survey into devices will take longer than usual.
Most tablets and phones will do pretty well with images smaller than 1920x1080 pixels.
Now that your images are in themediafolder. You can reference them in the survey:
type | name | label | default | appearance |
---|---|---|---|---|
image | animal_observations | Highlight where animal was hurt | coyote.png | draw |
Lets do this step by step:
concat(${ChoiceQuestion},'.png')
In the example above, I assume that your choice question is aselect_onetype of question named ChoiceQuestion. I also assume that your images are in.pngformat. Remember that all theconcat()function does is to concatenate the value of the selected choice in yourselect_onequestion, with the.pngextension.
You could certainly get more fancy with thecalculation, but the heart of how this is done is described above.
It is always easier to learn with an actual example. The Transmission Tower example is available under the Community category in Survey123 Connect:
As usual, we are eager to hear your feedback. This is a new feature and would love to hear your feedback so we can take next steps with it.
Enjoy!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.