[gdal-dev] how to use osm files

Frederik Ramm frederik at remote.org
Fri Mar 19 10:41:15 EDT 2010


Christoph Dohmen wrote:
> I trying to find out a way to deal with osm files using ogr.
> Am I right that there is no direct support?

What format would you like to convert OSM into?

> There are ready converted shape files out in the web to download
> but there is only one describing attribute set. So this is also
> not really usable :-(

Can you say again what exactly is unsuitable about the existing shape files?

The problem with conversion from OSM into many other formats, including 
shape files, is that OSM supports unlimited attributes and the 
destination file will often only support a pre-defined number of 
attributes so you have to write some rules. osm2pgsql contains such 
rules but you might want to adapt them; pre-made shapefiles are using 
such rules as well. There is no "standard" way to convert an OSM file 
into a shapefile.

> Last try was using the osm2shp utility found at osm svn. But the
> tool creates files larger than 2GB and stops working.

There is also a shapefile creator named osmexport at rubyforge, and 
vizure.net claims to generate shape files on the fly. But in all cases 
(even if you go the osm2pgsql route) you will have to select layers or 
regions otherwise you'll get more data than a shape file can handle.

You can use the Osmosis tool to cut an area from an OSM file.


More information about the gdal-dev mailing list