# Geotrace string truncated and area calculation

**URL:** <https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350>\
**Category:** Support\
**Created:** [November 18, 2018, 12:47pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350 "2018-11-18T12:47:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suzanne](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@Suzanne](https://forum.getodk.org/u/Suzanne)\
**Post date:** [November 18, 2018, 12:47pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/1 "2018-11-18T12:47:07Z")

</div>

Dear ODK users,

I'm new to ODK and I'm now analysing data collected with Geotrace.

Data look like this (one cell):  
12.416629421784283 37.59671424251596 1993.8934136246776 6.0; 12.416479997387624 37.59675837626236 1993.6542834206723 4.0; 12.416379606381305 37.59675997386694 1993.3067534667914 4.0; 12.416353450984571 37.59687075454621 1992.9546061427736 4.0; 12.41635870

Truncated at 255 characters.

Is it somehow possible to get the full string (\>255) when the length has not been specified in the xlsform?  
Or will this mean that all collected data are incomplete because of this...?

Other question:  
Does someone by any chance have an R script to calculate the area from geotrace output?

Many thanks in advance,

Suzanne

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [November 18, 2018, 8:45pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/2 "2018-11-18T20:45:37Z")

</div>

BTW, there is a fairly recent [posting](https://forum.getodk.org/t/increasing-string-length-beyond-255-for-long-geotraces/14937) about geotrace truncation.

> [@Suzanne](#):
>
> Is it somehow possible to get the full string (\>255) when the length has not been specified in the xlsform?

If the odk:length wasn't specified in the original form, then there is a good chance that the original data has been (silently) truncated when it was submitted and saved in Aggregate. ☹ If you have physical access to the actual Android device you _might_ be able to recover the original submission XML (which may have the full string)...

> [@Suzanne](#):
>
> Does someone by any chance have an R script to calculate the area from geotrace output?

Aside, you can also calculate the area of a geotrace from within your form, using a calculation with the [area()](https://docs.opendatakit.org/form-operators-functions/#area) function.

---

<div class="post-metadata">

**Author:** ![Suzanne](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@Suzanne](https://forum.getodk.org/u/Suzanne)\
**Post date:** [November 19, 2018, 3:17pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/3 "2018-11-19T15:17:43Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![danbjoseph](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/danbjoseph/32/21901_2.png) [@danbjoseph](https://forum.getodk.org/u/danbjoseph)\
**Post date:** [November 19, 2018, 4:39pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/4 "2018-11-19T16:39:29Z")

</div>

Hi @Suzanne, can we improve the documentation in some way? There is a warning at the bottom of the [geotrace widget section](https://docs.opendatakit.org/form-question-types/#geotrace-widget) that links to the documentation on [aggregate field length](https://docs.opendatakit.org/aggregate-field-length/), but perhaps the warning should be at the top? Or is geotrace mentioned somewhere else without the warning? I just want to know if there is a way that we can better help people avoid the problem you encountered. Thanks!

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [November 19, 2018, 8:26pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/5 "2018-11-19T20:26:57Z")

</div>

It may make sense to have something appear in form builders (eg [Build](https://build.opendatakit.org/), [KoboToolbox](https://www.kobotoolbox.org/), etc) **explicitly** warning the user, while they are actually creating the form, that geotrace/geoshape widgets will truncate their result unless odk:length is set! Having it clearly spelled out in the ODK online documentation is all well and good, but how many people actually read the documentation before, say, firing up KoboToolbox for the first time? [I certainly didnt! 😆]

Or better yet, in addition, have these form builders actually add this flag _by default_ for these data types. A typical geopoint can take on the order of 25 characters, which means you are only going to be able to capture approx 10 points for a trace, or 9 for a shape (due to having to repeat the first geopoint). So I think there is a good argument that these two data types will normally require a longer string (eg 1250, or 50 points) to store them in typical usecases. @issa - do you think this would be reasonable to do for Build?

---

<div class="post-metadata">

**Author:** ![issa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/i/87869e/32.png) [@issa](https://forum.getodk.org/u/issa)\
**Post date:** [November 19, 2018, 9:14pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/6 "2018-11-19T21:14:16Z")

</div>

is there some sane value i can just always set it to? i feel like this should just work out of the box.

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [November 19, 2018, 9:20pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/7 "2018-11-19T21:20:45Z")

</div>

Dunno... I could see - for geotrace - that somebody could just turn it on and having it periodically capture their location to build up a track while they are walking/driving, possibly for an hour+. Maybe enough for 1000 points would cover 99% of usecases?

---

<div class="post-metadata">

**Author:** ![issa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/i/87869e/32.png) [@issa](https://forum.getodk.org/u/issa)\
**Post date:** [November 19, 2018, 9:25pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/8 "2018-11-19T21:25:31Z")

</div>

ugh, i can’t like set it to `-1` or something and just have it always work?

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [November 26, 2018, 11:53pm UTC](https://forum.getodk.org/t/geotrace-string-truncated-and-area-calculation/16350/9 "2018-11-26T23:53:54Z")

</div>

Split this topic on November 26, 2018, 11:53pm UTC

14 posts were split to a new topic: [Specifying aggregate config options via XForm definition](https://forum.getodk.org/t/specifying-aggregate-config-options-via-xform-definition/16491)
