What can you do with a gps field?

Hi, to answer the request at the bottom of this email on the formhub-users
list, I have been trying to see if regex relevants work on gps fields.
Turns out they don't. Neither do either of lines beyond the first below

type name label relevant
calculation

geopoint gps_field GPS
note blank_note Its blank! ${gps_field}=''
note blank_note_re Its bank (re)! regex(${gps_field},
'^$')
calculate gps_string
string(${gps})

Actually, if I just skip the gps question, then nothing breaks (and the
relevant in the two notes works as expected). But when any of the latter
nodes are present in a form, as soon as I hit "record location", things
break.
The first two being unsupported seems okay... but shouldn't the calculate
at least work?

And finally, is there anything you can you do with a gps field to satisfy a
request similar to Thomas's below?

cheers,
--p

I would like to back up my location recording (question type geopoint)
with an open text description of the location (question type text), IF the
accuracy of the GPS recording is below a certain threshold (e.g. >50).

It seems that in xlsforms I do not specify the geo variables further (i.e.

long, lat, altitude, accuracy), instead these get all stored in my geopoint
variable separated by spaces.

How would the skipping logic (the statement in the relevant column) have to

look like, to only display the question if the accuracy of the geopoint
question was less than +-50m?

Alternatively, if that is not possible, how would it look like if capturing

the geo-coordinates was not successful (i.e = null, or similar)?

Thanks for helping out!

··· From: Thomas Gotschi To: formhub-users@googlegroups.com

(original here:
https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion)

This is a javarosa issue -- geopoint is not convertable to a string, so you
can't do much with it:

··· On Wed, May 30, 2012 at 11:37 AM, Prabhas Pokharel < prabhas.pokharel@gmail.com> wrote:

Hi, to answer the request at the bottom of this email on the formhub-users
list, I have been trying to see if regex relevants work on gps fields.
Turns out they don't. Neither do either of lines beyond the first below

type name label relevant
calculation

geopoint gps_field GPS
note blank_note Its blank! ${gps_field}=''
note blank_note_re Its bank (re)! regex(${gps_field},
'^$')
calculate gps_string
string(${gps})

Actually, if I just skip the gps question, then nothing breaks (and the
relevant in the two notes works as expected). But when any of the latter
nodes are present in a form, as soon as I hit "record location", things
break.
The first two being unsupported seems okay... but shouldn't the calculate
at least work?

And finally, is there anything you can you do with a gps field to satisfy
a request similar to Thomas's below?

cheers,
--p

From: Thomas Gotschi To: formhub-users@googlegroups.com

I would like to back up my location recording (question type geopoint)
with an open text description of the location (question type text), IF the
accuracy of the GPS recording is below a certain threshold (e.g. >50).

It seems that in xlsforms I do not specify the geo variables further (i.e.

long, lat, altitude, accuracy), instead these get all stored in my geopoint
variable separated by spaces.

How would the skipping logic (the statement in the relevant column) have

to look like, to only display the question if the accuracy of the geopoint
question was less than +-50m?

Alternatively, if that is not possible, how would it look like if

capturing the geo-coordinates was not successful (i.e = null, or similar)?

Thanks for helping out!

(original here:
https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion)

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Hello Group,
I was searching for syntax to include GPS in a relevance statement, and
this old thread from 2012 is the closest I got.

My goal is to display 2 screens to manually enter Latitude and Longitude,
but only if the GPS is null
I'm getting the same results reported here - works fine if I swipe past,
but crashes as soon as the phone gets a GPS lock.

Any change?
In the past, I've asked the user to select1 a method to input location, but
I could save 1 swipe with a relevance statement like this in the Latitude
binding: relevant="(/data/GPS = ' ')

