Smart Sketching in Survey123: Stroke by stroke.

19503
69
10-09-2017 02:43 PM
IsmaelChivite
Esri Notable Contributor
8 69 19.5K

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:

  • When performing inspections, a user can take a photo of an asset and sketch on it to highlight issues. Alternatively, the inspector could annotate over a diagram representing the asset.
  • When submitting a traffic accident report, a police officer can use the sketch capabilities in Survey123 to illustrate the positions of the vehicles involved and skid marks.
  • Free-form sketches in Survey123 allow conservationists to highlight certain features/marks of a whale which can be used later to track the individual specimen across different observation reports.

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.

The Basics: Draw and Annotate appearances

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:

  • Add an arrow by drawing a straight line.
  • Add text by tapping on the screen.
  • Add shapes of any form through free-drawing. Circles and rectangles will be automatically smoothed for you.

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.

Advanced Techniques: Using Defaults and Calculations

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:

  • Default: If you always want to display the same background image in the sketching pad, reference your image using thedefault列。你不需要附上the name of your file in quotes, but you will want to make sure you include both the name and file extension. In the next example, the imagecoyote.pngwill always be used as background for thedrawwidget.

type name label default appearance
image animal_observations Highlight where animal was hurt coyote.png draw

  • Calculation: If you want to dynamically switch the background image based on previous responses in your survey, use thecalculation列。A typical scenario for this is that where you present users with a choice question and then you switch the background according to user selection. Say for example, you first let user select the type of tower inspection being inspected. The drawing canvas background will change depending on the type.

Lets do this step by step:

  1. Ensure you have all your images in themediafolder. For simplicity, make sure the extension for all the images is the same. That is, make sure they are either all .pngor.jpg.
  2. Create a list in thechoicesworksheet where the value of thenamecolumn for choices in your list matches the name of filenames in themediafolder.
  3. Set the expression in the calculation column of yourdraworannotatequestion as:

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:

  • Log into Survey123 Connect
  • Click on New Survey
  • Select the Community category and then choose the Transmission Tower sample

A few extra tips and things you should know

  • All sketches will be saved as geodatabase attachments once submitted to ArcGIS. This means that you can always easily access sketches associated with a submitted feature.
  • If you use thedefaultorcalculation列预定义的背景画canvas, keep in mind that iOS (iPhones and iPads). You must reference images making sure that the capitalization in your XLSForm is exactly as in the filenames.
  • Once the user creates the sketch, a preview of the sketch will be made available in the survey. Note that at that point the user can change the name of the image. Calculating the name of the image filename is not possible at this time.
  • Support for defaults and calculations on draw and annotate images is missing in the WebForm. Only the Survey123 field app will honor your defaults and calculations.
  • [Fixed as of 2.6]As of version 2.4, it is not possible to let users choose a background for the drawing canvas using an existing image from the photo gallery. This is something that we want to add in the future. As of 2.4, you can only use images from the media folder or let users take a photo on the spot and use it as background.
  • If you are using the Inbox to edit existing features, be aware that as of 2.4 the Inbox does not support images of any type (signatures, photos, drawings or annotated images).
  • If you bring a photo from your gallery or camera into the Draw and Annotate widgets, the EXIF data in your image will be stripped out and lost once submitted to ArcGIS.

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!

69 Comments
KristopherKerr
New Contributor

I'm using Survey123's Smart Sketch function in my survey to create field sketches on an inspection form. Currently I'm having the user select a particular condition in a select_one and use that in the calculation field of my image as a way to select a custom canvas. This suites my need perfectly, but I'm finding the actual drawing tools to be somewhat limited.

Is there any way to set custom symbols in the Smart Sketch drawing tools? I'd like to be able mirror the legend in the example.

Best,

Kristopher

JamesTedrick
Esri Esteemed Contributor

Hi Kristopher,

It is not possible to set a custom set of symbology for the annotating the image.

by Anonymous User
Not applicable

Hi Joy,

Just letting you know a fix has been applied for the "blurry" image issue when using the annotate appearance for image questions. The fix is available for testing and feedback via theEarly Adopter Community, where we have just shared the latest 3.7 RC1 builds. If you have time, please test the fix out and let us know if any further issues. We are hoping to release this fix in the final 3.7 release.

Regards,

Phil.

by Anonymous User
Not applicable

Hi Yvette,

Just letting you know a fix has been applied for the"blurry" image issue when using the annotate appearance for image questions. The fix is available for testing and feedback via theEarly Adopter Community, where we have just shared the latest 3.7 RC1 builds. If you have time, please testthe fix outand let us know if any further issues. We are hoping to release this fix in the final 3.7 release.

Regards,

Phil.

HaileyWright1
New Contributor III

Hello Phil,

Can you help me understand how to do this on a mobile device? I have an image question where a photo is to be taken of a soil pit. Later in the survey, after the soil is disturbed, I would like to use another image question to pull up the original image and mark it up with soil horizon names using the annotate appearance. The result I'm looking for is two attachments of the same photo, only one of the two would be marked up with annotations. I can replicate this in Survey123 Connect by navigating to C:\Users\ArcGIS\My Survey Attachments to pull up the original photo from the second image question, but I can't seem to locate the original photo from the field app on my iphone 7. Even better? If I could make the original photo the default background image to annotate in my second image question.

