1

我想按高速公路过滤PBF fileOpenStreetMap例如highways = residential. 我是新手OpenStreetMap。我阅读了一些信息并开始使用这些工具来获得结果,它们是osmfilter, osmconvert,osmosis

阶段:

1) 我将 pbf 文件转换为 osm,以便在 osmconvert 中使用它。例如:osmconvert norway.pbf >norway.osm

2) 我通过 osmfilter 过滤 osm-file,得到 pbf 格式的结果文件。例如:osmfilter norway.osm.pbf --keep="highway=primary =secondary waterway=river" >streets.osm

3)最后我通过渗透处理过滤的pbf文件

我的问题是过滤的 pbf 文件是一种application/xml格式,但osmosis适用于application/octet-stream格式的 pbf 文件。如何解决?或者哪种过滤方法更好?可能我需要将application/xml格式更改为application/octet-stream. 怎么做?

4

1 回答 1

2

osmosis 可以读取 XML 和 PBF 文件。仅--read-pbf用于 PBF 文件和--read-xmlXML 文件。

或者考虑使用osmium-tool代替。请参阅按标签过滤手册

于 2017-05-03T06:29:03.867 回答