Spatial Data Analysis

So far, we have learned how to store geospatial data in a PostGIS database. In fact, any database management system can do that; spatial information can be encoded and stored in an ordinary DBMS-friendly format, be it blob, byte array, or text-based exchange format. What makes the spatial database special (and the PostGIS extension worth installing) is the rich toolset designed for analyzing, transforming, validating, querying, and extracting metrics from spatial information. In this chapter, we will learn how to harness the power of PostGIS spatial functions to gain meaningful insights from geodata. We will focus on the following topics:

  • Composing and decomposing geometries
  • Spatial measurement
  • Geometry bounding boxes
  • Geometry simplification
  • Geometry validation
  • Intersecting geometries
  • Nearest feature queries

The example queries used in this chapter mostly use geometries created by hand, using geometry composition functions. For a few examples, the OSM data in osm2pgsql schema and Natural Earth data imported in Chapter 1, Importing Spatial Data, are used, but only the column and table names are specific; the queries can be adjusted to any other dataset, provided that the geometry type is the same.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset