PostGIS Cookbook. open source I community experience distilled

Similar documents
GeoSpatial Tools and Analysis David Currie

These modules are covered with a brief information and practical in ArcGIS Software and open source software also like QGIS, ILWIS.

Existing Open Source Tools and Possibilities for Cadastre Systems

Leveraging Your Geo-spatial Data Investments with Quantum GIS: an Open Source Geographic Information System

Karsten Vennemann, Seattle. QGIS Workshop CUGOS Spring Fling 2015

Overview of Geospatial Open Source Software which is Robust, Feature Rich and Standards Compliant

YYT-C3002 Application Programming in Engineering GIS I. Anas Altartouri Otaniemi

Among various open-source GIS programs, QGIS can be the best suitable option which can be used across partners for reasons outlined below.

Salisbury University: Eric Flint, John O Brien, & Alex Nohe

Free and Open Source Software for Cadastre and Land Registration : A Hidden Treasure? Gertrude Pieper Espada. Overview

GIS CONCEPTS ARCGIS METHODS AND. 2 nd Edition, July David M. Theobald, Ph.D. Natural Resource Ecology Laboratory Colorado State University

Geoprocessing Tools at ArcGIS 9.2 Desktop

Introduction to geoprocessing services using SEXTANTE. Víctor Olaya SEXTANTE Geospatial Services

Spatial Analysis with Web GIS. Rachel Weeden

OSGIS Platform. Storing and distributing PostGIS, Deegree, UMN Map Server Desktop visualization JUMP, QGIS, Thuban, udig, gvsig

OPEN SOURCE TECHNOLOGIES IN GEOGRAPHIC INFORMATION SYSTEMS

GIS for ChEs Introduction to Geographic Information Systems

GIS CONCEPTS ARCGIS METHODS AND. 3 rd Edition, July David M. Theobald, Ph.D. Warner College of Natural Resources Colorado State University

GeoPackage, das Shapefile der Zukunft

How do I do that in Quantum GIS: illustrating classic GIS tasks Edited by: Arthur J. Lembo, Jr.; Salisbury University

Practical teaching of GIS at University of Liège

GIS Data Production and Editing Pathway

Geodatabase Management Pathway

SpatialKit and SEXTANTE

Pierre Racine Research Assistant Centre for Forest Research Département des sciences du bois et de la forêt, Université Laval, Québec

Open Source Technologies and Remotely Sensed Data in Protecting Elephants. Rosemary Alles Dr. Justine Blanford Penn State World Campus July 2015

Geographical Databases: PostGIS. Introduction. Creating a new database. References

Development and operation of GIS exercise materials for undergraduate students

Leveraging the GIS Capability within FlexiCadastre

Why GIS & Why Internet GIS?

ArcGIS 10.1 An Overview of the System

gvsig a real tool for GIS technicians

Geospatial Products V8i (SELECTseries 1)

ArcGIS Pipeline Referencing An Introduction. Anjali Bhangay William Isley

Bentley Map Advancing GIS for the World s Infrastructure

Geog 469 GIS Workshop. Data Analysis

Introduction to ArcGIS Server - Creating and Using GIS Services. Mark Ho Instructor Washington, DC

Chapter 6. Fundamentals of GIS-Based Data Analysis for Decision Support. Table 6.1. Spatial Data Transformations by Geospatial Data Types

Newcastle City Council - Migration to QGIS and Open Source GIS

Introduction to Geographic

QGIS AND GRASS COURSE FROM BEGINNER TO ADVANCED ONLINE TRAINING. GIS Training. Course. .com

Valdosta State University Strategic Research & Analysis

All About Spatial Data. Find it, Manage it, Use it

UNIT 4: USING ArcGIS. Instructor: Emmanuel K. Appiah-Adjei (PhD) Department of Geological Engineering KNUST, Kumasi

Geometric Algorithms in GIS

ArcGIS Enterprise: What s New. Philip Heede Shannon Kalisky Melanie Summers Shreyas Shinde

SuperGIS Server 3.3 Functionality Matrix

Hosted by Esri Official Distributor

A Vision for ArcGIS Applying Geography Everywhere

Bentley Map V8i (SELECTseries 3)

MapOSMatic, free city maps for everyone!

GIS for Business Intelligence: Getting Cloud Connected

Development of a server to manage a customised local version of OpenStreetMap in Ireland

