betty
betty copied to clipboard
Valid latitude/longitude in Gramps are (silently) rejected
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?
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.