Python Geospatial Analysis Cookbook

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Michael Diener
Publisher: Packt Publishing
Year: 2015

Language: English
Pages: 310

Cover
Copyright
Untitled
About the Author
About the Reviewers
Untitled
Table of Contents
Preface
Chapter 1: Setting Up Your Geospatial Python Environment
Introduction
Installing virtualenv and virtualenvwrapper
Installing pyproj and NumPy
Installing shapely, matplotlib, and descartes
Installing pyshp, geojson, and pandas
Installing SciPy, PySAL, and IPython
Installing GDAL and OGR
Installing GeoDjango and PostgreSQL with PostGIS
Chapter 2: Working with Projections
Introduction
Discovering projection(s) of a Shapefile or GeoJSON dataset
Listing projection(s) from a WMS server
Creating a projection definition for a Shapefile if it does not exist
Batch setting the projection definition of a folder full of Shapefiles
Reprojecting a Shapefile from one projection to another
Chapter 3: Moving Spatial Data from One Format to Another
Introduction
Converting a Shapefile to a PostGIS table using ogr2ogr
Batch importing a folder of Shapefiles into PostGIS using ogr2ogr
Batch exporting a list of tables from PostGIS to Shapefiles
Converting an OpenStreetMap (OSM) XML to a Shapefile
Converting a Shapefile (vector) to a GeoTiff (raster)
Converting a raster (GeoTiff) to a vector (Shapefile) using GDAL
Creating a Shapefile from point data stored in Microsoft Excel
Converting an ESRI ASCII DEM to an image height map
Chapter 4: Working with PostGIS
Introduction
Executing a PostGIS ST_Buffer analysis query and exporting it to GeoJSON
Finding out whether a point is inside a polygon
Splitting linestrings at intersections using ST_Node
Checking the validity of linestrings
Executing a spatial join and assigning point attributes to a polygon
Conducting a complex spatial analysis query using ST_Distance()
Chapter 5: Vector Analysis
Introduction
Clipping linestrings to an area of interest
Splitting polygons with lines
Finding the location of a point on a line using linear referencing
Snapping a point to the nearest line
Calculating 3D ground distance and total elevation gain
Chapter 6: Overlay Analysis
Introduction
Punching holes in polygons with a symmetric difference operation
Union polygons without merging
Union polygons with merging (dissolving)
Performing an identity function (difference + intersection)
Chapter 7: Raster Analysis
Introduction
Loading a DEM USGS ACSII CDED into PostGIS
Creating an elevation profile
Creating a hillshade raster from your DEM with ogr
Generating slope and aspect images from your DEM
Merging rasters to generate a color relief map
Chapter 8: Network Routing Analysis
Introduction
Finding the Dijkstra shortest path with pgRouting
Finding the Dijkstra shortest path with NetworkX in pure Python
Generating evacuation polygons based on an indoor shortest path
Creating centerlines from polygons
Building an indoor routing system in 3D
Calculating indoor route walk times
Chapter 9: Topology Checking and Data Validation
Introduction
There must not be more than one point in side a polygon
A point must be on the starting and ending nodes of a line only
Linestrings must not overlap
A Linestring must not have dangles
A polygon centroid must be within a specific distance of a line
Chapter 10: Visualizing Your Analysis
Introduction
Generating a leaflet web map with Folium
Setting up TileStache to serve tiles
Visualizing DEM data with Three.js
Draping an orthophoto over a DEM
Chapter 11: Web Analysis with GeoDjango
Introduction
Setting up a GeoDjango web application
Creating an indoor web routing service
Visualizing an indoor routing service
Creating an indoor route-type service
Creating an indoor route from room to room
Appendix A: Other Geospatial Python Libraries
Appendix B: Mapping Icon Libraries
Index