How liammccall/giatlas works
GiAtlas lets users submit natural-language spatial queries, turns them into constrained SQL, executes them against PostGIS, and displays returned GeoJSON on a Leaflet map. A separate save flow ingests Natural Earth data; the backend also exposes dataset and image-rendering routes. The README describes an LLM router, but no router source appears in the supplied tree, so it is shown only as an external service. Relationships are limited to those visible in excerpts or documented in the README.
Main entry points: main.py API routes · util.py Spatial query access · basicdb.py Dataset access · App.tsx Query and map UI
Components 16
Map frontend
- Query and map UI
client/src/App.tsx - Leaflet rendering
client/src/App.tsx
Flask API
- API routes
webserver/src/python/main.py - GeoJSON response
webserver/src/python/main.py - Image rendering
webserver/src/python/basicplotutil.py
Query processing
- SQL translation
webserver/src/python/mlinject.py - SQL safety checks
webserver/src/python/mlinject.py
Spatial data
- Spatial query access
webserver/src/python/db/util.py - PostGIS
- Dataset access
webserver/src/python/db/basicdb.py - Shape indexing
webserver/src/python/db/stored_proc/indexing.py - Index model
webserver/src/python/db/entities/index.py
Other components
- Explorer
- LLM router
- Natural Earth
- Map tiles
Connections 21
- Explorer → Query and map UI: enters query
client/src/App.tsx - Query and map UI → API routes: posts query
client/src/App.tsx - API routes → SQL translation: requests SQL
webserver/src/python/main.py - SQL translation → LLM router: requests SQL
webserver/src/python/mlinject.py - SQL translation → SQL safety checks: checks output
webserver/src/python/mlinject.py - SQL safety checks → Spatial query access: runs query
webserver/src/python/mlinject.py - Spatial query access → PostGIS: queries
webserver/src/python/db/util.py - API routes → Dataset access: loads fallback
webserver/src/python/main.py - API routes → GeoJSON response: serializes results
webserver/src/python/main.py - Dataset access → PostGIS: reads datasets
webserver/src/python/db/basicdb.py - GeoJSON response → Query and map UI: returns GeoJSON
README.md - Query and map UI → Leaflet rendering: renders features
client/src/App.tsx - Leaflet rendering → Map tiles: loads tiles
client/src/App.tsx - API routes → Dataset access: ingests dataset
webserver/src/python/main.py - Dataset access → Natural Earth: reads source data
webserver/src/python/db/basicdb.py - Dataset access → Spatial query access: saves spatial data
webserver/src/python/db/basicdb.py - Spatial query access → PostGIS: writes data
webserver/src/python/db/util.py - Spatial query access → Shape indexing: updates index
webserver/src/python/db/util.py - Shape indexing → Index model: queries model
webserver/src/python/db/stored_proc/indexing.py - Shape indexing → PostGIS: updates index
webserver/src/python/db/stored_proc/indexing.py - API routes → Image rendering: renders image
webserver/src/python/main.py