I have been bothered with this for a while. I downloaded .osm.pbf file from the internet, it’s like 477MB. Then, I cropped it using the following command,
osmium extract -b 10,10,25,40 map.osm.pbf -o map_b.osm.pbf
and then
osmium cat map.osm.pbf -o map_b.osm
Now, map_b.osm is like 456 MB.
Then, I started to load the .osm file and to parse it using a julia package. The thing is, the mapdata I got have all the bounds parameters 0 (min_lat, max_lat, min_lon, max_lon). This is rather strange.
I have used the other way to preprocess the download .osm.pbf from the internet, and it’s a little bit better than the above osmium extract -b
, in the sense that at least the mapdata obtained has a non-zero bound.
For example, I use the following to obtain all the highways.
osmosis --read-xml map.osm --tf accept-ways highway=* --used-node --write-xml map_all_highways.osm
The thing is, this map_all_highways.osm has like 2GB. It’s a bit big.
Then, I use osmosis --read-xml map.osm --tf accept-ways highway=motorway highway=motorway_link highway=trunk highway=trunk_link highway=primary highway=primary_link highway=secondary highway=secondary_link highway=tertiary highway=tertiary_link highway=unclassified highway=residential --used-node --write-xml map_highways.osm
to obtain all the important highways. The file obtained is like 339MB. The thing is, many routing results got 0 in the end, which I need to double check more to make sure. Any suggestions? Any comments are greatly appreciated.