api icon indicating copy to clipboard operation
api copied to clipboard

emit warning when wrapping coordinates

Open missinglink opened this issue 4 years ago • 4 comments

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.

missinglink avatar Jul 29 '21 19:07 missinglink

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.

orangejulius avatar Jul 29 '21 20:07 orangejulius

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 avatar Jul 29 '21 20:07 missinglink

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 avatar Jul 29 '21 20:07 missinglink

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.

missinglink avatar Aug 10 '21 12:08 missinglink