Working on a prototype program - right now using the named regions from (https://download.geofabrik.de/) that are defined via a geojson (https://download.geofabrik.de/index-v1.json) to build maps based on a user's defined area (a simple rectangular area currently).
For now we are having the user go to the website and download the appropriate sized "named" region that will cover the area of interest. We can also do this programmatically with pyrosm, get_data
call IF we know the correct name of the region that would cover that area of interest.
Is there a call within pyrosm, or another library, that could determine which named areas would provide complete coverage of the area of interest and then subsequently down them (via get_data, or other method).
Obviously we could search through the geojson file and some how determine which region(s) the coordinates fall within - easier with a single coordinate, tougher as the area of interest definition gets more complicated. Looking for the off-the-shelf or more robust answer, especially to find the smallest region.
geojson example data:
{ "type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"id" : "afghanistan",
"parent" : "asia",
"iso3166-1:alpha2" : [ "AF" ],
"name" : "Afghanistan",
"urls" : {
"pbf" : "https://download.geofabrik.de/asia/afghanistan-latest.osm.pbf",
"bz2" : "https://download.geofabrik.de/asia/afghanistan-latest.osm.bz2",
"shp" : "https://download.geofabrik.de/asia/afghanistan-latest-free.shp.zip",
"pbf-internal" : "https://osm-internal.download.geofabrik.de/asia/afghanistan-latest-internal.osm.pbf",
"history" : "https://osm-internal.download.geofabrik.de/asia/afghanistan-internal.osh.pbf",
"taginfo" : "https://taginfo.geofabrik.de/asia/afghanistan/",
"updates" : "https://download.geofabrik.de/asia/afghanistan-updates"
}
},
"geometry": { "type" : "MultiPolygon", "coordinates" : [[[[62.478080,29.389570],[60.850480,29.858340],[61.787900,30.845590],