开发者

Using Osmosis to filter OSM XML tags

开发者 https://www.devze.com 2023-03-31 21:49 出处:网络
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 s

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 =开发者_JAVA百科 value).

Any suggestions?


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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号