Skip to content

A command line tool for reading OpenStreetMap XML data into a SQLite database.

License

Notifications You must be signed in to change notification settings

osmzoso/osm2sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osm2sqlite

A simple command line tool for reading OpenStreetMap XML data into a SQLite database.

Usage:
osm2sqlite SQLITE_DATABASE OSM_XML_FILE [OPTION]...

Options:
  rtree         Add R*Tree indexes
  addr          Add address tables
  graph         Add graph table
  noindex       Do not create indexes (not recommended)

When OSM_XML_FILE is -, read standard input.

The command

osm2sqlite output.db input.osm

reads the OSM XML file input.osm and creates in the database output.db the tables.

Some options can be used to create additional data.

The tables are described in the documentation.

OSM data can be obtained from a provider such as Geofabrik.

Download the latest version

Miscellaneous

There are two programme versions:

  • a version in Python as a prototype (./src_py)
  • a version in C (./src)

Time measurement for saarland.osm (700 MB):
Python : 2 minutes 36 seconds
C : 47 seconds


Compiling the C version on Linux:

make
sudo make install

see also file cross_compile_windows.sh.