Re:Pbf2sqlite: Reading OpenStreetMap into a SQLite Database
by Scaevolus on Tuesday July 01, 2025 @05:14PM
(#44438060)
SQLite can be built with the R*tree module, which supports efficiently looking up all bounding boxes that contain a point: https://www.sqlite.org/rtree.html
PostGIS similarly provides an R*Tree index mode, as well as a heap of functions for doing GIS calculations directly. To do that in SQLite, you'd implement and inject custom functions as appropriate.
Re:Pbf2sqlite: Reading OpenStreetMap into a SQLite Database
by juliansimioni on Thursday July 03, 2025 @02:37PM
(#44457979)
This is super cool. As part of the Pelias geocoder(https://pelias.io/) we use both OSM and SQLite heavily. Currently we've written our own pbf2json tool in Golang (https://github.com/pelias/pbf2json). But creating intermediate databases in SQLite could enable more powerful manipulation of OSM data before we eventually import it.
Re:Pbf2sqlite: Reading OpenStreetMap into a SQLite Database
by tjridesbikes on Thursday July 03, 2025 @10:28PM
(#44460658)
This is AWESOME! I'm doing some volunteer work to make a map of cycling routes in my city, and using OSM data to annotate features. Having a SQLite db of all the Way tags would make my work a lot easier! Thanks!
https://motherduck.com/blog/getting-started-gis-duckdb/
PostGIS similarly provides an R*Tree index mode, as well as a heap of functions for doing GIS calculations directly. To do that in SQLite, you'd implement and inject custom functions as appropriate.
There's an option to enable RTree indexes to speed up queries like this one:
Which is to say, yes, SQLite has geospatial operations and they’re well supported by the open source gis stack.