Chapter 11. Geometry and geography processing

 

This chapter covers

  • Spatial aggregation
  • Clipping, splitting, tesselating, and segmentizing
  • Translating, scaling, and rotating geometries (affine operations)
  • Using geometry functions with geography types

This chapter demonstrates techniques for manipulating geometries and geographies, and the end result is generally another geometry or geography. Unless we tell you otherwise, all functions that we demonstrate in this chapter work with both data types.

Through the years, we’ve amassed a catalog of problems that GIS users encounter, and in this chapter we’ll share with you the most common problems and our solutions. Keep in mind that multiple solutions exist for a given problem. We by no means proclaim that our solutions trump all other solutions. In fact, if enough people run into a problem that can be generalized, PostGIS could very well introduce a wrapper function that will resolve the problem with a single call.

The data and code used in this chapter are located here: www.postgis.us/chapter_11_edition_2.

11.1. Using spatial aggregate functions

Aggregation is the process of rolling up several rows of data into one. For any table, aggregation begins by segregating the columns into those that you group by and those that you don’t. SQL finds like values across your group-by columns and creates distinct groups. It must then apply an aggregate function to roll up the non-group-by columns, summing them, averaging them, and so on.

11.2. Clipping, splitting, tessellating

11.3. Breaking linestrings into smaller segments

11.4. Translating, scaling, and rotating geometries

11.5. Using geometry functions to manipulate and create geographies

11.6. Summary

sitemap