The breathe of spatial functions that PostGIS provides is too large to be covered completely in any book. We invite you to explore the rich PostGIS manual to learn about all the functions. In this chapter we cover the main relationship and relationship output functions you will commonly find in PostGIS for the core spatial types geometry,geography, raster, and topogeoms. Many of these functions you will also find in other spatial databases such as Oracle Spatial/Locator, SQL Server 2008, IBM DB2 Spatial Datablade, and SQLite SpatiaLite.
We describe the fundamental OGC spatial concepts that many of these functions are founded on. Some of the functions such as ST_DWithin are particular to PostGIS, but have parallels in Oracle Locator/Spatial SDO.Within_Distance, SQL Server 2008 , and IBM DB2.
We describe DE9IM intersection matrix model that many spatial relationships are founded and are fairly standard across all spatial databases. We demonstrate an example that exercises the confusing corner cases of this model. In the hopefully entertaining example of The house with a courtyard, a walkway, the front door and courtyard greeters we explore how we can determine the orientation of these objects relative to each other by using these functions.
We are working on second edition of PostGIS in Action 2ed for availability sometime in Early 2015. Early purchase review (MEAP) is now available for Second Edition: All 17 chapters now available on MEAP with code and data download on PostGIS In Action Edition 2 Chapters. With MEAP you can get chapter updates as we write/update them and get the final polished copy at release time in both E-Book and Hard-copy form. Each purchase includes all E-Book versions including E-book version of 1st edition.
PostgreSQL: Up and Running, 1st Edition is out in both E-book and hard-copy. You can order hard-copy now from Amazon or Kindle
or hard-copy or e-Book from O'Reilly. We are hard at work on the second edition of PostgreSQL: Up and Running, 2nd addition as well. The 2nd edition is feature complete and E-book draft version is available now direct from O'reilly. Hard copy will be out 4th quarter 2014 and with focus on PostgreSQL 9.3-9.4.
© Leo Hsu and Regina Obe 2014