Does SQLite have GIS capabilities (like PostGIS provides for Postgres), or is this storing the data as traditional database primitives?
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:
SELECT way_id
FROM rtree_way
WHERE max_lon>= 7.851 AND min_lon<= 7.854
AND max_lat>=47.995 AND min_lat<=47.996;Which is to say, yes, SQLite has geospatial operations and they’re well supported by the open source gis stack.