An Enterprise Geodatabase: Montgomery County, Maryland ESRI 2004 User Conference Paper #1674

Popular Mechanics, 1954

GIS-T 2010 Building a Successful Geospatial Data Sharing Framework: A Ohio DOT Success Story

Institutional Research with Public Data and Open Source Software

ArcGIS Enterprise: What s New. Philip Heede Shannon Kalisky Melanie Summers Sam Williamson

This White Paper has been compiled using several online examples from the following resources:

Time Series Analysis with SAR & Optical Satellite Data

Imagery and the Location-enabled Platform in State and Local Government

Bureau of Meteorology use of open spatial standards

EEOS 381 -Spatial Databases and GIS Applications

Road Ahead: Linear Referencing and UPDM

Scalable Datacube Analytics with rasdaman

HIGH RESOLUTION BASE MAP: A CASE STUDY OF JNTUH-HYDERABAD CAMPUS

Overview key concepts and terms (based on the textbook Chang 2006 and the practical manual)

Welcome! Power BI User Group (PUG) Copenhagen

Canadian Board of Examiners for Professional Surveyors Core Syllabus Item C 5: GEOSPATIAL INFORMATION SYSTEMS

ArcGIS Runtime: Migrating Your Apps from ArcGIS Engine. Eric Bader Lucas Danzinger Mike Branscomb

QGIS FLO-2D Integration

DP Project Development Pvt. Ltd.

Esri UC2013. Technical Workshop.

Introduction to ArcGIS GeoAnalytics Server. Sarah Ambrose & Noah Slocum

SRJC Applied Technology 54A Introduction to GIS

Features and Benefits

SOURCE GEOSPATIAL TOOLS IN CLIMATE CHANGE RESEARCH AND NATURAL RESOURCES MANAGEMENT

ArcGIS API for Python for Data Scientists. Andrew Chapkowski Alberto Nieto

The (new) GIS Toolkit:

A Distributed GIS Architecture for Research in Baalbek Based on CISAR

Introduction to GIS. Dr. M.S. Ganesh Prasad

QGIS COURSE - ROUTE ANALYSIS, FINDING THE SHORT PATH IN QGIS ONLINE TRAINING. GIS Training. Course. .com

Performing. Geospatial Analysis. Using Latitude and Longitude Data. Ginger Ni - Software Engineer

GIS Resources for Local Governments

ArcGIS. for Server. Understanding our World

Development of Univ. of San Agustin Geographic Information System (USAGIS)

Fundamentals of ArcGIS Desktop Pathway

Beyond points: How to turn SMW into a complete Geographic Information System

ArcGIS for Desktop. ArcGIS for Desktop is the primary authoring tool for the ArcGIS platform.

Managing Imagery and Raster Data Using Mosaic Datasets

Assessing the Robustness of Web Feature Services Necessary to Satisfy the Requirements of Coastal Management

CalWeedMapper. Mapping the Spread of Invasive Plant Species. Karsten Vennemann. Seattle

Lecture 9: Geocoding & Network Analysis

Administering your Enterprise Geodatabase using Python. Jill Penney

October 2011 ArcGIS 10 for Server Functionality Matrix

ArcGIS Web Tools, Templates, and Solutions for Defence & Intelligence. Renee Bernstein Esri Solutions Engineer

Digital Map of Mexico Platform and MxSIG. March 2017

Development of a GIS Interface for WEPP Model Application to Great Lakes Forested Watersheds

ArcGIS 10.0 Imagery. Joseph B. Bowles

GENERALIZATION IN THE NEW GENERATION OF GIS. Dan Lee ESRI, Inc. 380 New York Street Redlands, CA USA Fax:

Transcription:

PostGIS Cookbook Over 80 task-based recipes to store, organize, manipulate, and analyze spatial data in a PostGIS database Paolo Corti Thomas J Kraft Stephen Vincent Mather Bborie Park PUBLISHING open source I community experience distilled BIRMINGHAM - MUMBAI

