--- path: docs/spatial-sql-book title: Spatial SQL with PostGIS and SedonaDB desc: Twenty-five lessons on spatial SQL, written against a live PostGIS cluster and 440 million OSM features. --- # Spatial SQL with PostGIS and SedonaDB Twenty-five lessons, written against a live PostGIS 3.6 cluster and a planet-scale OSM import. Every query on these pages is one you can run yourself. The first 4 lessons are open. The rest continue in the app. | # | Lesson | | |---|---|---| | 1 | [Prerequisites: Joins and Big O](/docs/spatial-sql-book/01-prerequisites) | | | 2 | [Where Your SQL Runs](/docs/spatial-sql-book/02-where-your-sql-runs) | | | 3 | [Geometry Is a Type, Not Two Numbers](/docs/spatial-sql-book/03-geometry-as-a-type) | | | 4 | [Degrees Are Not Metres](/docs/spatial-sql-book/04-srid-degrees-metres) | | | 5 | [Reading a Schema You Did Not Write](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 6 | [Filtering, Casting and NULL Discipline](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 7 | [Aggregation and the Spatial Aggregates](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 8 | [CTEs and the Shape of a Readable Query](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 9 | [Window Functions Over Spatial Measures](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 10 | [Predicates and the DE-9IM Family](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 11 | [The && Operator and What an Index Can Answer](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 12 | [ST_DWithin, ST_Distance and the KNN Operator](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 13 | [Spatial Joins and LATERAL Nearest-Neighbour](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 14 | [Constructors, Accessors and Editors](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 15 | [Simplification, Tolerance and Broken Topology](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 16 | [Invalid, Empty and NULL Are Three Different Things](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 17 | [Querying the Feature Store](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 18 | [Raw OSM Tags as jsonb](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 19 | [H3 Hex Binning, Server-Side](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 20 | [SedonaDB: When the Table Is a File](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 21 | [Choosing an Engine, and Porting a Query](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 22 | [Why Your Query Is Slow](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 23 | [From Query to Map Layer](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 24 | [Reading What the Assistant Wrote](https://app.gisowl.com/app/register?source=site) | Sign in to read | | 25 | [What This Cluster Cannot Do Yet](https://app.gisowl.com/app/register?source=site) | Sign in to read | [Open the lessons in the app](https://app.gisowl.com/app/register?source=site)