The geoshape question type captures a closed polygon — a series of GPS coordinates where the first and last point are the same. In rtSurvey's web form, this renders as a text input where the enumerator enters or pastes the coordinate string directly.
Basic XLSForm Specification
| type | name | label |
|---|---|---|
| geoshape | field_area | Draw the boundary of the field |
| geoshape | zone | Record the zone boundary |
For the standard specification see the XLSForm documentation (opens in a new tab).
Data Format
Stored as a semicolon-separated list of points with no spaces around the semicolons. Each point is four space-separated values:
lat lon alt acc;lat lon alt acc;lat lon alt acc;lat lon alt acc| Component | Description |
|---|---|
lat | Latitude in decimal degrees |
lon | Longitude in decimal degrees |
alt | Altitude in metres (0 if unknown) |
acc | GPS accuracy in metres (0 if unknown) |
The polygon must be closed — the last point must equal the first point.
Example — a four-point polygon (triangle, closed):
13.756331 100.501762 0 0;13.758000 100.503000 0 0;13.757000 100.506000 0 0;13.756331 100.501762 0 0A minimum of three distinct points plus the closing repeat is required to form a valid polygon.
How it renders in rtSurvey
In the rtSurvey web form, geoshape renders as a plain text field. The enumerator types or pastes the coordinate string. There is no built-in interactive polygon map picker for this type in the current web form.
Collecting polygon points interactively
The recommended pattern for field collection is a repeat group of geopoint questions — each vertex uses the full GPS map picker — combined with a calculate to produce the geoshape string:
| type | name | label | calculation |
|---|---|---|---|
| begin repeat | polygon_points | Record each corner | |
| geopoint | point | Tap to record corner | |
| end repeat | polygon_points | ||
| calculate | geoshape_value | join(';', ${polygon_points/point}) |
After joining, append the first point manually to close the polygon, or use a second calculate to concatenate it.
Example usage
| type | name | label | hint | required |
|---|---|---|---|---|
| geoshape | farm_boundary | Record the field boundary | Enter all corners separated by semicolons. First and last point must be the same. | yes |
Best Practices
- Use a repeat group of
geopointquestions for interactive map-based collection and join the values — this gives enumerators a GPS picker for each vertex. - Always close the polygon (repeat the first point at the end) before submitting.
- Include the expected format in the
hintcolumn when manual coordinate entry is required. - Require at least 3 distinct corner points for a valid polygon — enforce this through instructions rather than XLSForm constraints.
- Use
geopointfor single-location questions andgeoshapeonly when area demarcation is the actual survey objective.
Limitations
- There is no built-in interactive polygon map picker for
geoshapein the rtSurvey web form. - The polygon must be manually closed — there is no automatic closing mechanism in the text input mode.
- Validating polygon topology (e.g., non-self-intersection, minimum area) requires post-processing outside of XLSForm constraints.
- Long boundaries with many vertices produce large text strings.