comaps/borders
17
0
Fork
You've already forked borders
0
A set of scripts and a web interface for editing borders
Python 50.1%
JavaScript 35.2%
HTML 8.1%
CSS 4.6%
Shell 2%
Find a file
Harry Bond 8e35d018cb add MIT license file
Signed-off-by: Harry Bond <me@hbond.xyz>
2025年06月12日 13:15:00 +01:00
db More robust work with mwm size predictions, including prediction model limitations 2020年12月29日 12:32:33 +03:00
scripts SQL formatting 2020年10月23日 01:13:45 +03:00
web Elaborate search endpoint 2020年12月30日 18:44:18 +03:00
.gitignore MWM size prediction model 2020年10月02日 12:30:52 +03:00
docker-compose.yaml SQL formatting 2020年10月23日 01:13:45 +03:00
LICENSE add MIT license file 2025年06月12日 13:15:00 +01:00
README.md Translate README to English 2025年06月12日 11:56:57 +01:00

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

Build Configuration

In the docker-compose.yaml file:

  1. Set your desired port for the web interface (currently 8081:80 in the ports section).
  2. Configure the planet file URL using the PLANET_URL environment variable. The PLANET_URL_<suffix> variables are unused examples.
    For testing, substitute PLANET_URL with 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 the borders table 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.