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

haversine formula uses coordinates also when position().defined() is false #86

Open
dforsi opened this issue Feb 26, 2014 · 1 comment

Comments

@dforsi
Copy link

dforsi commented Feb 26, 2014

Since it can happen that data extracts do not contain complete geometries, it would be useful at least to document the need to pass to Osmium::Geometry::Haversine::distance() only ways for which all node coordinates are available.

@joto
Copy link
Owner

joto commented Feb 27, 2014

There are other places where undefined positions can be used without the user noticing. This has always been somewhat problematic. The proper solution might be to throw an exception whenever an undefined position is used. The new osmium version solves this in a different way: It gives the user the choice whether to ignore errors or not in the node location store handler.

Please tell me if anybody has a good idea how to solve this without peppering the code with try-catch-blocks.

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

No branches or pull requests

2 participants