OSM Preflight
| OSM Preflight | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Author: | Henning Jacobs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| License: | MIT License (free of charge) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Platform: | Web | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Status: | Active | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Language: | English
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Website: | https://kinderfreundlicheorte.de/osm-preflight/ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Source code: | https://codeberg.org/hjacobs/osm-preflight | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Programming languages: | JavaScript and Python | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Review proposed OSM edits in the browser before uploading them. Approve, reject or skip each proposal, then upload the approved ones with your own OSM account. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OSM Preflight is a small web tool to review proposed OpenStreetMap edits before they are uploaded.
A script (a "generator") produces a list of proposed changes. Preflight shows each proposal as a diff against the current OSM data. Users can approve, reject or skip it. Only the approved proposals are uploaded, with the users own OSM account via OAuth 2.0.
Proposals are tag changes on existing elements, or new nodes for places that are missing in OSM.
Try it: the live instance opens with example data. You can review and preview everything without an account. Uploading needs your OSM login and a click on the upload button. Nothing is uploaded automatically.
Preflight is a personal project. It is not affiliated with the OpenStreetMap Foundation.
Why it was built
Generator scripts that find missing or wrong tags, for example OSM WebTagger, which reads a POI's own website and proposes tags like opening_hours, need a way to review their proposed edits.
These tools did not fit this workflow (generator -> human review):
- MapRoulette shows tasks, but usually not the concrete tag diff to check.
- JOSM can review files, but needs opening a desktop editor for it.
- OSMCha shows changesets after the upload. That is too late.
So OSM Preflight is the missing step in between: look at the concrete diff first, decide, then upload. All via web browser.
How it works
1. Input
A JSON file in the osm-preflight/1 format (see Input format below): per proposal, the OSM element (or the coordinates for a new node), the tags to set and/or delete, plus a reason and evidence links. A file can be loaded via the file picker, drag & drop, the proposals.json placed next to the page, or — with the optional backend — through the submission inbox (see Submission API).
2. Review
Each proposal is shown as a card with:
- a current-vs-proposed diff, with the current data fetched live from the OSM API,
- a small map thumbnail when coordinates are known,
- the reason and evidence links, plus quick links to the place's website, Instagram/Facebook profiles, a Panoramax photo and the Wikidata entry where available, for verification,
- inline editing of proposed values, and the option to exclude single tag changes from a proposal.
Proposals can be approved, rejected (with a reason category) or skipped, per card or in bulk over the current filter. Keyboard: j/k navigate, a approve, r reject, s skip. Decisions persist in the browser and can be exported as decisions.json, keyed by the stable proposal id, as feedback to the generator.
A preview shows, for everything approved, the exact changeset tags and element XML that will be created, plus the combined OsmChange (.osc) file for download. Preview and upload share one code path, so what the preview shows is exactly what gets created.
3. Write
Approved proposals are uploaded strictly sequentially, one changeset per proposal. Each changeset comment names that one entry — its title, the concrete tag changes and the first sentence of the proposal's reason. The generator is recorded in the osm-preflight:generator changeset tag, and a host tag carries the full URL of the deployment that produced the changeset.
Before every write the element is fetched fresh and the changes are applied to that fresh state only:
- If nothing effectively changes, no changeset is created (no-op).
- A
409 Conflictis retried exactly once with a new fresh fetch. 410 Gonemarks the proposal as gone.- If only some tag changes were included, only that subset is written; the rest returns to pending and can be uploaded later as a second changeset.
Nothing is uploaded automatically after the login redirect.
Creating new nodes
A create proposal describes a POI that is missing from OSM entirely — typically a distinct facility hosted inside another one (for example a family center inside a kindergarten: one feature, one OSM element, so the hosted POI gets its own node instead of tagging the host).
Creates are guarded three times:
- the generator checks for duplicates before emitting (same primary feature tag within 100 m, same normalized name within 250 m),
- the review UI re-checks against Overpass API when the batch is opened, with a movable pin and numeric latitude/longitude fields to correct the position,
- the upload re-checks against the main OSM API immediately before creating; a hit turns the create into a no-op that records the existing element — no duplicate is written.
A create whose upload fails ambiguously is never retried blindly. Creates are all-or-nothing: a node is created once, with its full tag set, or not at all.
Input format
The format is defined by a JSON Schema (proposals.schema.json in the repository). A guide for generator authors, Making proposals, is linked under External links.
Minimal example:
{
"$schema": "https://kinderfreundlicheorte.de/osm-preflight/proposals.schema.json",
"schema": "osm-preflight/1",
"generator": {
"name": "my-generator",
"version": "1.0",
"title": "Dead websites in Hamburg",
"comment": "Remove dead website tags",
"source": "survey;website-check 2026-11-16"
},
"proposals": [
{
"id": "my-generator-2026-11-16-node-12345",
"element": { "type": "node", "id": 12345 },
"group": "hamburg",
"title": "Café Beispiel",
"set": { "website": "https://cafe-beispiel.de/neu" },
"delete": ["contact:website"],
"reason": "Old URL returns 404; redirect target checked by hand",
"evidence": [
{ "label": "Check report", "url": "https://example.org/report#12345" }
],
"confidence": "high",
"display": { "name": "Café Beispiel", "lat": 53.5712, "lon": 9.9612 }
}
]
}
Rules:
idis required and must be stable and unique — review feedback flows back via it.- At least one of
set/deletemust be non-empty. A proposal carries exactly one ofelement(a tag change on an existing node, way or relation) orcreate(a new node). Deleting elements and geometry edits are out of scope. - For creates,
setis required and is the new node's whole tag set; it must contain anameand a primary feature tag (amenity,leisure,shop,tourism,officeorcraft), anddeleteis forbidden. reasonandevidenceare part of the format on purpose: a proposal without a reason is visibly marked in the review UI. The first sentence of the reason becomes part of the changeset comment.displayis a display hint only — authoritative data is always fetched fresh at write time.
Generators
Any tool that emits osm-preflight/1 JSON can use Preflight as its review and upload step. Known generators include:
- OSM WebTagger — extracts missing tags (
opening_hours, contact and social-media tags,kids_area,changing_table, …) from a POI's own website, with a verbatim quote as evidence for every proposal. - OSM Panoramax Tagging — finds Panoramax photos for POIs and proposes Key:panoramax tags
- OSM SchemaLint — finds tag keys/values that deviate from the documented tagging schema (for example wrong-case keys or values, or a main tag value that should be a subtag).
- OSM WebsiteWatch — checks the websites of mapped POIs and proposes fixes for dead or moved URLs.
Safety
- One changeset per proposal keeps the blast radius small and every change individually revertible.
- Reviewing more than 20 approved uploads shows a pointer to the Automated Edits code of conduct.
- Never upload proposals you have not actually reviewed — the tool makes review fast, it does not replace it.
- Creating nodes from an external list is an import in OSM's sense: document the source and its licence, conflate, and discuss with the community before a mass upload.
Deployment
The review UI is a single static web page (index.html, vanilla JavaScript, no build step, no dependencies). Copy the contents of the public/ folder to any static web host to run your own instance.
OAuth setup
Writing needs an OAuth 2.0 application on openstreetmap.org — one per hosting URL, because the redirect URI must match the page exactly:
- On openstreetmap.org: My Settings → OAuth 2 applications → Register new
- Redirect URI: the exact URL of the page, trailing slash included
- Confidential: leave unticked (public client, PKCE flow, no secret)
- Permissions:
read_prefsandwrite_api
The resulting client ID is public by design and is configured in the page's OAuth settings (stored in the browser only); a client secret is never used. For testing, the settings offer the OSM development API (master.apis.dev.openstreetmap.org), which needs its own account and OAuth app there.
Because the page performs authenticated writes, a host must also send framing and transport protections (X-Frame-Options: DENY or Content-Security-Policy: frame-ancestors 'none', and HTTPS with HSTS) — a static copy alone does not include them.
Submission API
The static page works fully on its own. Optionally, a small Python backend (server/preflight_api.py in the repository) adds a submission inbox: generators and CLIs submit batches with minted API tokens, reviewers pick them up in the page's inbox, and batches can be public, unlisted or private, with grants to named OSM users. The backend never holds OSM credentials and never writes to OSM.
Privacy
Per proposal card, the page fetches that element's current tags from the OSM API and, when coordinates are known, renders a small map thumbnail from tile.openstreetmap.org (lazy-loaded, reviewer-initiated). Photo hover previews go to Panoramax and Wikimedia Commons only, and only while hovering; image=* URLs are never previewed automatically. OAuth settings and review decisions are stored in the browser's localStorage; the access token is kept in localStorage so the login survives restarts, and the page's Logout button removes it. No analytics, no cookies.
Development
The canonical repository is on Codeberg (see the infobox). The review UI is plain HTML/CSS/JS with nothing to install; the backend and its test suite are Python. Validate input files against public/proposals.schema.json. Test safely against the OSM development API (see OAuth setup).
