Skip to content
/ div4aep Public

Divsion of earth for azimuthal equidistant projection

License

Notifications You must be signed in to change notification settings

jeflem/div4aep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

div4aep

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 and boundary=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.

Installation

Clone this repo or download div4aep.py and config.json.template from this repo.

Usage

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: Only admin_level=2 (and above) administrative boundaries lying (partially) inside this box will be considered.
  • max_admin_level: Do not consider higher admin_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.

Contributing

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.

Licence

GNU General Public License v3.0

About

Divsion of earth for azimuthal equidistant projection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages