8 Spatial 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 spatial objects. In prior chapters we described geometries and rasters in isolation. Going forward, we’ll no longer entertain ourselves with one geometry at a time or one raster 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 spatial objects 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 and rasters to solve seemingly intractable problems with brisk elegance.

8.1 Bounding box and geometry comparators

8.1.1 The bounding box

8.1.2 Bounding box comparators

8.2 Relating two geometries

8.2.1 Interior, exterior, and boundary of a geometry

8.2.2 Intersections

8.2.3 A house plan model

8.2.4 Contains and within

8.2.5 Covers and covered by

8.2.6 Contains properly

8.2.7 Overlapping geometries

8.2.8 Touching geometries

8.2.9 The faces of equality: geometry

8.2.10 Underpinnings of relationship functions

Summary

sitemap