osm2sqlite - A programme to convert from OSM files to SQLite

written by rory, on Nov 29, 2009 7:50:00 PM.

I've created osm2sqlite, a programme to convert from OSM files (OpenStreetMap's XML file format) into a SQLite database. It's not very good for display OpenStreetMap data in a GIS programme. It's good if you want to muck around with raw OpenStreetMap data, in a familiar SQL environment.

I'm using git to store the code, you can get it here:

Sample usage:

  • Checkout the code
    git clone git:// .
  • For this example, we'll download the OSM data from Ireland.
  • Unzip the file. Currently it has to be unzipped. Support for converting bzipped files is planned.
    bunzip2 ireland.osm.bz2
  • And finally run the script to convert the OpenStreetMap file to a database called ireland.sqlite.
    ./ -o ireland-2009-11-17.osm -d ireland.sqlite

Leave a Reply