Divide the earth's land mass into patches with prescribed maximum diameter along administrative boundaries and get optimal parameters for azimuthal equidistant projections (aep).
Each patch of land generated by div4aep
- corresponds to exactly one relation in the OpenStreetMap data base with tags
type=boundary
andboundary=administrative
. - has prescribed maximum diameter (great circle distance between farthest points).
- comes with center and radius of the smallest enclosing spherical circle.
All patches together cover (almost) all of the earth's land mass.
Output is a CSV file containing for each patch:
- the OSM relation's OSM ID,
- the region's name,
- a unique code (ASCII),
- value of the relation's
admin_level
key, - OSM ID of parent relation,
- center (latitude, longitude) and radius (meters) of the smalles enclosing circle
Based on div4aep
's data you may generate optimal azimuthal equidistant projections for each patch (user the patch's center as origin of the projection). Deviation of Euclidean distances in the projected maps from geodesic distances will be uniformly bounded with respect to all patches. For computation of the bound given a maximum diameter as well as for ready-to-use data sets produced by div4aep
and information on how to use them see AU/AEP data sets.
Clone this repo or download div4aep.py
and config.json.template
from this repo.
Rename config.json.template
to config.json
and adapt config options to your needs. Non-self-explanatory options are:
overpass_key
: API key for your Overpass API instance.bbox
: Onlyadmin_level=2
(and above) administrative boundaries lying (partially) inside this box will be considered.max_admin_level
: Do not consider higheradmin_level
values.min_coverage
: Discard a set of subpatches if it does not cover the parent patch to at least this fraction (0 = nocoverage, 1 = full coverage).good_coverage
: Do not discard partial coverings if coverage is above this value.max_overhang
: Consider a subpatch as contained in the parent patch if at most this fraction of the patch lies outside the parent patch (value 0-1).patches_map_path
: Write a visualization of all patches to this file (HTML and JavaScript/Leaflet).uncovered_map_path
: Write a visualization of uncovered areas of initial patches with subpatches not covering the whole parent patch to this file (HTML and JavaScript/Leaflet).
IMPORTANT: You should not use public Overpass API instances with div4aep
! With default configuration div4aep
will send about 120 queries with overall download size about 3 GB. If you would like to have a private Overpass API instance, have a look at Overpass API Podman image.
If config options are set, run
python div4aep.py
See requirements.txt
for package you have to have installed.
Open a GitiHub issue for bug reports. File pull requests against the dev
branch.
The dev
branch contains the code for the next release, whereas the main
branch holds the current release.