Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a straightforward way to download data from OpenStreetMap (OSM)?

Using North America as an example, I realize Cloudmade (http://downloads.cloudmade.com/north_america) and geofabrik (http://download.geofabrik.de/osm/north-america/) both provide downloads, but the files are enormous (0.5gb - 4gb). I've also tried using the QGIS-OSM toolbar but I have not had much luck doing this, as similar to the OSM website the area you can select is very small. The amount of data I want to download is at the city level.

Finally, is there an easy of using OSM data? If I choose to download OpenStreetMap XML Data I can't open the osm.xml files using QGIS (even using the QGIS-OSM toolbar import function). I wonder if I'm missing a more obvious way of dealing with the data.


I just want to point out the very useful StackExchange clone for help with OSM related issues! http://help.openstreetmap.org/

share|improve this question
1  
but the files are enormous?? (0.5gb - 4gb) not in the GIS world - 5TB+ is getting normal –  Mapperz Mar 8 '11 at 19:56
    
sorry - enormous for my puny machine. Not so much 0.5gb, but 4gb is unmanageable for me! –  djq Mar 9 '11 at 9:45
    
Have explored this a little more, I find the data provided by geofabrik more comprehensive than cloudmade. –  djq Mar 24 '11 at 14:31
    
But both are missing lots of detail! –  djq May 3 '11 at 15:57
1  
@Nathanus I confess I just signed up..... It's true, but it really is focusing on every little detail about OSM many of which are programming related, and not specific to GIS. Though if subsites of subsites existed it would be perfect. The fonts over here are so much crisper! –  djq May 4 '11 at 18:09

6 Answers 6

up vote 22 down vote accepted

JOSM

Perhaps the easiest answer to both parts of your question, is to use JOSM. The Java OpenStreetMap Editor. It's easy to download data, and easy to "use" data.

For downloading, JOSM provides a simple interface to let you select a rectangular area to download, however it downloads this via the editing API. This will reject any request which is way too big, and if it's a little bit too big it will spend a long time thinking about it. Generally a whole city is way too big, but you might be able to get a good a chunk of data by requesting several rectangular areas.

For "using" the data JOSM lets you see the data and have a good poke around in all the tags. The search feature is quite powerful, allowing you to select elements with particular tags, but beyond that it really depends what kind of "use" you have in mind. You can configure the way JOSM displays the data to some extent, but for nice looking maps you'd probably want to look at rendering tools designed to work with OSM files. You can also look at conversion e.g. to shapefile, but bare in mind the data is ...different ...to what you might be used to, so this conversion is always a bit lossy.

As an aside... Although it's reasonably nice data viewer, the primary purpose of JOSM is to be an OpenStreetMap editor. Just click 'upload' to send changes back to OpenStreetMap (you'll need to create an OpenStreetMap account) If you didn't try OpenStreetMap editing yet, you really should. Anyone with even a passing interest in maps should give this a go. Add your local restaurant to the map or something like that. It's the only way to get a proper understanding of OpenStreetMap, and it's fun!

Bigger files

What if a city is too big to load into JOSM? There's some other options (as follows) but when you're dealing with this amount of data there's no escaping the fact that it's going to be a little bit difficult to "use". You're really out of the realm of fun little GUI tools and into big data GIS. The easiest entry to this (which is not all that easy) would probably be to load a large .osm file into PostGIS database using osm2pgsql, and then use GIS desktop tools to view it.

Metro extracts

A new option is the Metro Extracts download service, which offers ready-made downloads for some world cities.

Osmosis

If you need a different city or different bounding box, then you need to get one of the massive downloads you mentioned (either a country extract, or the whole planet) and then extract a piece out of it.

osmosis is the most widely used tool for this. It's a java command line tool letting you extract a bounding box on the unix command line with something like this:

bzcat downloaded.osm.bz2 | osmosis\
  --read-xml enableDateParsing=no file=-\
  --bounding-box top=49.5138 left=10.9351 bottom=49.3866 right=11.201 --write-xml file=-\
  | bzip2 > extracted.osm.bz2

This shows how you would typically avoid filling your disk with bloated XML data by uncompressing a .bz2 file, piping the output into osmosis and then piping the resulting XML into a bzipped file again.

So maybe this is not fitting with your definition of "easy", but osmosis is a worthwhile tool to get the hang of if you're interested in manipulating big .osm files. You just have to figure out the right command! (good topic for another question I guess)

share|improve this answer
    
I have used JOSM - it's very nice. However, I'm interested in large amounts of data, usually an entire city which I can't do within it. –  djq Aug 18 '11 at 11:10
    
I've extended by answer to go into some of the options for working with larger files. Not as easy unfortunately, but hope that helps. –  Harry Wood Mar 2 '12 at 13:30
    
Thanks @Harry. I ended up using osmosis on linux and it worked fine. I currently want to use this setup on Win 7 and I'm excited to see there is a .exe of bzcat. Last time I checked there wasn't. Unfortunately there does not seem to be an easy way of using osm2pgsql on Windows, otherwise that would be my ideal choice. –  djq Mar 2 '12 at 15:56

The simple answer is no there is no quick and easy way to do this. If you want city level data for the whole of North America it will be a huge file. If you want a smaller area then CloudMade do state by state files. You can see my notes on the process at http://ian01.geog.psu.edu/geoserver_docs/data/openstreetmap/osm.html but I didn't have much fun. I started to look at Osmosis (http://wiki.openstreetmap.org/wiki/Osmosis) but ran out of time before I got it to do much but it may be a solution to your problem.

As for using OSM data you can either go for their non standand/ neogeogrpahy approach and use mapnik etc or import the data into PostGIS and make it work in some proper GIS tools.

share|improve this answer

Downloading OSM with QGIS on Demand

enter image description here

http://mapperz.blogspot.com/2009/11/openstreetmap-data-on-demand-with.html

share|improve this answer
2  
+1 Wow that was prescient! You answered this question 16 months before it even appeared :-). –  whuber Mar 8 '11 at 20:39
1  
I have a Flux Capacitor en.wikipedia.org/wiki/DeLorean_time_machine#Flux_capacitor –  Mapperz Mar 9 '11 at 15:29
    
Just a note on this - it does work on the current release of QGIS that I am using (1.7), but it only allows very small areas to be downloaded. –  djq May 3 '11 at 20:56
    
quote from Mapperz blog "The data has been downloaded directly from the Open Street Map Servers [most up to date data]. **There are area limitions controlled by OpenStreetMap Servers, the plugin will warn you of this issue if required" –  Mapperz May 3 '11 at 21:18
    
@celenius: the size limit is there because this OSM Web service is intended for mapping purposes (i.e. downloading small areas, editing them and uploading back). Using it just for read-only purposes is generally frowned upon because it burdens the already overstretched OSM infrastructure. –  Igor Brejc Aug 18 '11 at 10:53

Echoing @iant's suggestion, if you are looking for just USA data, why not consider just download a state-by-state layer for your particular area of interest from Cloudmade? And if your area of interest is a can be just a couple of state's worth of data, the simplest way of using the data would be to download the shapefile extracts (State of Oregon example) which you can use in virtually any common GIS program.

share|improve this answer

Probably the easiest and cleanest way to download OSM data for arbitrary map area would be to use one of OSMXAPI servers. OSMXAPI API is intended to be used for read-only access to the geo. data (unlike the primary OSM API which is oriented towards editing). It also allows downloading of larger areas than the primary API.

One of the ways to access OSMXAPI is to use the Export tab at http://www.openstreetmap.org/ (choose "OpenStreetMap XML Data" radio button).

share|improve this answer
    
Do you have a recommended server? I tried a few and got timeout errors (I think). I've since been working with a copy of the entire globe on a local computer. –  djq Aug 18 '11 at 12:27
    
I usually use this one: open.mapquestapi.com/xapi/api/0.6 . –  Igor Brejc Aug 18 '11 at 13:46

The company WeoGeo now enable free downloads of OpenStreetMap data. You can sketch an outline of the area that you want data for and a file is generated.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.