{"id":34160963,"url":"https://github.com/codesoap/pbf","last_synced_at":"2026-02-25T23:17:29.917Z","repository":{"id":332381565,"uuid":"865261750","full_name":"codesoap/pbf","owner":"codesoap","description":"A fast and simple library for reading OSM entities directly from PBF files","archived":false,"fork":false,"pushed_at":"2024-10-04T11:08:08.000Z","size":42,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T18:22:11.680Z","etag":null,"topics":["high-performance","open-street-map","osm","parser","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-30T08:46:39.000Z","updated_at":"2025-10-04T09:33:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codesoap/pbf","commit_stats":null,"previous_names":["codesoap/pbf"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/codesoap/pbf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fpbf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fpbf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fpbf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fpbf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesoap","download_url":"https://codeload.github.com/codesoap/pbf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesoap%2Fpbf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: 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":["high-performance","open-street-map","osm","parser","pbf"],"created_at":"2025-12-15T08:47:19.141Z","updated_at":"2026-02-25T23:17:29.912Z","avatar_url":"https://github.com/codesoap.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a library for extracting OSM entities from PBF files. It is\nintended to be used for simple one-off tasks, searching an area of\nno more than a few square kilometers, where setting up a PostgreSQL\ndatabase would be a disproportionate effort.\n\nIt performs reasonably well when working with\nOSM extracts, such as the ones obtained from\n[download.geofabrik.de](https://download.geofabrik.de/). With modest\nhardware (e.g. an old ThinkPad T480) PBF files can be read at roughly\n80MiB/s to 300MiB/s. When reading through an extract of the Czech\nRepublic (828MiB), roughly 320MiB of RAM are used (but this will depend\non the amount of cores on your CPU).\n\nPerformance can be improved, by changing the compression\ninside PBF files to zstd. This can be done with the [zstd-pbf\ntool](https://github.com/codesoap/zstd-pbf).\n\nFind the full documentation of this library at\n[godocs.io/github.com/codesoap/pbf](https://godocs.io/github.com/codesoap/pbf).\n\n# Example\n```go\nfilter := pbf.Filter{\n\tLocation: func(lat, lon int64) bool {\n\t\t// A square filter matching the city center of Bremen, Germany.\n\t\treturn lat \u003e= 53_071_495_496 \u0026\u0026\n\t\t\tlat \u003c= 53_080_504_504 \u0026\u0026\n\t\t\tlon \u003e= 8_799_510_372 \u0026\u0026\n\t\t\tlon \u003c= 8_814_489_628\n\t},\n\tTags: map[string][]string{\n\t\t// Find bicycle shops.\n\t\t\"shop\": {\"bicycle\"},\n\t},\n}\n// wget https://download.geofabrik.de/europe/germany/bremen-latest.osm.pbf\nresults, err := pbf.ExtractEntities(\"/tmp/bremen-latest.osm.pbf\", filter)\nresultCount := len(results.Nodes) + len(results.Ways) + len(results.Relations)\nfmt.Printf(\"Found %d bicycle shop(s) in the center of Bremen.\\n\", resultCount)\n```\n\n# Development setup\nTo generate some protobuf related code, you need the `protoc` tool, the\n`protoc-gen-go` tool and the `protoc-gen-go-vtproto` tool; the latter\ntwo can be installed like this:\n\n```\ngo install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2\ngo install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@v0.6.0\n```\n\n# Ideas for the Future\nFor now, ways and relations will be incomplete, if they only partially\nlie within the location filter or their members didn't match the tag\nfilter. This is undesirable, for example, when trying to render an\nextracted area as an image. Thus it would be useful to have a flag that\nmakes the library return \"ancillary entities\". An idea for the interface\ncan be found at commit 9b673e35bd0510e4ad53a2875dcf4a7ea4ca085a.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesoap%2Fpbf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesoap%2Fpbf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesoap%2Fpbf/lists"}