betty icon indicating copy to clipboard operation
betty copied to clipboard

Valid latitude/longitude in Gramps are (silently) rejected

Open leyan opened this issue 2 years ago • 1 comments

The current latitude/longitude parsing is very limiting. Almost all the places in my tree could not be parsed, because they are of the form 45°55'25"N

If you are ok with adding a dependency to something like https://pypi.org/project/lat-lon-parser/, this is a one line change:

return Point(lat_lon_parser.parse(coord_element.get('lat')), lat_lon_parser.parse(coord_element.get('long'))) instead of return Point(coord_element.get('lat'), coord_element.get('long'))

Do you prefer to reimplement the (simple) algorithm used internally?

leyan avatar Sep 12 '22 21:09 leyan

HI there! Thanks for reporting this. We should indeed aim to be more accepting of different valid coordinate formats.

As it happens, geopy, which is a Betty dependency already, provides a geopy.point.Point.from_string() factory that we can use instead of instantiating Point directly in betty.gramps.loader._load_coordinates(), preventing us from having to add any new dependencies.

bartfeenstra avatar Sep 16 '22 10:09 bartfeenstra