Chapter 14. Organizing spatial data
This chapter covers
- Options for structuring spatial data
- Modeling a real city
- Data abstraction with views
- Triggers on tables and views
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_2. Before we start, you’ll need to create a schema to hold data for this chapter: