I'm using osmfilter for the first time to filter to a .osm file containing only railway=station nodes. It increases the output file tenfold. I downloaded great-britain-latest.osm.pbf (~1.2Gb) from Geofabrik Converted it to .o5m using:
(~2.5Gb)
(~23 Gb!) Taking ~5mins to complete. It's too large to open. I'm expecting a file of about 1.8Mb as from Overpass. I've read the help documentation, can't see anything obvious. What am i doing wrong? asked 09 Nov '20, 00:53 DaveF |
Looks like osmfilter put all the data into the output file, not only the railway nodes. A 10x factor compared to the .pbf file is about what's expected in that case. I am using osmium for these kinds of things (I am the author, so that's no wonder...). You don't need the intermediate o5m file and the whole thing is faster:
answered 09 Nov '20, 08:11 Jochen Topf 1
Thanks, but unfortunately it doesn't run on Windows, unless I've missed some documentation(?). I've also tried Osmosis, (osmosis --rbf great-britain-latest.osm.pbf --nkv keyValueList="railway.station" --wx railway_station.osm ) which worked, but took 4 times as long (65 secs) to complete as using Overpass. It surprises me that a remote server was much quicker than a local drive. Given the info I provided above, is this the expected time for such a routine?
(09 Nov '20, 12:25)
DaveF
Osmium runs on Windows. But there are no prepacked binaries. So you have to compile it yourself. The 65 secs for Osmosis sounds abound right. Osmosis has to read all the data and throw most of it away, that takes a lot of time. Overpass doesn't have to do this, because it has a specialized database behind it with indexes. (Osmium still has to do the same work as Osmosis, but will be noticably faster.)
(09 Nov '20, 13:30)
Jochen Topf
Are there any instructions on how/what to compile or know if anyone has completed the task?
(09 Nov '20, 15:56)
DaveF
|
May be the issue is here: https://wiki.openstreetmap.org/wiki/Osmfilter#Keep_specific_Object_Type (looks like you need additional filters, either a --keep= before or --keep-ways= and --keep-relations= after).