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 distance(nodeset<geopoint> | geoshape | geotrace) function #277

Closed
lognaturel opened this issue Mar 15, 2018 · 12 comments
Closed

Add distance(nodeset<geopoint> | geoshape | geotrace) function #277

lognaturel opened this issue Mar 15, 2018 · 12 comments

Comments

@lognaturel
Copy link
Member

https://opendatakit.github.io/xforms-spec/#fn:distance

getodk/xforms-spec#129

@dcbriccetti
Copy link
Contributor

Just to clarify,

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.

This distance is the sum of the great circle distances (arcs over the Earth’s surface) between each point and the previous, starting with the 2nd point. Yes?

@lognaturel
Copy link
Member Author

Yes, that is how I understand it. Perhaps we should use your wording in the spec, it’s nice and clear.

@dcbriccetti
Copy link
Contributor

I’m coordinating with Martijn on a common implementation and shared tests, and after reading some background from him, think we should leave the area calculation alone, despite its imprecision.

@dcbriccetti
Copy link
Contributor

I’ve discovered that the area calculator web tool used to generate test data for our area calculation doesn’t close the polygon when producing its perimeter. The 2,076 meter value is the sum of the lengths of the four sides between the five points moving anti-clockwise from the top-right point.

So, in our tests using this data, we also won’t close the polygons for perimeter calculations.

area calculator

@lognaturel
Copy link
Member Author

That sounds right. The calculation should use the points defined by the expression passed in and not add any. In the case of a geoshape argument, the first and last point will be the same.

@dcbriccetti
Copy link
Contributor

Good to know. Thanks!

@dcbriccetti
Copy link
Contributor

Getting close to done here.

screen shot 2018-04-24 at 9 41 46 pm

@dcbriccetti
Copy link
Contributor

OK, reviewers, at your convenience. 3 PRs. 302–304. I’m thinking 15–25 minutes would be needed. And if you like, I’ll even walk you through it if we can coordinate our schedules.

@getodk-bot
Copy link
Member

Hello @dcbriccetti, you claimed this issue to work on it, but this issue and any referenced pull requests haven't been updated for 7 days. Are you still working on this issue?

If so, please update this issue by leaving a comment on this issue to let me know that you're still working on it. Otherwise, I'll automatically remove you from this issue in 3 days.

If you've decided to work on something else, simply comment @opendatakit-bot unclaim so that someone else can claim it and continue from where you left off.

Thank you for your valuable contributions to Open Data Kit!

@dcbriccetti
Copy link
Contributor

Silly bot. Can’t you read?

lognaturel added a commit that referenced this issue May 2, 2018
lognaturel added a commit that referenced this issue May 2, 2018
Add support for distance function to XPathFuncExpr (Issue #277 part 3)
@getodk-bot
Copy link
Member

Hello @dcbriccetti, you claimed this issue to work on it, but this issue and any referenced pull requests haven't been updated for 7 days. Are you still working on this issue?

If so, please update this issue by leaving a comment on this issue to let me know that you're still working on it. Otherwise, I'll automatically remove you from this issue in 3 days.

If you've decided to work on something else, simply comment @opendatakit-bot unclaim so that someone else can claim it and continue from where you left off.

Thank you for your valuable contributions to Open Data Kit!

@dcbriccetti
Copy link
Contributor

I need to complete so that it satisfies:

Returns the distance in meters of either a nodeset of geopoints or a single geoshape value or a single geotrace value

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

3 participants