|
|
||
|---|---|---|
| db | More robust work with mwm size predictions, including prediction model limitations | |
| scripts | SQL formatting | |
| web | Elaborate search endpoint | |
| .gitignore | MWM size prediction model | |
| docker-compose.yaml | SQL formatting | |
| LICENSE | add MIT license file | |
| README.md | Translate README to English | |
Script Suite and Web Interface for Boundary Editing
These directories contain a set of tools for editing boundary datasets in the Osmosis Poly format.
Docker Deployment
The simplest approach is running the system within Docker containers.
Prerequisites
- Docker must be installed: https://docs.docker.com/engine/install/
- Docker Compose must be installed: https://docs.docker.com/compose/install/
- Full planet deployment requires approximately 200 GB disk space during build (reducing to 30 GB post-build). Deployment may take around 24 hours.
Build Configuration
In the docker-compose.yaml file:
- Set your desired port for the web interface (currently
8081:80in the ports section). - Configure the planet file URL using the
PLANET_URLenvironment variable. ThePLANET_URL_<suffix>variables are unused examples.
For testing, substitutePLANET_URLwith a small planet file to reduce build time to minutes.
Manual Deployment
Requires a PostgreSQL database with PostGIS extension. Initialise the database using scripts from the db directory. Consult db/Dockerfile.db and docker-compose.yaml for execution order and required environment variables.
To estimate MWM file sizes, populate the tiles table from the planet file (see db/*tiles*.sh scripts).
For updating/replacing boundaries from OpenStreetMap, import the osm_borders table (see db/prepare_borders.sh and db/load_borders.sh). Initial boundaries can be loaded via scripts/poly2postgis.py or copied from osm_borders (e.g., using admin_level=2).
Post-editing, generate poly files using scripts/export_poly.py or the Download poly - all option in the web interface.
Server Components
Two scripts in the server directory must run persistently:
borders-api.py– Flask server (port 5000). Handles XHR requests from the web interface. Verify table names and READONLY flag at the script's start.borders-daemon.py– Continuously checks theborderstable for empty data-count fields and recalculates them. Required for MWM size estimation.
Web Interface
Files in web/app/static require no interpreters or dedicated servers. Open index.html directly in a browser. The map displays boundaries – clicking any boundary populates the right-hand panel with controls for:
- Splitting/merging boundaries
- Renaming features
- Replacing/supplementing data from
osm_borders - Exporting to JOSM for complex edits
Author and Licensing
Developed by Ilya Zverev for MAPS.ME. Published under the MIT licence.