Geospatial Validations Using FastAPI and PostGIS
summary
Concrete patterns for validating geodata on the backend using FastAPI + PostGIS and existing Python ORMs: load shapefiles with shape2pgsql, store geometries in PostGIS, run ST_Intersects/ST_Distance and SRID checks via SQLAlchemy + GeoAlchemy2, and enforce checks either as Pydantic validators or endpoint dependencies. The demo app returns 422 for bad points and correct neighborhoods for good ones, with code and slides linked in the repo.
AI-written summary · about
chapters (9)
- 0:00Introduction to geospatial data
- 1:07Understanding spatial concepts
- 5:01Getting started with PostGIS
- 7:10Core PostGIS functions
- 12:11Validating geospatial data
- 14:07Implementing geospatial queries
- 17:02FastAPI integration
- 20:17Live demo and validation
- 22:52Questions and answers
related talks
30mSpatial data and GeoDjango
30mGeospatial analysis made easy with PostGIS and Geoalchemy
19mThe Power of GeoDjango
02h 44mBuilding Geographical APIs with Open Data, PostgreSQL & PostGIS
24mAdding Geo into your Django
46mGetting Down To Earth: Geospatial Analysis With Rails
29mLearning FastAPI on hard-mode: getting out lots of the hardest (aw yeah, geo) data fast
26mBuilding Geospatial GraphQL APIs By Leveraging GraphQL Database Integrations
