Skip to content

About

A command line tool for importing OpenStreetMap PBF or XML files into a SQLite database.

Topics

Resources

Stars

84 stars

Watchers

1 watching

Forks

Latest commit

 

History

323 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pbf2sqlite

A simple command-line tool that imports PBF or XML OpenStreetMap data into an SQLite database.

Usage:
pbf2sqlite <database> [OPTION ...]

Main options:
  read <file>                                         Reads an .osm.pbf or .osm file
  index                                               Add basic indexes
  rtree                                               Add R*Tree indexes
  addr                                                Add address tables
  graph                                               Add graph tables

Options for displaying data:
  node <id>                                           Show data of a node
  way <id>                                            Show data of a way
  relation <id>                                       Show data of a relation
  vaddr <lon1> <lat1> <lon2> <lat2> <htmlfile>        Generates a map of the addresses
  vgraph <lon1> <lat1> <lon2> <lat2> <htmlfile>       Generates a map of the graph
  sql [<stmt>]                                        Executes an SQL statement

Calculate shortest path (<permit> can be: foot bike roadbike car):
  route <permit> <lon1> <lat1> <lon2> <lat2> [<lon3> <lat3> ...] <file>

The command

pbf2sqlite test.db read country.osm.pbf

reads the OSM PBF file country.osm.pbf and creates in the database test.db the tables.

The tables created are described in the documentation.

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

The vgraph option creates a zoomable map of the graph:

Example vgraph

The vaddr option creates a zoomable map of the addresses:

Example vaddr

The SQLite and the readosm libraries are used for this program.

See also notes on compilation.

Download the latest version

About

A command line tool for importing OpenStreetMap PBF or XML files into a SQLite database.

Topics

Resources

Stars

84 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages