{"id":16781464,"url":"https://github.com/ppintosilva/osm-exporter","last_synced_at":"2026-05-15T12:32:32.265Z","repository":{"id":50205962,"uuid":"139431766","full_name":"ppintosilva/osm-exporter","owner":"ppintosilva","description":"Export data from OpenStreetMap using a template overpass query","archived":false,"fork":false,"pushed_at":"2022-12-08T02:14:13.000Z","size":12,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-24T11:39:46.027Z","etag":null,"topics":["export-data","openstreetmap","openstreetmap-data","osm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppintosilva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-02T11:03:57.000Z","updated_at":"2018-07-02T22:10:36.000Z","dependencies_parsed_at":"2023-01-24T09:15:29.784Z","dependency_job_id":null,"html_url":"https://github.com/ppintosilva/osm-exporter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ppintosilva/osm-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppintosilva%2Fosm-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppintosilva%2Fosm-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppintosilva%2Fosm-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppintosilva%2Fosm-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppintosilva","download_url":"https://codeload.github.com/ppintosilva/osm-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppintosilva%2Fosm-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["export-data","openstreetmap","openstreetmap-data","osm"],"created_at":"2024-10-13T07:43:06.878Z","updated_at":"2026-05-15T12:32:32.245Z","avatar_url":"https://github.com/ppintosilva.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# osm-exporter\nExport data from OpenStreetMap using a template overpass query\n\n---\n\n**What is this?** - A small python CLI script to help you export OSM data using pre-defined overpass query templates.\n\n**What osm-exporter is not for:** - Downloading OSM data using a non-template query. If you've already defined a overpass query then you can simply [get the osm data using the command line](http://overpass-api.de/command_line.html). If you think the query can be re-used (e.g. different bbox), turn it into a template instead.\n\n## Installation\n\nJust run ```pip install -r requirements``` in your **virtualenv**.\n\n## Usage\n\n```\npython exporter.py --help\n\nUsage: exporter.py [OPTIONS] TEMPLATE VALUES\n\n  Export OSM data using overpass query templates.\n\n      TEMPLATE is a file containing a template string with '$'-based\n      substitution. Defines the overpass query and substitution keys.\n\n      VALUES is an yaml-file defining the values for each substitution key.\n\nOptions:\n  -o, --out TEXT  Output filename with the exported osm data\n  -v, --verbose   Print the overpass query request\n  --help          Show this message and exit.\n```\n\n### Example - Downloading OSM data for the [roads template](templates/roads)\n\nMy use case consisted of using OSM data to build the road graph for a region of the U.K. In addition to roads, I wanted to include the location of traffic signals and bus stops. After developing and testing my overpass query on [overpass turbo](https://overpass-turbo.eu/), I came up with the following [query template](templates/roads/query):\n\n```\n[bbox:$bbox]\n[timeout:$timeout]\n[out:$outformat]\n;\n(\n  node\n    [\"highway\"]\n    $node_filters\n    ;\n\n  way\n    [\"highway\"]\n    $way_filters\n    ;\n);\nout;\n\u003e;\nout skel qt;\n```\n\nThe default substitution values are defined on the corresponding [defaults file](templates/roads/defaults.yml):\n``` yaml\nbbox: \"54.84,-1.86,55.18,-1.32\"\ntimeout: 120\noutformat: json\n\nnode_filters: |-\n  // Unfortunate but necessary indentation\n      [\"highway\"~\"traffic_signals|bus_stop\"]\n\nway_filters: |-\n  // Unfortunate but necessary indentation\n      [\"highway\"!=\"track\"]\n      [\"highway\"!=\"bus_guideway\"]\n      [\"highway\"!=\"escape\"]\n      [\"highway\"!=\"raceway\"]\n      [\"highway\"!=\"road\"]\n      [\"highway\"!=\"pedestrian\"]\n      [\"highway\"!=\"footway\"]\n      [\"highway\"!=\"bridleway\"]\n      [\"highway\"!=\"steps\"]\n      [\"highway\"!=\"path\"]\n      [\"highway\"!=\"cycleway\"]\n      [\"highway\"!=\"construction\"]\n```\n\nNotice that I could have created a template which used the values of $node_filters and $way_filters directly, but instead decided on a more generic template. You can copy the defaults into a new file and redefine any of these variables. Using new values for $timeout and $outformat, and a smaller bounding box, the final query looks like this:\n```\n[bbox:54.972047139106,-1.625311374664,54.979861000731,-1.6177690029144]\n[timeout:15]\n[out:xml]\n;\n(\n  node\n    [\"highway\"]\n    [\"highway\"~\"traffic_signals|bus_stop\"]\n    ;\n\n  way\n    [\"highway\"]\n    [\"highway\"!=\"track\"]\n    [\"highway\"!=\"bus_guideway\"]\n    [\"highway\"!=\"escape\"]\n    [\"highway\"!=\"raceway\"]\n    [\"highway\"!=\"road\"]\n    [\"highway\"!=\"pedestrian\"]\n    [\"highway\"!=\"footway\"]\n    [\"highway\"!=\"bridleway\"]\n    [\"highway\"!=\"steps\"]\n    [\"highway\"!=\"path\"]\n    [\"highway\"!=\"cycleway\"]\n    [\"highway\"!=\"construction\"]\n    ;\n);\nout;\n\u003e;\nout skel qt;\n```\n\nYou can try the final query at [overpass turbo](https://overpass-turbo.eu/), or use it directly with **osm-exporter**:\n\n```\npython exporter.py \\\n  templates/roads/query \\\n  templates/roads/defaults.yml \\\n  --verbose\n```\n\n## [Moar](https://www.urbandictionary.com/define.php?term=moar) templates\n\nYou can contribute to **osm-exporter** by creating new overpass query templates and adding them to the templates folder:\n\n- **Fork** this repository\n- Write your **template** (and defaults.yml)\n- Submit a **pull request**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppintosilva%2Fosm-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppintosilva%2Fosm-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppintosilva%2Fosm-exporter/lists"}