{"id":18522610,"url":"https://github.com/astro/osm-pbf-parser","last_synced_at":"2025-07-23T16:42:52.924Z","repository":{"id":17540820,"uuid":"20343519","full_name":"astro/osm-pbf-parser","owner":"astro","description":"streaming open street maps protocol buffer parser","archived":false,"fork":false,"pushed_at":"2014-08-23T00:10:29.000Z","size":545,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T18:53:52.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"substack/osm-pbf-parser","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astro.png","metadata":{"files":{"readme":"readme.markdown","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":"2014-05-30T21:48:20.000Z","updated_at":"2022-11-24T23:43:51.000Z","dependencies_parsed_at":"2022-12-03T23:50:57.813Z","dependency_job_id":null,"html_url":"https://github.com/astro/osm-pbf-parser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/astro/osm-pbf-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fosm-pbf-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fosm-pbf-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fosm-pbf-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fosm-pbf-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astro","download_url":"https://codeload.github.com/astro/osm-pbf-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro%2Fosm-pbf-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263463887,"owners_count":23470448,"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":[],"created_at":"2024-11-06T17:32:20.557Z","updated_at":"2025-07-04T06:39:51.582Z","avatar_url":"https://github.com/astro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# osm-pbf-parser\n\nstreaming [open street maps](https://wiki.openstreetmap.org) protocol buffer\nparser\n\n[![build status](https://secure.travis-ci.org/substack/osm-pbf-parser.png)](http://travis-ci.org/substack/osm-pbf-parser)\n\n# example\n\nFirst grab a pbf torrent from\nhttp://osm-torrent.torres.voyager.hr/files/rss.xml or from http://download.geofabrik.de/\n\n``` js\nvar fs = require('fs');\nvar through = require('through2');\nvar parseOSM = require('osm-pbf-parser');\n\nvar osm = parseOSM();\nfs.createReadStream(process.argv[2])\n    .pipe(osm)\n    .pipe(through.obj(function (items, enc, next) {\n        items.forEach(function (item) {\n            console.log('item=', item);\n        });\n        next();\n    }))\n;\n```\n\nThen you can parse the results:\n\n```\n$ node parser osm.pbf | head -n15\nitem= {\n  type: 'node',\n  id: 122321,\n  lat: 53.527972600000005,\n  lon: 10.0241143,\n  tags: {},\n  info: {\n     version: 9,\n     id: 122321,\n     timestamp: 1329691614000,\n     changeset: 10735897,\n     uid: 349191,\n     user: 'glühwürmchen'\n  }\n}\nitem= {\n  type: 'way',\n  id: 108,\n  tags: {\n     created_by: 'Potlatch 0.8',\n     highway: 'living_street',\n     name: 'Kitzbühler Straße',\n     postal_code: '01217' },\n  refs: [ 442752, 231712390, 442754 ],\n  info: {\n     version: 5,\n     timestamp: 1227877069000,\n     changeset: 805472,\n     uid: 42123,\n     user: 'Ropino'\n  }\n}\nitem= {\n  type: 'relation',\n  id: 3030,\n  tags: { layer: '1', type: 'bridge' },\n  members: [\n     { type: 'way', id: 12156789, role: 'across' },\n     { type: 'way', id: 12156793, role: 'under' },\n     { type: 'way', id: 34235338, role: '' }\n  ],\n  info: {\n     version: 3,\n     timestamp: 1323359077000,\n     changeset: 10066052,\n     uid: 75154,\n     user: 'RWR'\n  }\n}\n```\n\n# methods\n\n``` js\nvar parseOSM = require('osm-pbf-parser')\n```\n\n## var stream = parseOSM()\n\nReturn a transform parser `stream` that takes a binary OSM protocol buffer\nstream as input and produces parsed objectMode rows as output.\n\n# rows\n\nEach `row` from the output stream has a `row.type`.\n\n# parallel processing\n\nThe module exposes `BlobParser` and `BlobEncoder` so that you\ndistribute binary work units for parsing. See the `pstats` example.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install osm-pbf-parser\n```\n\n# license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro%2Fosm-pbf-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastro%2Fosm-pbf-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro%2Fosm-pbf-parser/lists"}