Osmctl

From OpenStreetMap Wiki
Jump to navigation Jump to search
View on OSM Apps Catalog  
osmctl
v · d 
Author: Happy Hacking Space
License: MIT License
Platforms: Linux, macOS, and Windows
Status: beta
Language:
english
Website: https://github.com/happyhackingspace/osmctl
Source code: https://github.com/happyhackingspace/osmctl
Programming language: Go

All-in-one command line tool to read, search, edit and contribute to OpenStreetMap

Features
Feature Value
Map Display
?
Routing
?
Navigating
?
Tracking
?
Monitoring
?
Editing
?
Rendering
?
Accessibility
?

osmctl is a command line tool for working with OpenStreetMap from a terminal. It combines reading the API, searching with Overpass and Nominatim, editing the map, handling map notes and processing local .osm.pbf files in one program with a single, consistent interface.

It is a single binary with no runtime dependencies. Every command can print plain text, JSON, OSM XML or GeoJSON, so its output can be piped into tools such as jq, JOSM or QGIS.

The project is in beta. Please report problems on the issue tracker.

Features

Reading
Elements, their full history and specific versions, changesets with their discussions, user profiles and raw map data for a bounding box. Elements can be given as node/123, n123 or a pasted openstreetmap.org URL.
Searching
osmctl find searches by tag near a point, inside a bounding box or inside a named place without writing Overpass QL; osmctl query runs any Overpass QL. geocode and reverse use Nominatim.
Editing
A workflow modelled on git: changes are staged locally (tag, add, move, delete, or apply for an OsmChange file), reviewed with status and diff, and uploaded as one changeset with push. The upload is atomic. If an element was changed by someone else in the meantime, nothing is written and the staged edits are kept.
Notes and discussion
Create, comment on, close and reopen map notes; comment on changesets.
Local data
Download regional extracts from Geofabrik, inspect .osm.pbf and .osm files, and extract features by tag and bounding box to OSM XML or GeoJSON.

Installation

With Go installed:

go install github.com/happyhackingspace/osmctl/cmd/osmctl@latest

Example

osmctl find amenity=drinking_water --in "Diyarbakır"
osmctl auth login
osmctl tag node/123 opening_hours="Mo-Sa 08:00-20:00"
osmctl diff
osmctl push -m "Add opening hours from survey" --source survey

Responsible editing

osmctl shows the full diff and asks for confirmation before every upload, requires a changeset comment, and warns before uploading large changesets. Scripted or bulk edits made with it are subject to the Automated Edits code of conduct. Edits can be practised on the development server with --server dev.

Authentication uses OAuth 2.0 with PKCE. Tokens are stored in the operating system keychain.