Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for distance-between() or something similar #129

Closed
yanokwa opened this issue Jun 2, 2017 · 8 comments
Closed

Add support for distance-between() or something similar #129

yanokwa opened this issue Jun 2, 2017 · 8 comments

Comments

@yanokwa
Copy link
Member

yanokwa commented Jun 2, 2017

From https://groups.google.com/d/msg/opendatakit-developers/gQrS20_LMBc/GX25qPOcAwAJ

We have support for area() and it'd be nice to get something like distance-between().

@MartijnR
Copy link
Contributor

MartijnR commented Jun 16, 2017

I'm in favor. I just want to propose to name it distance() instead, unless people think there is scope for confusion.

Wrt its functionality, how about this description (based on how area() works):

Returns the distance in meters of either a nodeset of geopoints or a single geoshape value or a single geotrace value (not a combination of these) on Earth, in the sequence provided by the
points in the parameter. It takes into account the circumference of the Earth around the Equator and does not take altitude into account.

@lognaturel
Copy link
Member

That sounds great to me, @MartijnR! I agree with distance() as the name.

@lognaturel
Copy link
Member

And just to refresh my memory, we agreed not to namespace custom Xpath functions because XLSForms just passes them through, right?

@MartijnR
Copy link
Contributor

MartijnR commented Jun 16, 2017

I had to look that up as well. We left it here. Clearly we are bad, and are in trouble if official XPath specs use the same function name (for functions that do something else). However, it would be harder to shelter users from scary namespaces if we use them for XPath functions (would require more pyxform/etc magic to do - by adding them to the XForm output).

@meletis
Copy link

meletis commented Jun 20, 2017

We have contributed the distance-between() and several other functions to ODK since last December but I can see those were never merged to the main branch:

https://bitbucket.org/m.sundt/javarosa/commits/7f3677c51d8c65f3ab285c542d6924f6d77775ae

I just remembered there was a public discussion with arguments whether those should be merged or not but I really don't remember what was the final result of this discussion. If I find it, I will post the link here.

@meletis
Copy link

meletis commented Jun 20, 2017

Oh, thank you, @MartijnR. I saw your last comment after I had posted my comment above. :)

@muneneg
Copy link

muneneg commented Aug 14, 2018

Hi I am adding the area() in my xlsform, to calculate the area/size of a plot, the question type am using is geoshape. What unit of measure is my area() in, Acres/Ha/.
Thanks

@MartijnR
Copy link
Contributor

It it's in square meters. See https://opendatakit.github.io/xforms-spec/#fn:area

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants