【问题标题】:Filter pbf file for OpenStreetMap为 OpenStreetMap 过滤 pbf 文件
【发布时间】:2017-05-02 21:07:59
【问题描述】:

我想通过高速公路为OpenStreetMap 过滤PBF file。例如highways = residential。我是OpenStreetMap 的新手。我阅读了一些信息并开始使用这些工具来获得结果,它们是osmfilterosmconvertosmosis

阶段:

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

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

3) 最后,我通过 osmosis 处理过滤后的 pbf 文件

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

【问题讨论】:

    标签: openstreetmap osmosis osmfilter


    【解决方案1】:

    osmosis 可以读取 XML 和 PBF 文件。只需对 PBF 文件使用 --read-pbf,对 XML 文件使用 --read-xml

    也可以考虑改用osmium-tool。请参阅manual 获取filtering by tags

    【讨论】:

      猜你喜欢
      • 2017-12-31
      • 1970-01-01
      • 2022-01-14
      • 2020-12-11
      • 2021-12-23
      • 2013-08-14
      • 2020-03-08
      • 2020-08-24
      • 2020-10-31
      相关资源
      最近更新 更多