# XLSForm spec proposal: auto-location type for background location capture with setlocation action

**URL:** <https://forum.getodk.org/t/xlsform-spec-proposal-auto-location-type-for-background-location-capture-with-setlocation-action/20831>\
**Category:** Development\
**Created:** [July 9, 2019, 10:52pm UTC](https://forum.getodk.org/t/xlsform-spec-proposal-auto-location-type-for-background-location-capture-with-setlocation-action/20831 "2019-07-09T22:52:30Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [July 11, 2019, 5:04am UTC](https://forum.getodk.org/t/xlsform-spec-proposal-auto-location-type-for-background-location-capture-with-setlocation-action/20831/4 "2019-07-11T05:04:10Z")

</div>

I think I muddied the waters when I described this to the TSC.

This proposal is very narrow and rightfully so. It is only to enable the collection of a single geopoint in the background on form load and it's really about the XLSForm syntax. Other background location gathering (e.g., on value change, in repeats) will require different syntax (probably an on\_change column).

In the generated XForms, this seems reasonable to me.

```xml
<bind nodeset="/data/my-location" type="geopoint" />
<odk:setgeopoint ref="/data/my-location" event="odk-instance-first-load" />

```

`odk:setgeopoint` is a proposed change to the current spec that we can discuss more at [Spec addition proposal: location preload](https://forum.getodk.org/t/spec-addition-proposal-location-preload/10768). My argument for that change is that current geopoint format is bad and we should change it to some standard format and it seems reasonable to maybe save `odk:setlocation` for that.

In XLSForms, this seems reasonable to me:

- type: `start-geopoint, end-geopoint`

It's reasonable because we are adding a geopoint at first load, which is analogous to adding a timestamp at first load. We called that `start` and calling this `start-geopoint` seems reasonable (maybe we can add a `start-datetime` alias).

- I don't like `auto` because it's not a differentiator. We'll never have a `manual-start-location` because we already have `geopoint`.
- I don't like `location` it could be confusing. If you have `start-location` and `end-location`, someone might expect that those are action that start a background trace. Also, we might want to save the `location` word for a different format. I don't feel super strongly about that though.

---

_[View the full topic](https://forum.getodk.org/t/xlsform-spec-proposal-auto-location-type-for-background-location-capture-with-setlocation-action/20831)._
