emit warning when wrapping coordinates
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.
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.
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
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 🤷
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.