Book Image

Mastering PostGIS

By : Dominik Mikiewicz, Michal Mackiewicz , Tomasz Nycz
Book Image

Mastering PostGIS

By: Dominik Mikiewicz, Michal Mackiewicz , Tomasz Nycz

Overview of this book

PostGIS is open source extension onf PostgreSQL object-relational database system that allows GIS objects to be stored and allows querying for information and location services. The aim of this book is to help you master the functionalities offered by PostGIS- from data creation, analysis and output, to ETL and live edits. The book begins with an overview of the key concepts related to spatial database systems and how it applies to Spatial RMDS. You will learn to load different formats into your Postgres instance, investigate the spatial nature of your raster data, and finally export it using built-in functionalities or 3th party tools for backup or representational purposes. Through the course of this book, you will be presented with many examples on how to interact with the database using JavaScript and Node.js. Sample web-based applications interacting with backend PostGIS will also be presented throughout the book, so you can get comfortable with the modern ways of consuming and modifying your spatial data.
Table of Contents (9 chapters)

Geometry simplification


In surveying, we strive for the highest accuracy and precision possible. However, this is not always the case in mapmaking. Too-detailed geometries on small scale (zoomed-out) maps are bad for human perception; edges or lines appear jagged, and cause an unnecessary burden on the computer in trying to render them. For that reason, cartographers generalize the geometries used for mapmaking. There are a few algorithms designed for automated generalization. PostGIS provides an implementation of a widely used Douglas-Peucker algorithm in a ST_Simplify function.

The function accepts two arguments, the first being a geometry to be simplified, and the second being a tolerance parameter defining how aggressive the simplification can be. Tolerance is given in the same units as the geometry's coordinate system, and the bigger it is, the more simplified the output geometry becomes.

Here are some examples of simplification:

River meanders simplified with 50 (green) and 100 (red)...