PostGIS & databases
Spatial data in Postgres: connecting, querying, and writing results back.
Everything on Spatial Workflow about postgis & databases, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 16 guides in total.
2 learning paths run through this topic — follow one if you would rather work through a route than pick a single guide.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
- PostGIS Explained: When a Spatial Database Beats a Folder of Files postgis vs shapefile when to use
- How PostGIS Stores Geometry: SRID, EWKB and the Typed Column postgis geometry column srid
- Spatial SQL or GeoPandas? Choosing Where the Work Happens spatial sql vs geopandas
- PostGIS Spatial Indexes Explained: GiST and the Two-Phase Filter postgis gist spatial index
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Connect GeoPandas to PostGIS geopandas postgis connection
- How to Load and Write PostGIS Layers from PyQGIS pyqgis postgis layer
- How to Write a GeoDataFrame to PostGIS write geodataframe to postgis
- How to Run Spatial SQL Queries from Python with PostGIS spatial sql query python postgis
- How to Do a Spatial Join in PostGIS with SQL postgis spatial join sql
- How to Load a Folder of Shapefiles into PostGIS with Python load shapefiles into postgis python
- How to Read a Large PostGIS Table into Python Without Running Out of Memory read large postgis table python
- How to Update a PostGIS Table from a GeoDataFrame Without Duplicates postgis upsert geodataframe
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- PostGIS Write Fails on SRID or Geometry Type: How to Fix It postgis srid does not match column
- GeoPandas Cannot Connect to PostGIS: How to Fix It geopandas postgis connection error
- My PostGIS Spatial Query Is Slow: How to Fix It postgis spatial query slow
- PostGIS "relation does not exist" and Permission Errors: How to Fix Them postgis relation does not exist
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
Related topics
Subjects that keep coming up alongside this one, most overlap first.