pbf

OpenStreetMap PBF golang 解析器。「OpenStreetMap PBF golang parser」

Github星跟蹤圖

pbf

OpenStreetMap PBF golang encoder/decoder

Build Status
Go Report Card
Documentation
codecov.io
License

A golang based OpenStreetMap PBF encoder/decoder with a handy command line utility, pbf.

pbf Command Line Utility

The pbf CLI can be installed using the go install command:

$ go install m4o.io/pbf/cmd/pbf

pbf info

The pbf CLI can be used to obtain summary and extended information about an
OpenStreetMap PBF file:

$ pbf info -i testdata/greater-london.osm.pbf
BoundingBox: [-0.511482, 51.28554, 0.335437, 51.69344]
RequiredFeatures: OsmSchema-V0.6, DenseNodes
OptionalFeatures: 
WritingProgram: Osmium (http://wiki.openstreetmap.org/wiki/Osmium)
Source: 
OsmosisReplicationTimestamp: 2014-03-24T21:55:02Z
OsmosisReplicationSequenceNumber: 0
OsmosisReplicationBaseURL: 

JSON output can be obtained by adding the -j option:

$ pbf info -j -i testdata/greater-london.osm.pbf, jq
{
  "BoundingBox": {
    "Left": -0.511482,
    "Right": 0.33543700000000004,
    "Top": 51.69344,
    "Bottom": 51.285540000000005
  },
  "RequiredFeatures": [
    "OsmSchema-V0.6",
    "DenseNodes"
  ],
  "OptionalFeatures": null,
  "WritingProgram": "Osmium (http://wiki.openstreetmap.org/wiki/Osmium)",
  "Source": "",
  "OsmosisReplicationTimestamp": "2014-03-24T14:55:02-07:00",
  "OsmosisReplicationSequenceNumber": 0,
  "OsmosisReplicationBaseURL": ""
}

Here, jq is used to pretty print the compact
JSON.

Extended information about the OpenStreetMap PBF file can be obtained
by using the -e option. This causes the entire file to be scanned, which can
take a very long time; a progress bar is displayed on stderr.

$ pbf info -e -i testdata/greater-london.osm.pbf
BoundingBox: [-0.511482, 51.28554, 0.335437, 51.69344]
RequiredFeatures: OsmSchema-V0.6, DenseNodes
OptionalFeatures: 
WritingProgram: Osmium (http://wiki.openstreetmap.org/wiki/Osmium)
Source: 
OsmosisReplicationTimestamp: 2014-03-24T21:55:02Z
OsmosisReplicationSequenceNumber: 0
OsmosisReplicationBaseURL: 
NodeCount: 2,729,006
WayCount: 459,055
RelationCount: 12,833

Finally, pbf can read an OpenStreetMap PBF file from stdin:

$ cat testdata/greater-london.osm.pbf, pbf info -e

In this case, a progress bar is not displayed since there is no way to know,
a priori, what the size of the PBF file is.

主要指標

概覽
名稱與所有者maguro/pbf
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證Apache License 2.0
所有者活动
創建於2017-09-18 23:13:18
推送於2025-01-15 01:22:47
最后一次提交2025-01-14 17:08:43
發布數3
最新版本名稱v1.1.0 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數52
關注者數4
派生數8
提交數128
已啟用問題?
問題數3
打開的問題數2
拉請求數5
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?