I am trying to obtain few old osm dataset of few specific countries/regions to see subsequent changes till now. I am using planet osm files which I think is the only source of old osm archieves. But after extraction planet osm file it's taking aroung 350GB enormous space. Although there is Osmfilter to extract specific tags, but I want to extract specific countries and regions instead. I have already tried QGIS, Linus-Terminal and PostgreSQL in order to do something further but this huge file is rather killing them. Any help regarding how to proceed?
I would like to explain the steps followed by me.
- Download any archieved planet osm file from Planet.OpenStreetMap.org
- Make the .poly file covering the area you want to clip from planet.osm file. Follow tips regarding how to make .poly file from here. I personally have used this QGIS tutorial. Note: QGIS installed osmpoly_export plugin is located under Vector tab, rather than Plugins.
- Install osmosis, if not already. Use
sudo apt-get install osmosison ubuntu.
- Clip desired area based upon .poly file from planet.osm file. Use this code
osmosis --read-xml file="planet-latest.osm" --bounding-polygon file="country.poly" --write-xml file="australia.osm". Details here.
- If want to extract specific tags, labels etc. then use
osmfilter. Install it from
Ubuntu Software Center.
- Extract desired tags etc. as explained here. One sample code on ubuntu
$ osmfilter streets_old.osm --keep="highway=primary" > streets_new.osm
There are various services offering country and area extracts. You can try to get into contact with one of the responsible people and ask how they are doing it. There is also a similar question at help.openstreetmap.org.
Geofabrik offers some background information with technical details and also provides .poly files which you can use for osmosis/osmconvert.