··· On Wednesday, May 30, 2012 at 2:37:01 PM UTC-4, Prabhas Pokharel wrote: > > Hi, to answer the request at the bottom of this email on the formhub-users > list, I have been trying to see if regex relevants work on gps fields. > Turns out they don't. Neither do either of lines beyond the first below > > *type name label relevant > calculation* > geopoint gps_field GPS > note blank_note Its blank! ${gps_field}='' > note blank_note_re Its bank (re)! regex(${gps_field}, > '^$') > calculate gps_string > string(${gps}) > > Actually, if I just skip the gps question, then nothing breaks (and the > relevant in the two notes works as expected). But when any of the latter > nodes are present in a form, as soon as I hit "record location", things > break. > The first two being unsupported seems okay... but shouldn't the calculate > at least work? > > And finally, is there anything you can you do with a gps field to satisfy > a request similar to Thomas's below? > > cheers, > --p > > From: Thomas Gotschi To: formhu...@googlegroups.com > > > >> I would like to back up my location recording (question type geopoint) >> with an open text description of the location (question type text), IF the >> accuracy of the GPS recording is below a certain threshold (e.g. >50). > > It seems that in xlsforms I do not specify the geo variables further (i.e. >> long, lat, altitude, accuracy), instead these get all stored in my geopoint >> variable separated by spaces. > > How would the skipping logic (the statement in the relevant column) have >> to look like, to only display the question if the accuracy of the geopoint >> question was less than +-50m? > > Alternatively, if that is not possible, how would it look like if >> capturing the geo-coordinates was not successful (i.e = null, or similar)? >> > > Thanks for helping out! > > > >> (original here: >> https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion) > >

I don't remember what the state of this is.

Javarosa is the XForms processing engine we use to interpret and evaluate
the XML file produced by ODK Build and XLSForm. In an attempt to fix this,
I updated javarosa back in 2013 or 2014 with the intention of:

number(${geopoint}) ===> accuracy
boolean(${geopoint}) ===> true if the geopoint has been captured
string(${geopoint}) ====> "lat long alt acc" string (in which case you
could use selected-at() to pick out the field you want, as a string, and
then convert it to a number).

BUT, if memory serves, this uncovered a deeper flaw in datatype treatments
within the javarosa code that prevented most of these from working
correctly. I just don't remember which ended up working and which did not.

Please test these out and update this thread with what happens.

··· On Mon, May 9, 2016 at 9:09 AM, Ruth Little wrote:

Hello Group,
I was searching for syntax to include GPS in a relevance statement, and
this old thread from 2012 is the closest I got.

My goal is to display 2 screens to manually enter Latitude and Longitude,
but only if the GPS is null
I'm getting the same results reported here - works fine if I swipe past,
but crashes as soon as the phone gets a GPS lock.

Any change?
In the past, I've asked the user to select1 a method to input location,
but I could save 1 swipe with a relevance statement like this in the
Latitude binding: relevant="(/data/GPS = ' ')

On Wednesday, May 30, 2012 at 2:37:01 PM UTC-4, Prabhas Pokharel wrote:

Hi, to answer the request at the bottom of this email on the
formhub-users list, I have been trying to see if regex relevants work on
gps fields.
Turns out they don't. Neither do either of lines beyond the first below

type name label relevant
calculation

geopoint gps_field GPS
note blank_note Its blank! ${gps_field}=''
note blank_note_re Its bank (re)!
regex(${gps_field}, '^$')
calculate gps_string
string(${gps})

Actually, if I just skip the gps question, then nothing breaks (and the
relevant in the two notes works as expected). But when any of the latter
nodes are present in a form, as soon as I hit "record location", things
break.
The first two being unsupported seems okay... but shouldn't the calculate
at least work?

And finally, is there anything you can you do with a gps field to satisfy
a request similar to Thomas's below?

cheers,
--p

From: Thomas Gotschi To: formhu...@googlegroups.com

I would like to back up my location recording (question type geopoint)
with an open text description of the location (question type text), IF the
accuracy of the GPS recording is below a certain threshold (e.g. >50).

It seems that in xlsforms I do not specify the geo variables further

(i.e. long, lat, altitude, accuracy), instead these get all stored in my
geopoint variable separated by spaces.

How would the skipping logic (the statement in the relevant column) have

to look like, to only display the question if the accuracy of the geopoint
question was less than +-50m?

Alternatively, if that is not possible, how would it look like if

capturing the geo-coordinates was not successful (i.e = null, or similar)?

Thanks for helping out!

(original here:
https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion)

--
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

And if you can provide a stack trace of the crash, that would be very
helpful in fixing it.

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Mon, May 9, 2016 at 7:11 PM, Mitch Sundt mitchellsundt@gmail.com wrote:

I don't remember what the state of this is.

Javarosa is the XForms processing engine we use to interpret and evaluate
the XML file produced by ODK Build and XLSForm. In an attempt to fix this, I
updated javarosa back in 2013 or 2014 with the intention of:

number(${geopoint}) ===> accuracy
boolean(${geopoint}) ===> true if the geopoint has been captured
string(${geopoint}) ====> "lat long alt acc" string (in which case you
could use selected-at() to pick out the field you want, as a string, and
then convert it to a number).

BUT, if memory serves, this uncovered a deeper flaw in datatype treatments
within the javarosa code that prevented most of these from working
correctly. I just don't remember which ended up working and which did not.

Please test these out and update this thread with what happens.

On Mon, May 9, 2016 at 9:09 AM, Ruth Little ruthl@kestrel-tech.com wrote:

Hello Group,
I was searching for syntax to include GPS in a relevance statement, and
this old thread from 2012 is the closest I got.

My goal is to display 2 screens to manually enter Latitude and Longitude,
but only if the GPS is null
I'm getting the same results reported here - works fine if I swipe past,
but crashes as soon as the phone gets a GPS lock.

Any change?
In the past, I've asked the user to select1 a method to input location,
but I could save 1 swipe with a relevance statement like this in the
Latitude binding: relevant="(/data/GPS = ' ')

On Wednesday, May 30, 2012 at 2:37:01 PM UTC-4, Prabhas Pokharel wrote:

Hi, to answer the request at the bottom of this email on the
formhub-users list, I have been trying to see if regex relevants work on gps
fields.
Turns out they don't. Neither do either of lines beyond the first below

type name label relevant
calculation
geopoint gps_field GPS
note blank_note Its blank! ${gps_field}=''
note blank_note_re Its bank (re)!
regex(${gps_field}, '^$')
calculate gps_string
string(${gps})

Actually, if I just skip the gps question, then nothing breaks (and the
relevant in the two notes works as expected). But when any of the latter
nodes are present in a form, as soon as I hit "record location", things
break.
The first two being unsupported seems okay... but shouldn't the calculate
at least work?

And finally, is there anything you can you do with a gps field to satisfy
a request similar to Thomas's below?

cheers,
--p

From: Thomas Gotschi To: formhu...@googlegroups.com

I would like to back up my location recording (question type geopoint)
with an open text description of the location (question type text), IF the
accuracy of the GPS recording is below a certain threshold (e.g. >50).

It seems that in xlsforms I do not specify the geo variables further
(i.e. long, lat, altitude, accuracy), instead these get all stored in my
geopoint variable separated by spaces.

How would the skipping logic (the statement in the relevant column) have
to look like, to only display the question if the accuracy of the geopoint
question was less than +-50m?

Alternatively, if that is not possible, how would it look like if
capturing the geo-coordinates was not successful (i.e = null, or similar)?

Thanks for helping out!

(original here:
https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion)

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

These calculations seem to work in a constraint column for geopoints. However, when I try to use the same formula in a calculation or relevant column, I get NaN. I'm using KoboToolbox.

Any thoughts on that?

Thank