Thanks,

Hailey

JordanMiller4
Occasional Contributor III

How do you view sketches from the inbox? If you create a form and design a sketch design can this be access in survey123 connect only once?

JamesTedrick
Esri Esteemed Contributor

Hi Jordan,

Viewing existing images (included annotated images) is not yet supported when opening via the Inbox.

DougBrowning
MVP Honored Contributor

Any way to get more colors when drawing?

DougBrowning_0-1614030634452.png

我们通常用红色、蓝色、黄色和橙色。那means we must pick one of them to be orange, then we have no yellow. Black does not work on dark photos, white does not work in the desert, green is bad for when we have vegetation.

For now thinking we can use the iOS one then attach. But wanted to ask.

Thanks

Jim-Moore
金宝搏吧

Hi@DougBrowningif you press and hold any of the six colour swatches, you'll get the default colour picker dialog for your device, which will allow you to choose a custom colour.

Also for 3.12 we've added a 'highlighter' mode (still in beta) where you can press and hold the line thickness selectors to switch to highlighter mode, which makes the pen strokes transparent. Press and hold again to reset to opaque.

Cheers,

Jim

TimothyMcKinney
New Contributor III

@JamesTedrick@Anonymous User@IsmaelChivite@Jim-Moore

I currently have an image that has an appearance as annotate and it works for markup but when appearance is set to annotate I notice I am unable to usepulldata("@exif", ${image}, "GpsLatitude") ETC to get any of the EXIF data. I am trying to store EXIF lat, long, & direction on an image that is set to annotate and can be marked-up.Any solution for this? Maybe the original image can be stored and then an additional image can be used with appearance set to draw and the default canvas set to the 1st image?

Any help would be appreciated.

by Anonymous User
Not applicable

Hi@TimothyMcKinney,

This is currently expected. When annotating an image, when the final canvas/image is saved, it creates a new image file. This new image file does not retain the EXIF data from the original image added to the canvas. This is because the canvas, the image, map, markups etc could be added/created at a different locations and date/times compared to when the original image was captured. In some cases it makes sense to keep the EXIF data, and in other cases it does not.

我们意识到了这个问题,可以考虑马金g enhancements in the future to address this EXIF data being restored from original image. Currently the best workaround would be as you suggest, so have two image questions, one without annotate appearance and one without. You can then use pulldata to get the EXIF data from the plain image question, and annotate the other.

Regards,

Phil.

TimothyMcKinney
New Contributor III

@Anonymous User

By chance is there a way to use pulldata or something similar to answer the second question with a copy of the first image? Ideally I want both images to be exactly the same just one original with EXIF and no markups and a second with markups.

Thanks for the help!

by Anonymous User
Not applicable

Hi@TimothyMcKinney,

No, there is currently no way to use pulldata or another other expression to add the iamge twice to the survey or copy/duplicate it to other image questions. You will need to select the image twice and add it to each image question.

Phil.

GISPro1
by
New Contributor III

@Anonymous User- I am having a few problems with sketching on a map in a Survey123 Connect.

  1. When zoomed in and creating a shape that goes off the screen, the feature self-cancels. Is there a way to auto-scroll to complete the feature?
  2. Drawing a sketch occasionally "glitches" and freezes

We are using 3rd Gen iPad Pro with an Apple Pencil and Survey123 Connect version 3.13.234

by Anonymous User
Not applicable

Hi@GISPro1,

Are you using the annotate or draw appearance?

Do you have a background image loaded, and if so how large is the image?

What tool are you using when drawing and go off the screen? Can you provide a screenshot or video recording of the behaviour?

We have an update to 3.13 coming out soon which includes some improvements to annotation sketching, resolves a few glitches and crashes. Can you take a look at theEarly Adopter Communityand latest 3.14 beta builds or 3.13 RC builds, and see if you still see those issues withoccasionally "glitches" and freezes.

Regards,

Phil.

CPoynter
Occasional Contributor III

@Anonymous User,

Is is possible to capture an image as a reference (camera function) and have it auto-populate another question for annotation by default (without having to browse from catalog/albums/folders)?

Regards,

Craig

by Anonymous User
Not applicable

Hi@CPoynter,

No, this is not currently possible. The default image needs to be included in the media folder and referenced in the XLSForm by filename.

Regards,

Phil.

CPoynter
Occasional Contributor III

Hi @Anonymous User,

Thank you for the quick response. I was planning to take a photo and later use it for annotation. I will direct users to browse their images to re-use the initial image.

If the initial image is loaded for annotation, will the EXIF information still be stripped from the file?

Regards,

Craig

by Anonymous User
Not applicable

Hi@CPoynter,

Yes, with the latest 3.13 release, EXIF information is now retained when selecting an image from the gallery or camera role when using image annotation question. Previously existing EXIF information was lost, however this has been resolved in latest update.

Regards,

Phil.