Pbf2sqlite: Reading OpenStreetMap into a SQLite Database

原始链接: https://github.com/osmzoso/pbf2sqlite

A simple command line tool for reading OpenStreetMap .osm.pbf files into a SQLite database.Usage: pbf2sqlite DATABASE [OPTION ...] Options: read FILE Reads .osm or .osm.pbf FILE into the database rtree Add R*Tree indexes addr Add address tables graph Add graph table 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 Hacker News thread discusses using Pbf2sqlite to import OpenStreetMap data into SQLite databases. A key question raised is whether SQLite offers GIS capabilities similar to PostGIS for PostgreSQL. Several commenters suggest alternatives and solutions: Spatialite is mentioned as a potential solution for GIS functionality within SQLite. Another commenter points out SQLite's built-in R*tree module for efficient bounding box lookups, while noting that advanced GIS calculations would require custom function implementation. Finally, DuckDB is suggested as an alternative database with built-in GIS capabilities if SQLite proves insufficient for specific needs. MotherDuck's blog post is linked as a resource for getting started with GIS in DuckDB.
相关文章

原文

A simple command line tool for reading OpenStreetMap .osm.pbf files into a SQLite database.

Usage:
pbf2sqlite DATABASE [OPTION ...]

Options:
  read FILE    Reads .osm or .osm.pbf FILE into the database
  rtree        Add R*Tree indexes
  addr         Add address tables
  graph        Add graph table
pbf2sqlite test.db read country.osm.pbf

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

联系我们 contact @ memedata.com