··· On Friday, May 13, 2016 at 1:13:16 AM UTC-4, Yaw Anokwa wrote: > And if you can provide a stack trace of the crash, that would be very > helpful in fixing it. > > Yaw > -- > Need ODK consultants? Nafundi provides form design, server setup, > in-field training, and software development for ODK. Go to > https://nafundi.com to get started. > > On Mon, May 9, 2016 at 7:11 PM, Mitch Sundt wrote: > > I don't remember what the state of this is. > > > > Javarosa is the XForms processing engine we use to interpret and evaluate > > the XML file produced by ODK Build and XLSForm. In an attempt to fix this, I > > updated javarosa back in 2013 or 2014 with the intention of: > > > > number(${geopoint}) ===> accuracy > > boolean(${geopoint}) ===> true if the geopoint has been captured > > string(${geopoint}) ====> "lat long alt acc" string (in which case you > > could use selected-at() to pick out the field you want, as a string, and > > then convert it to a number). > > > > BUT, if memory serves, this uncovered a deeper flaw in datatype treatments > > within the javarosa code that prevented most of these from working > > correctly. I just don't remember which ended up working and which did not. > > > > Please test these out and update this thread with what happens. > > > > > > On Mon, May 9, 2016 at 9:09 AM, Ruth Little wrote: > >> > >> Hello Group, > >> I was searching for syntax to include GPS in a relevance statement, and > >> this old thread from 2012 is the closest I got. > >> > >> My goal is to display 2 screens to manually enter Latitude and Longitude, > >> but only if the GPS is null > >> I'm getting the same results reported here - works fine if I swipe past, > >> but crashes as soon as the phone gets a GPS lock. > >> > >> Any change? > >> In the past, I've asked the user to select1 a method to input location, > >> but I could save 1 swipe with a relevance statement like this in the > >> Latitude binding: relevant="(/data/GPS = ' ') > >> > >> On Wednesday, May 30, 2012 at 2:37:01 PM UTC-4, Prabhas Pokharel wrote: > >>> > >>> Hi, to answer the request at the bottom of this email on the > >>> formhub-users list, I have been trying to see if regex relevants work on gps > >>> fields. > >>> Turns out they don't. Neither do either of lines beyond the first below > >>> > >>> type name label relevant > >>> calculation > >>> geopoint gps_field GPS > >>> note blank_note Its blank! ${gps_field}='' > >>> note blank_note_re Its bank (re)! > >>> regex(${gps_field}, '^$') > >>> calculate gps_string > >>> string(${gps}) > >>> > >>> Actually, if I just skip the gps question, then nothing breaks (and the > >>> relevant in the two notes works as expected). But when any of the latter > >>> nodes are present in a form, as soon as I hit "record location", things > >>> break. > >>> The first two being unsupported seems okay... but shouldn't the calculate > >>> at least work? > >>> > >>> And finally, is there anything you can you do with a gps field to satisfy > >>> a request similar to Thomas's below? > >>> > >>> cheers, > >>> --p > >>> > >>>> From: Thomas Gotschi To: formhu...@googlegroups.com > >>> > >>> > >>>> > >>>> I would like to back up my location recording (question type geopoint) > >>>> with an open text description of the location (question type text), IF the > >>>> accuracy of the GPS recording is below a certain threshold (e.g. >50). > >>>> > >>>> It seems that in xlsforms I do not specify the geo variables further > >>>> (i.e. long, lat, altitude, accuracy), instead these get all stored in my > >>>> geopoint variable separated by spaces. > >>>> > >>>> How would the skipping logic (the statement in the relevant column) have > >>>> to look like, to only display the question if the accuracy of the geopoint > >>>> question was less than +-50m? > >>>> > >>>> Alternatively, if that is not possible, how would it look like if > >>>> capturing the geo-coordinates was not successful (i.e = null, or similar)? > >>>> > >>>> Thanks for helping out! > >>> > >>> > >>>> > >>>> (original here: > >>>> https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion) > >> > >> -- > >> -- > >> Post: opendatakit@googlegroups.com > >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com > >> Options: http://groups.google.com/group/opendatakit?hl=en > >> > >> --- > >> You received this message because you are subscribed to the Google Groups > >> "ODK Community" group. > >> To unsubscribe from this group and stop receiving emails from it, send an > >> email to opendatakit+unsubscribe@googlegroups.com. > >> For more options, visit https://groups.google.com/d/optout. > > > > > > > > > > -- > > Mitch Sundt > > Software Engineer > > University of Washington > > mitchellsundt@gmail.com > > > > -- > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en > > > > --- > > You received this message because you are subscribed to the Google Groups > > "ODK Community" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to opendatakit+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout.

Hi there,

KoboCollect is based on a much older version of ODK Collect. If you
can replicate this behavior on ODK Collect 1.6.1, then please post a
sample form and I can try to help.

If you cannot replicate it in Collect, then the problem is with
KoboCollect and you should contact that team at
http://support.kobotoolbox.org/.

Thanks,

Yaw

··· On Thu, May 11, 2017 at 11:22 AM, wrote: > These calculations seem to work in a constraint column for geopoints. However, when I try to use the same formula in a calculation or relevant column, I get NaN. I'm using KoboToolbox. > > Any thoughts on that? > > Thank > > On Friday, May 13, 2016 at 1:13:16 AM UTC-4, Yaw Anokwa wrote: >> And if you can provide a stack trace of the crash, that would be very >> helpful in fixing it. >> >> Yaw >> -- >> Need ODK consultants? Nafundi provides form design, server setup, >> in-field training, and software development for ODK. Go to >> https://nafundi.com to get started. >> >> On Mon, May 9, 2016 at 7:11 PM, Mitch Sundt wrote: >> > I don't remember what the state of this is. >> > >> > Javarosa is the XForms processing engine we use to interpret and evaluate >> > the XML file produced by ODK Build and XLSForm. In an attempt to fix this, I >> > updated javarosa back in 2013 or 2014 with the intention of: >> > >> > number(${geopoint}) ===> accuracy >> > boolean(${geopoint}) ===> true if the geopoint has been captured >> > string(${geopoint}) ====> "lat long alt acc" string (in which case you >> > could use selected-at() to pick out the field you want, as a string, and >> > then convert it to a number). >> > >> > BUT, if memory serves, this uncovered a deeper flaw in datatype treatments >> > within the javarosa code that prevented most of these from working >> > correctly. I just don't remember which ended up working and which did not. >> > >> > Please test these out and update this thread with what happens. >> > >> > >> > On Mon, May 9, 2016 at 9:09 AM, Ruth Little wrote: >> >> >> >> Hello Group, >> >> I was searching for syntax to include GPS in a relevance statement, and >> >> this old thread from 2012 is the closest I got. >> >> >> >> My goal is to display 2 screens to manually enter Latitude and Longitude, >> >> but only if the GPS is null >> >> I'm getting the same results reported here - works fine if I swipe past, >> >> but crashes as soon as the phone gets a GPS lock. >> >> >> >> Any change? >> >> In the past, I've asked the user to select1 a method to input location, >> >> but I could save 1 swipe with a relevance statement like this in the >> >> Latitude binding: relevant="(/data/GPS = ' ') >> >> >> >> On Wednesday, May 30, 2012 at 2:37:01 PM UTC-4, Prabhas Pokharel wrote: >> >>> >> >>> Hi, to answer the request at the bottom of this email on the >> >>> formhub-users list, I have been trying to see if regex relevants work on gps >> >>> fields. >> >>> Turns out they don't. Neither do either of lines beyond the first below >> >>> >> >>> type name label relevant >> >>> calculation >> >>> geopoint gps_field GPS >> >>> note blank_note Its blank! ${gps_field}='' >> >>> note blank_note_re Its bank (re)! >> >>> regex(${gps_field}, '^$') >> >>> calculate gps_string >> >>> string(${gps}) >> >>> >> >>> Actually, if I just skip the gps question, then nothing breaks (and the >> >>> relevant in the two notes works as expected). But when any of the latter >> >>> nodes are present in a form, as soon as I hit "record location", things >> >>> break. >> >>> The first two being unsupported seems okay... but shouldn't the calculate >> >>> at least work? >> >>> >> >>> And finally, is there anything you can you do with a gps field to satisfy >> >>> a request similar to Thomas's below? >> >>> >> >>> cheers, >> >>> --p >> >>> >> >>>> From: Thomas Gotschi To: formhu...@googlegroups.com >> >>> >> >>> >> >>>> >> >>>> I would like to back up my location recording (question type geopoint) >> >>>> with an open text description of the location (question type text), IF the >> >>>> accuracy of the GPS recording is below a certain threshold (e.g. >50). >> >>>> >> >>>> It seems that in xlsforms I do not specify the geo variables further >> >>>> (i.e. long, lat, altitude, accuracy), instead these get all stored in my >> >>>> geopoint variable separated by spaces. >> >>>> >> >>>> How would the skipping logic (the statement in the relevant column) have >> >>>> to look like, to only display the question if the accuracy of the geopoint >> >>>> question was less than +-50m? >> >>>> >> >>>> Alternatively, if that is not possible, how would it look like if >> >>>> capturing the geo-coordinates was not successful (i.e = null, or similar)? >> >>>> >> >>>> Thanks for helping out! >> >>> >> >>> >> >>>> >> >>>> (original here: >> >>>> https://groups.google.com/d/topic/formhub-users/KK6IrbqnkQo/discussion) >> >> >> >> -- >> >> -- >> >> Post: opendatakit@googlegroups.com >> >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> >> >> --- >> >> You received this message because you are subscribed to the Google Groups >> >> "ODK Community" group. >> >> To unsubscribe from this group and stop receiving emails from it, send an >> >> email to opendatakit+unsubscribe@googlegroups.com. >> >> For more options, visit https://groups.google.com/d/optout. >> > >> > >> > >> > >> > -- >> > Mitch Sundt >> > Software Engineer >> > University of Washington >> > mitchellsundt@gmail.com >> > >> > -- >> > -- >> > Post: opendatakit@googlegroups.com >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > Options: http://groups.google.com/group/opendatakit?hl=en >> > >> > --- >> > You received this message because you are subscribed to the Google Groups >> > "ODK Community" group. >> > To unsubscribe from this group and stop receiving emails from it, send an >> > email to opendatakit+unsubscribe@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. > > -- > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en > > --- > You received this message because you are subscribed to the Google Groups "ODK Community" group. > To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.