Chapter 9. Geometry relationships
This chapter covers
- Bounding boxes
- Intersections
- Relationships
- The meaning of equality
- The Dimensionally Extended 9-Intersection Matrix (DE-9IM)
As the old saying goes, “No man is an island,” and the same holds true for geometries. In prior chapters, we described geometries in isolation. Going forward, we’ll no longer entertain ourselves with one geometry at a time. The richness and power of spatial queries come to light when you start working with more than a singleton.
If we liken geometries to tables, an SQL query that queries a single table can only go so far. It’s when you have join operations at your disposal that things become interesting. Mastering join operations is what separates the casual database user from the serious database analyst. Spatial databases have a similar jumping-off point: The casual consumer of a spatial database may use PostGIS to store geometry data or to filter geometries befitting certain conditions. The serious spatial database analyst will be able to write queries that join and morph multiple geometries to solve seemingly intractable problems with brisk elegance.