Preface 1 Chapter 1: Moving Data In and Out of PostGIS 7 Introduction 7 Importing nonspatial tabular data (CSV) using PostGIS functions 7 Importing nonspatial tabular data (CSV) using GDAL 12 Importing shapefiles with shp2pgsql 17 Importing and exporting data with the ogr2ogr GDAL command 21 Handling batch importing and exporting of datasets 25 Exporting data to the shapefile with the pgsql2shp PostGIS command 33 Importing OpenStreetMap data with the osm2pgsql command 34 Importing raster data with the raster2pgsql PostGIS command 39 Importing multiple rasters at a time 45 Exporting rasters with the gdai_translate and gdalwarp GDAL commands 51 Chapter 2: Structures that Work 55 Introduction 55 Using geospatial views 56 Using triggers to populate a geometry column 58 Structuring spatial data with table inheritance 62 Extending inheritance - table partitioning 67 Normalizing imports 71 Normalizing internal overlays 76 Using polygon overlays for proportional census estimates 80

Chapter 3: Working with Vector Data - The Basics 85 Introduction 85 Working with GPS data 86 Fixing invalid geometries 92 GIS analysis with spatial joins 96 Simplifying geometries 101 Measuring distances 107 Merging polygons using a common attribute 110 Computing intersections 112 Clipping geometries to deploy data 116 Simplifying geometries with PostGIS topology 120 Chapter 4: Working with Vector Data - Advanced Recipes 127 Introduction 127 Improving proximity filtering with KNN 128 Improving proximity filtering with KNN - advanced 132 Rotating geometries 137 Improving ST_Polygonize 140 Translating, scaling, and rotating geometries - advanced 142 Generating detailed building footprints from LiDAR 148 Using external scripts to embed new 152 functionality in order to calculate a Voronoi diagram 152 Using external scripts to embed other 156 libraries in order to calculate a Voronoi 156 diagram - advanced 156 Chapter 5: Working with Raster Data 173 Introduction 173 Getting and loading rasters 174 Working with basic raster information and analysis 177 Performing simple map-algebra operations 182 Combining geometries with rasters for analysis 187 Converting between rasters and geometries 189 Processing and loading rasters with GDAL VRT 194 Warping and resampling rasters 197 Performing advanced map-algebra operations 200 Executing DEM operations 206 Sharing and visualizing rasters through SQL 209 -DD

Chapter 6: Working with pgrouting 215 Introduction 215 Startup - Dijkstra routing 215 Loading data from OpenStreetMap and finding the shortest path using A* 220 Driving distance/service area calculation 223 Calculating demographics using driving distance 229 Extracting the centerlines of polygons 232 Chapter 7: Into the Nth Dimension 241 Introduction 241 Importing LIDAR data 242 Performing 3D queries on a LIDAR point cloud 245 Constructing and serving buildings 2.5 D 247 Using ST_Extrude to extrude building footprints 256 Creating arbitrary 3D objects for PostGIS 257 Exporting models as X3D for the Web 261 Reconstructing Unmanned Aerial Vehicle (UAV) image footprints with PostGIS 3D 265 UAV photogrammetry in PostGIS - point cloud 272 UAV photogrammetry in PostGIS - orthorectification 274 UAV photogrammetry in PostGIS - DSM creation 279 Chapter 8: PostGIS Programming 281 Introduction 281 Writing PostGIS vector data with Psycopg 284 Writing PostGIS vector data with OGR Python bindings 291 Writing PostGIS functions with PL/Python 297 Geocoding and reverse-geocoding using the GeoNames datasets 302 Geocoding using the OSM datasets with trigrams 306 Geocoding with geopy and PL/Python 312 Importing netcdf datasets with Python and GDAL 316 Chapter 9: PostGIS and the Web 325 Introduction 325 Creating WMS and WFS services with MapServer 326 Creating WMS and WFS services with GeoServer 339 Creating a WMS Time with MapServer 352 Consuming WMS services with OpenLayers 359 Consuming WMS services with Leaflet 365

Consuming WFS-T services with OpenLayers Developing web applications with GeoDjango - part 1 Developing web applications with GeoDjango - part 2 369 375 386 Chapter 10: Maintenance r Optimization, and Performance Tuning 393 Introduction 393 Organizing the database 394 Setting up the correct data privilege mechanism 397 Backing up the database 403 Using indexes 405 Clustering for efficiency 409 Optimizing SQL queries 410 Migrating a PostGIS database to a different server 421 Replicating a PostGIS database with streaming replication 423 Chapter 11: Using Desktop Clients 429 Introduction 429 Adding PostGIS layers - QGIS 430 Using the Database Manager plugin - QGIS 434 Adding PostGIS layers - OpenJUMP GIS 443 Running database queries - OpenJUMP GIS 449 Adding PostGIS layers - gvsig 453 Adding PostGIS layers - udig 457 Index 461-01}