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

Hello, all,

Extracting data from the latest europe geofabrik pbf is a lengthy process. I want to extract 2 kinds of data, i.e. speed camera's and some brand's fuel stations. So to avoid spending too much time in the process, I am looking for the correct way to do so using osmosis. Could someone help me out on this ? I would think my command line should look something like

"$OSMOSIS" --read-pbf $DATAIDIR/europe-latest.osm.pbf --write-xml outPipe.1="allxml" --tee 3 --read-xml inPipe.1="allxml" --node-key-value keyValueList="highway.speed_camera" --write-xml $DATAODIR/radars.osm --read-xml inPipe.2="allxml" --node-key-value keyValueList="amenity.fuel" --write-xml outPipe.2="nafte" --read-xml inPipe.2="nafte" --tf accept-nodes brand=DATS%s24 --write-xml $DATAODIR/DATS24.osm

but I get an error "org.openstreetmap.osmosis.core.OsmosisRuntimeException: No default pipes are available as input for task 3-tee."

In short, I don't arrive at the point of understanding the correct usage of the pipes and of the --tee argument.

Could someone please explain, because despite the detailed osmosis 0.47 usage manual, I don't get at any better result than the one above. Thanks a lot in advance !

asked 19 Apr '22, 15:29

sudolea's gravatar image

sudolea
11224
accept rate: 0%


In general, if you can use osmium instead of osmosis, things will work faster. Your command line does not work because your first --write-xml already consumes the data stream created by --read-pbf and hence no data stream remains to feed into the --tee. I think if you drop the first --write-xml and all --read-xmls things might work.

permanent link

answered 19 Apr '22, 15:47

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Yes ! This works indeed. Thank you so much ! So my final command line reads :

"$OSMOSIS" --read-pbf $DATAIDIR/europe-latest.osm.pbf --tee 2 --node-key-value keyValueList="highway.speed_camera" --write-xml $DATAODIR/radars.osm --node-key-value keyValueList="amenity.fuel" --tf accept-nodes brand=DATS%s24 --write-xml $DATAODIR/DATS24.osm

Being unfamiliar with the osmium utility you suggest, and not immediately seeing the parallel osmium command I'd need to compare speeds, could I ask you how my osmosis command would (more or less) read in osmium ?

In the meantime, my "mental picture", with regard to osmosis' tee argument, is : whenever there is any write option, the next argument is the start of tee's next pipe I don't think I'm far off, am I ?

(19 Apr '22, 16:52) sudolea
1

Your logic regarding osmosis is almost correct, replace "any write option" with "any option that consumes a stream and doesn't output one again". With osmium, you would probably require several runs since you cannot AND-combine expressions, but since only the first run would consume the large Europe file and every subsequent run would only work on a small intermediate file, that should still go quite fast. See https://docs.osmcode.org/osmium/latest/osmium-tags-filter.html

(19 Apr '22, 17:51) Frederik Ramm ♦

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:

×2
×1

question asked: 19 Apr '22, 15:29

question was seen: 1,105 times

last updated: 19 Apr '22, 17:51

Related questions

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