NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hey,

I am trying to filter out the following way types out of an osm.bz2-file (malta-latest.osm.bz2 from Geofrabrik): footway,path, cycleway. Until now I did this by the following command:

C:..\bin>osmosis --read-xml file="malta-latest.osm.bz2" --tag-filter accept-ways highway=footway,cycleway,path --used-node --tag-filter reject-relations --write-xml file="malta-filtered.osm.bz2"

This works as it filters the right ways, but it also includes some nodes (mostly highway=bus_stop and public_transport=*, but also some others) that shouldn't be in there (imho), because there is no (visible) connection to any of the correct ways. I don't really understand, why this is done..!?! :-( Has anyone an idea and could help me?

Thanks in advance

Chris

asked 10 Apr '14, 10:20

49North's gravatar image

49North
26113
accept rate: 0%

edited 12 Apr '14, 22:17

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273


The issue is a simple ordering problem. By specifying --used-node before you drop the relations with --tag-filter reject-relations, you get all nodes either used by one of the ways you have selected, or used by any of the relations in the file. Swap these two arguments around, and all works as expected.

permanent link

answered 12 Apr '14, 22:19

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 12 Apr '14, 22:19

1

Hey Frederik, this sounds logical and it works..! ;-) Thanks a lot!

(14 Apr '14, 08:52) 49North

Maybe you can have a closer look at osmfilter as an alternative tool.

Read its documentation in the OSM wiki.

permanent link

answered 11 Apr '14, 12:16

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Hey, thanks for your reply - i will have a look at it, but as i have to do this as an assignment while doing an further training, i am bound at osmosis in this specific case.. ;-)

(14 Apr '14, 08:56) 49North

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×252
×66

question asked: 10 Apr '14, 10:20

question was seen: 9,740 times

last updated: 14 Apr '14, 09:20

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum