Over 80 task-based recipes to store, organize, manipulate, and analyze spatial data in a PostGIS database
"PostGIS Cookbook" is a comprehensive guidebook written by Paolo Corti, Thomas J Kraft, Stephen Vincent Mather, and Bborie Park, offering over 80 task-based recipes for effectively storing, organizing, manipulating, and analyzing spatial data in a PostGIS database. PostGIS is an open-source extension for PostgreSQL that adds support for geographic objects, allowing users to work with spatial data.
The book is divided into multiple chapters, each focusing on different aspects of working with PostGIS. In Chapter 1, the authors discuss various methods for importing and exporting data in PostGIS, including handling nonspatial tabular data (CSV) using PostGIS functions and GDAL, importing shapefiles with shp2pgsql, and working with OpenStreetMap and raster data.
Chapter 2 delves into the structures that work well with PostGIS. It covers topics such as using geospatial views, triggers for populating geometry columns, table inheritance, and partitioning techniques to structure spatial data effectively.
Chapter 3 explores the basics of working with vector data in PostGIS, including GPS data manipulation, fixing invalid geometries, spatial analysis using spatial joins, simplifying geometries, measuring distances, and computing intersections.
Chapter 4 dives into advanced recipes for working with vector data, such as improving proximity filtering using KNN (K-Nearest Neighbors), rotating geometries, generating detailed building footprints from LiDAR data, and utilizing external scripts to calculate Voronoi diagrams.
The book also covers working with raster data in Chapter 5, including loading and analyzing rasters, performing map-algebra operations, combining geometries with rasters, and executing advanced operations on Digital Elevation Models (DEMs).
Chapter 6 focuses on utilizing the pgRouting extension for network routing and shortest path calculations. It covers topics like loading data from OpenStreetMap, calculating driving distances, and extracting centerlines of polygons.
Chapter 7 introduces working with three-dimensional (3D) data in PostGIS. It discusses importing LiDAR data, performing 3D queries on point clouds, constructing and serving 2.5D buildings, and working with Unmanned Aerial Vehicle (UAV) image footprints.
PostGIS programming is covered in Chapter 8, which includes examples of writing PostGIS vector data using Python libraries, geocoding addresses, importing netCDF datasets, and using PL/Python for extending PostGIS functionality.
Chapter 9 explores integrating PostGIS with web applications, covering the creation of Web Map Service (WMS) and Web Feature Service (WFS) services using MapServer and GeoServer, consuming these services with OpenLayers and Leaflet, and developing web applications with GeoDjango.
Maintenance, optimization, and performance tuning techniques for PostGIS are discussed in Chapter 10, including database organization, data privilege mechanisms, backups, indexing, clustering, query optimization, migration, and replication.
Finally, Chapter 11 focuses on using desktop clients like QGIS, OpenJUMP GIS, and gvSIG for working with PostGIS, including adding PostGIS layers, running database queries, and utilizing plugins.
Overall, "PostGIS Cookbook" provides a practical resource for anyone working with spatial data in a PostGIS database, offering a wide range of recipes and techniques to effectively manage and analyze geospatial information.