How to do it...

The steps you need to do to complete this recipe are as follows:

  1. Set the PostgreSQL search_path variable such that all your newly created database objects will be stored in the chp03 schema, using the following code:
      postgis_cookbook=# SET search_path TO chp03,public; 

 

 

  1. Suppose you need a less-detailed version of the states layer for your mapping website or to deploy to a client; you could consider using the ST_SimplifyPreserveTopology function as follows:
      postgis_cookbook=# CREATE TABLE states_simplify_topology AS 
        SELECT ST_SimplifyPreserveTopology(ST_Transform(          the_geom, 2163), 500) FROM states;
  1. The previous command works quickly, using a variant of the Douglas-Peucker algorithm, and effectively reduces the vertex ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.