Multiexcerpt include macro | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
This page will walk you through the steps of integrating Dimagi's area mapping application with your CommCare ODK app.
Configuration
- Download and install the area mapping application on your device
- Navigate to the form builder for your app on CommCare HQ
- Navigate to where you want to insert the question
- Add an "Android App Callout" question type under the "Advanced" tab
- Create an ID and label as you would a normal question
- Under "Intent ID" write: org.commcare.mapping.AreaCalculator
- Under "Logic" you can enforce the same things as you would a normal question, IE enforce this must be a realistic value, non-null, etc
- That's it! To read more about what's going on under the hood see this page.
...
On your Android device, download the Area Calculator application from the Google Play Store
In the Form Builder, add a Android App Callout type question
Then, under the "Templates" dropdown of this question, select the "Area Calculator" question type
Saving Images
In order to capture an image of the map and the polygon around the surveyed area, follow the steps below.
Add an extra to the Area Calculator question with key: image and value: 'true'
Add an image capture question to the form
Add a key/value pair to the Response section of the Area Calculator question, with key: image and value: drag and drop the image capture question
The image of the map and polygon will now be saved to the image capture question when the form is submitted.
...
Saving Coordinates
In order to capture the coordinates of the polygon, follow the steps below.
Add an extra to the Area Calculator question with key: coordinates and value: 'true'
Add a hidden value to the form to save the coordinates in
Add a key/value pair to the Response section of the Area Calculator question, with key: coordinates and value: drag and drop the hidden value created in step 2 above
The coordinates of the polygon will now be saved to the hidden value as a string of lat/lng doubles when the form is submitted.
Info |
---|
Note: The Area Mapper tool in CommCare is designed to measure the surface area of a region by creating a polygon around the surveyed area. However, it's important to note that this tool measures the 'planar' or 'flat' area enclosed by the polygon, not the actual surface area of a sloped or uneven terrain. The tool is most accurate when used on level ground. |