Mastering PostGIS

Write efficient GIS applications using PostGIS - from data creation to data consumption

Mastering PostGIS

This ebook is included in a Mapt subscription
Dominik Mikiewicz, Michal Mackiewicz, Tomasz Nycz

Write efficient GIS applications using PostGIS - from data creation to data consumption
$10.00
$34.49
RRP $27.49
RRP $34.49
eBook
Print + eBook
Access every Packt eBook & Video for just $100
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Find Out More
 
Preview in Mapt

Book Details

ISBN 139781784391645
Paperback328 pages

Book Description

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

Chapter 1: Importing Spatial Data
Obtaining test data
Importing flat data
Importing shape files using shp2pgsql
Importing vector data using ogr2ogr
Importing data using GIS clients
Importing OpenStreetMap data
Connecting to external data sources with foreign data wrappers
Loading rasters using raster2pgsql
Importing data with pgrestore
Summary
Chapter 2: Spatial Data Analysis
Composing and decomposing geometries
Spatial measurement
Geometry bounding boxes
Geometry simplification
Geometry validation
Intersecting geometries
Nearest feature queries
Summary
Chapter 3: Data Processing - Vector Ops
Primer - obtaining and importing OpenStreetMap data
Merging geometries
Slicing geometries
Buffering and offsetting geometries
Reprojecting geometries
Spatial relationships
Summary
Chapter 4: Data Processing - Raster Ops
Preparing data
Processing and analysis
Analytic and statistical functions
Vector to raster conversion
Raster to vector conversion
Spatial relationship
Metadata
Summary
Chapter 5: Exporting Spatial Data
Exporting data using \COPY in psql
Exporting vector data using pgsql2shp
Exporting vector data using ogr2ogr
Exporting data using GIS clients
Outputting rasters using GDAL
Outputting raster using psql
Exporting data using the PostgreSQL backup functionality
Summary
Chapter 6: ETL Using Node.js
Setting up Node.js
Handshaking with a database using Node.js PgSQL client
Retrieving and processing JSON data
Geocoding address data
Consuming WFS data
Summary
Chapter 7: PostGIS – Creating Simple WebGIS Applications
ExtJS says Hello World
Configuring GeoServer web services
Making use of PgRaster in a simple WMS GetMap handler
Consuming WMS
Enabling CORS in Jetty
Consuming WFS in ol3
Outputting and consuming GeoJSON
Outputting and consuming TopoJSON
Implementing a simple CRUD application that demonstrates vector editing via web interfaces
Summary
Chapter 8: PostGIS Topology
The conceptual model
The data
Installation
Creating an empty topology
Importing Simple Feature data into topology
Inspecting and validating a topology
Accessing the topology data
Topology editing
Topology-aware simplification
Topology output
Summary
Chapter 9: pgRouting
Installing the pgRouting extension
Importing routing data
pgRouting algorithms
Consuming pgRouting functionality in a web app
Summary

What You Will Learn

  • Refresh your knowledge of the PostGIS concepts and spatial databases
  • Solve spatial problems with the use of SQL in real-world scenarios
  • Practical walkthroughs of application development examples using Postgis, GeoServer and OpenLayers.
  • Extract, transform and load your spatial data
  • Expose data directly or through web services.
  • Consume your data in both desktop and web clients

Authors

Table of Contents

Chapter 1: Importing Spatial Data
Obtaining test data
Importing flat data
Importing shape files using shp2pgsql
Importing vector data using ogr2ogr
Importing data using GIS clients
Importing OpenStreetMap data
Connecting to external data sources with foreign data wrappers
Loading rasters using raster2pgsql
Importing data with pgrestore
Summary
Chapter 2: Spatial Data Analysis
Composing and decomposing geometries
Spatial measurement
Geometry bounding boxes
Geometry simplification
Geometry validation
Intersecting geometries
Nearest feature queries
Summary
Chapter 3: Data Processing - Vector Ops
Primer - obtaining and importing OpenStreetMap data
Merging geometries
Slicing geometries
Buffering and offsetting geometries
Reprojecting geometries
Spatial relationships
Summary
Chapter 4: Data Processing - Raster Ops
Preparing data
Processing and analysis
Analytic and statistical functions
Vector to raster conversion
Raster to vector conversion
Spatial relationship
Metadata
Summary
Chapter 5: Exporting Spatial Data
Exporting data using \COPY in psql
Exporting vector data using pgsql2shp
Exporting vector data using ogr2ogr
Exporting data using GIS clients
Outputting rasters using GDAL
Outputting raster using psql
Exporting data using the PostgreSQL backup functionality
Summary
Chapter 6: ETL Using Node.js
Setting up Node.js
Handshaking with a database using Node.js PgSQL client
Retrieving and processing JSON data
Geocoding address data
Consuming WFS data
Summary
Chapter 7: PostGIS – Creating Simple WebGIS Applications
ExtJS says Hello World
Configuring GeoServer web services
Making use of PgRaster in a simple WMS GetMap handler
Consuming WMS
Enabling CORS in Jetty
Consuming WFS in ol3
Outputting and consuming GeoJSON
Outputting and consuming TopoJSON
Implementing a simple CRUD application that demonstrates vector editing via web interfaces
Summary
Chapter 8: PostGIS Topology
The conceptual model
The data
Installation
Creating an empty topology
Importing Simple Feature data into topology
Inspecting and validating a topology
Accessing the topology data
Topology editing
Topology-aware simplification
Topology output
Summary
Chapter 9: pgRouting
Installing the pgRouting extension
Importing routing data
pgRouting algorithms
Consuming pgRouting functionality in a web app
Summary

Book Details

ISBN 139781784391645
Paperback328 pages
Read More

Read More Reviews