SkillAgentSearch skills...

Pbf2sqlite

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

Install / Use

/learn @osmzoso/Pbf2sqlite
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

pbf2sqlite

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

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

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

Additional options:
  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
  sql                                                 Executes an SQL statement from stdin
  route <lon1> <lat1> <lon2> <lat2> <permit> <file>   Calculates shortest route
                                   (<permit> can be 'foot', 'bike' or 'car')

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| |----------------------------------------------------------------------------------------|

View on GitHub
GitHub Stars83
CategoryData
Updated7d ago
Forks2

Languages

C

Security Score

100/100

Audited on Mar 30, 2026

No findings