使用 Osmosis 过滤 OSM XML 标签

发布于 2024-12-01 23:33:28 字数 614 浏览 1 评论 0原文

我正在处理 .osm 文件,并尝试根据标签过滤实体。我需要仅查看包含源标签和归因标签的实体。我使用以下内容仅成功过滤了所有源标签:

osmosis --read-xml file = "northern_ireland.osm" --way-key-value keyValueList="source" --used node --write-xml northern_ireland_source.osm

从另一个教程中,我注意到我需要使用管道:http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.38

所以我做了以下操作:

osmosis --rx northern_ireland.osm --accept-ways source=* outPipe.0 = SOURCE

然而,在尝试这样的代码中,我收到语法错误,指出:参数在“=”之前不包含名称(即名称 = 值)。

有什么建议吗?

I am working with .osm files and am trying to filter entities based on tags. I need to view only entities containing both source and attribution tags. I used the following to successfully filter all source tags only:

osmosis --read-xml file = "northern_ireland.osm" --way-key-value keyValueList="source" --used node --write-xml northern_ireland_source.osm

From another tutorial, I've noticed that I would need to use a pipe: http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.38

So I did the following:

osmosis --rx northern_ireland.osm --accept-ways source=* outPipe.0 = SOURCE

However, upon trying such code, I get a syntax error stating: Argument does not contain a name before the '=' (i.e. name = value).

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑶笙 2024-12-08 23:33:28

首先,“=”前后可能没有空格:

outPipe.0=SOURCE

第二个 IIRC outPipe.0 是 --rx 的参数:

osmosis --read-xml file="northern_ireland.osm" outPipe.0="SOURCE" \
--tf accept-ways source=* inPipe.0="SOURCE" outPipe.0="step1" \
--tf accept-ways attribution=* inPipe.0="step1" outPipe.0="step2" \
--write-xml file="northern_ireland_source.osm" inPipe.0="step2"

可能有效。
但它没有经过测试。
自从我使用那根管道以来已经有一段时间了;)

first there may not be an space before and after the "=":

outPipe.0=SOURCE

second IIRC outPipe.0 is an argument of --rx:

osmosis --read-xml file="northern_ireland.osm" outPipe.0="SOURCE" \
--tf accept-ways source=* inPipe.0="SOURCE" outPipe.0="step1" \
--tf accept-ways attribution=* inPipe.0="step1" outPipe.0="step2" \
--write-xml file="northern_ireland_source.osm" inPipe.0="step2"

that may work.
but it isn't tested.
its a little time ago since i used that pipes ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文