In chapter 2 we walked through all the possible geometry, geography, and raster types PostGIS offers and how you can create and store them. In this chapter we’ll continue our study by demonstrating the different table layouts you can design to store spatial data. Then we’ll apply these various design approaches to a real-world example (Paris, France). We’ll finish the chapter with a discussion and examples of using views for database abstraction and using triggers to manage inserts and updates in tables and views. Our main focus will be the geometry type, which is still the most commonly used type in PostGIS.
You can download all the data and code for this chapter at www.postgis.us/chapter_14_edition_3. Before we start, you’ll need to load the ch14_data.sql and ch14_staging_data.sql scripts from the chapter download file.