Open chahank opened 11 months ago
Thanks for the thorough report! It seems like the Natural Earth data resolution is too coarse for this kind of application.
By the way, I just realized that "10m" does not stand for "10 meters" but a 1:10 million map resolution. Not sure if I was the only one who assumed that 😅 The Natural Earth website states "Show the world on a large wall poster." for the 1:10m resolution. If I understand correctly, these maps are really meant for showing large-scale, global features. I might make sense to look for another data provider when determining the "on land" property of coordinates, as you suggest.
Oh, thanks, that makes so much more sense!
The ArcGIS World Countries feature layer might be a useful source. But the arcgis Python plugin is not available for osx-arm64 platforms (yet?)
Could this https://github.com/thampiman/reverse-geocoder be useful?
That looks indeed very nice! And only two dependencies that we already have. However, it is unclear whether it remains maintained or not.
The method to assign country codes to coordinates,
util.coordinates.get_country_code
does not work well close to the coastline. This is probably due to the use of cultural boundary maps from Natural Earth. Despite using the 10m resolution maps, coastlines seem rough. This is important because the method does 1. mask out all points not on land 2. assign country ids. Thus, points that are incorrectly set in the water will have the id0
for water.This is particularly not surprising, but we might be able to improve upon it. This issue is to document this and allow room for discussion. Maybe one could improve by combining different maps from natural earth (such as coastlines + small islands with boundary lines (countries with sea territory)). Or by using another service if needed (e.g. a google earth API?)
Here are two examples for which the method
util.coordinates.get_country_code
would assign0
as country id to the points (i.e., not in country but in water/ocean):