I have managed to extract some highway types out of an .osm file and when I display it in Quantum GIS it splits it into lines, points and polygons. Being roads I only need lines, but with points checked, I get thousands of points across the map.

I have had a look and Quantum GIS reads type=polygon or type=line etc. Is there anyway to only include type=line when extracting data through osmosis?

asked 20 Jun '12, 11:29

stuart576's gravatar image

stuart576
71225
accept rate: 0%


I'm not an osmosis expert but checking quickly the detailed usage on the wiki says that you can filter ways on a tag list ("--tag-filter") with the option 'accept-ways'.

Example from the wiki:

osmosis \
  --read-xml input.osm \
  --tf accept-ways highway=* \ 
  --tf reject-ways highway=motorway,motorway_link \
  --tf reject-relations \
  --used-node \
  --write-xml output.osm
permanent link

answered 20 Jun '12, 12:49

Pieren's gravatar image

Pieren
9.7k2075157
accept rate: 15%

have tried adding --tf reject-ways type=point,polygon to my script but it makes no difference

(20 Jun '12, 13:26) stuart576
2

Right I have solved this, after reading up on nodes and ways.

"...a node will normally have at least one tag to define it's purpose or be part of a Relation and may have multiple tags."

From this I realised that the points were only relations to highway tags. So I added "--tf reject-relations" and voila!

Thanks for the guidance Pieren.

(20 Jun '12, 13:35) stuart576

@stuart576, I'm having trouble with this. Can you update with the complete solution that worked for you?

(07 Oct '15, 02:25) mkirk
Your answer
toggle preview

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:

×219
×49
×8

question asked: 20 Jun '12, 11:29

question was seen: 4,017 times

last updated: 07 Oct '15, 02:25

powered by OSQA