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

emit warning when wrapping coordinates #1547

Open
missinglink opened this issue Jul 29, 2021 · 4 comments
Open

emit warning when wrapping coordinates #1547

missinglink opened this issue Jul 29, 2021 · 4 comments

Comments

@missinglink
Copy link
Member

missinglink commented Jul 29, 2021

I was geocoding a spreadsheet today with lat/lon columns the wrong way around.

Pelias assumes the parameters are correct and so 'wraps' the coordinates around the earth until they come in the expected range [-90, +90] [-180 +180]

We should really emit a warning when wrapping occurs to make it clearer that we haven't used the input coordinates verbatim.

This will make it easier for users to detect errors where the axis have been confused.

@orangejulius
Copy link
Member

Yeah absolutely.

I recall we spent an absurd amount of effort making that wrapping work. It's fancy, but really coordinates outside a valid range almost certainly represent a coding mistake or bad data and should probably be handled as such by whoever is calling Pelias.

@missinglink
Copy link
Member Author

There's unfortunately a common case where users zoom out and pan a leaflet map, in that case each 'clone Earth' to the left and right is outside the standard longitude range.

Latitudes > +90 and < -90 are almost always an error

@missinglink
Copy link
Member Author

missinglink commented Jul 29, 2021

IIRC the wrapping is strictly required by elasticsearch, which emits errors when given out-of-range coordinates.

This may have been fixed over the years 🤷

@missinglink
Copy link
Member Author

I had a look at this today and it's unfortunately not trivial.

We'll need to refactor the sanitizer/_geo* modules to push errors/warnings onto messages rather than throwing Errors.

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

2 participants