{"id":13581809,"url":"https://github.com/codesoap/osmar","last_synced_at":"2025-04-06T10:32:59.181Z","repository":{"id":43870063,"uuid":"298844462","full_name":"codesoap/osmar","owner":"codesoap","description":"A simple command line tool to explore OSM data","archived":false,"fork":false,"pushed_at":"2024-10-04T11:10:58.000Z","size":42,"stargazers_count":127,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T21:45:12.879Z","etag":null,"topics":["cli","osm","pbf"],"latest_commit_sha":null,"homepage":"","language":"Go","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/codesoap.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":"2020-09-26T15:33:23.000Z","updated_at":"2024-11-03T12:23:41.000Z","dependencies_parsed_at":"2022-09-26T21:51:04.913Z","dependency_job_id":null,"html_url":"https://github.com/codesoap/osmar","commit_stats":null,"previous_names":["codesoap/osmf"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fosmar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fosmar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fosmar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fosmar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesoap","download_url":"https://codeload.github.com/codesoap/osmar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247470529,"owners_count":20944146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","osm","pbf"],"created_at":"2024-08-01T15:02:15.286Z","updated_at":"2025-04-06T10:32:56.779Z","avatar_url":"https://github.com/codesoap.png","language":"Go","readme":"A small tool for querying OSM data from PBF files.\n\n# Installation\nYou can download the tool from the releases page:\nhttps://github.com/codesoap/osmar/releases\n\nIf you have the Go toolchain installed and prefer to build osmar\nyourself, you can get it by running this:\n\n```bash\ngo install github.com/codesoap/osmar/v3@latest\n# The binary is now at ~/go/bin/osmar.\n```\n\n# Basic Usage\nBefore you can use osmar, you must set the environment variable\n`OSMAR_PBF_FILE`; it must contain the path to a PBF\nfile. These files can be downloaded, for example, from\n[download.geofabrik.de](https://download.geofabrik.de/). An example would be:\n```console\n$ cd /tmp\n$ wget 'https://download.geofabrik.de/europe/germany/bremen-latest.osm.pbf'\n$ export OSMAR_PBF_FILE='/tmp/bremen-latest.osm.pbf'\n```\n\n```console\n$ # Find all entries within 50m of the center of Bremen, Germany:\n$ osmar 53.076 8.807 50\nmeta:distance: 5m\nmeta:id: 163740903\nmeta:type: way\nmeta:link: https://www.openstreetmap.org/way/163740903\naddr:city: Bremen\naddr:country: DE\naddr:housenumber: 1\naddr:postcode: 28195\naddr:street: Am Markt\nbuilding: retail\n...\n\n$ # Filter by tags to find a bicycle shop near the center of Bremen:\n$ osmar 53.076 8.807 500 shop=bicycle\nmeta:distance: 243m\nmeta:id: 834082330\nmeta:type: node\nmeta:link: https://www.openstreetmap.org/node/834082330\naddr:city: Bremen\naddr:country: DE\naddr:housenumber: 30-32\naddr:postcode: 28195\naddr:street: Martinistraße\ncheck_date:opening_hours: 2024-04-28\nemail: velo-sport@nord-com.net\nfax: +49 421 18225\nname: Velo-Sport\n...\n\n$ # Use UNIX tools to compact the output:\n$ osmar 53.076 8.807 200 shop=clothes | grep -e '^$' -e distance -e meta:link -e name\nmeta:distance: 65m\nmeta:link: https://www.openstreetmap.org/node/410450005\nname: Peek \u0026 Cloppenburg\nshort_name: P\u0026C\n\nmeta:distance: 98m\nmeta:link: https://www.openstreetmap.org/node/3560745513\nname: CALIDA\n\nmeta:distance: 99m\nmeta:link: https://www.openstreetmap.org/node/718963532\nname: zero\n...\n```\n\n# More Examples\nYou can find the documentation on all available tags at\n[wiki.openstreetmap.org/wiki/Map_Features](https://wiki.openstreetmap.org/wiki/Map_Features).\nHere are a few more examples:\n\n```bash\n# Find a bakery:\nosmar 53.076 8.807 200 shop=bakery\n\n# Find nearby public transport stations:\nosmar 53.076 8.807 200 public_transport=stop_position\n\n# Find nearby hiking routes:\nosmar 53.076 8.807 500 route=hiking\n\n# Searching for multiple values of the same tag is also possible:\nosmar 53.076 8.807 3000 sport=climbing sport=swimming\n\n# Pro tip: Use \"*\" to search for any value:\nosmar 53.076 8.807 500 'sport=*'\n\n# Learn about the population of the city and its urban districts:\nosmar 53.076 8.807 10000 'population=*'\n```\n\n# Performance\nBecause osmar is parsing compressed PBF files on the fly, performance is\nsomewhat limited, but should be good enough for a few queries now and\nthen. Try to use the smallest extract that is available for your area.\n\nThe performance can be improved slightly by converting PBF files to zstd compression with \nthe [zstd-pbf tool](https://github.com/codesoap/zstd-pbf).\n\nHere are some quick measurements; better results will probably be\nachieved with more modern hardware:\n\n| PBF file | Query | CPU | Runtime | RAM usage |\n| --- | --- | --- | --- | --- |\n| bremen-latest.osm.pbf (19.3MiB)             | `osmar 53.076 8.807 50 'shop=*'`   | i5-8250U (4x1.6GHz)         | ~0.24s | ~65MiB  |\n| bremen-latest.osm.pbf (19.3MiB)             | `osmar 53.076 8.807 50 'shop=*'`   | AMD Ryzen 5 3600 (6x4.2GHz) | ~0.10s | ~125MiB |\n| bremen-latest.zstd.osm.pbf (19.4MiB)        | `osmar 53.076 8.807 50 'shop=*'`   | i5-8250U (4x1.6GHz)         | ~0.20s | ~70MiB  |\n| bremen-latest.zstd.osm.pbf (19.4MiB)        | `osmar 53.076 8.807 50 'shop=*'`   | AMD Ryzen 5 3600 (6x4.2GHz) | ~0.09s | ~140MiB |\n| czech-republic-latest.osm.pbf (828MiB)      | `osmar 49.743 13.379 200 'shop=*'` | i5-8250U (4x1.6GHz)         | ~7s    | ~320MiB |\n| czech-republic-latest.osm.pbf (828MiB)      | `osmar 49.743 13.379 200 'shop=*'` | AMD Ryzen 5 3600 (6x4.2GHz) | ~2.9s  | ~600MiB |\n| czech-republic-latest.zstd.osm.pbf (847MiB) | `osmar 49.743 13.379 200 'shop=*'` | i5-8250U (4x1.6GHz)         | ~5s    | ~350MiB |\n| czech-republic-latest.zstd.osm.pbf (847MiB) | `osmar 49.743 13.379 200 'shop=*'` | AMD Ryzen 5 3600 (6x4.2GHz) | ~2.5s  | ~650MiB |\n\nPS: Previously osmar accessed a PostgreSQL database. This was much\nfaster and had some other benefits, but the database was annoying to set\nup, so I abandoned this approach. You can find this version of osmar here:\n[github.com/codesoap/osmar/tree/v2](https://github.com/codesoap/osmar/tree/v2)\n","funding_links":[],"categories":["Go","\u003ca name=\"data-management\"\u003e\u003c/a\u003eData management"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesoap%2Fosmar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesoap%2Fosmar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesoap%2Fosmar/lists"}