Learning Geospatial Analysis with Python

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"

An effective guide to geographic information systems and remote sensing analysis using Python 3

About This Book Construct applications for GIS development by exploiting Python This focuses on built-in Python modules and libraries compatible with the Python Packaging Index distribution system—no compiling of C libraries necessary This practical, hands-on tutorial teaches you all about Geospatial analysis in Python Who This Book Is For

If you are a Python developer, researcher, or analyst who wants to perform Geospatial, modeling, and GIS analysis with Python, then this book is for you. Familiarity with digital mapping and analysis using Python or another scripting language would be helpful but not required.

What You Will Learn Automate Geospatial analysis workflows using Python Code the simplest possible GIS in 60 lines of Python Create thematic maps with Python tools Become familiar with the various forms that geospatial data comes in Produce elevation contours using Python tools Create flood inundation models Apply Geospatial analysis to real-time data tracking and storm chasing In Detail

Geospatial Analysis is used in almost every field you can think of from medicine, to defense, to farming. This book will guide you through this exciting and complex field.

We start by giving you a little background on the field and a survey of the techniques and technology used. We then split the field into its component areas: GIS, remote sensing, elevation data, advanced modeling, and real-time data. This book will teach you everything you need to know about Geospatial Analysis, from using a particular software package or API to using generic algorithms that can be applied to any problem. This book focuses on pure Python whenever possible to minimize compiling platform-dependent binaries, so that you don't become bogged down in preparing for analysis. This book will complete your technical library through handy recipes that will give you a good understanding of a field that supplements many modern day human endeavors.

Style and approach

This is a practical, hands-on tutorial that teaches you all about Geospatial analysis interactively using Python.

Author(s): Joel Lawhead
Edition: 2
Publisher: Packt Publishing
Year: 2015

Language: English
Pages: 394

Cover
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Learning Geospatial Analysis with Python
Geospatial analysis and our world
Beyond disasters
History of geospatial analysis
Geographic information systems
Remote sensing
Elevation data
Computer-aided drafting
Geospatial analysis and computer programming
Object-oriented programming for geospatial analysis
Importance of geospatial analysis
Geographic information system concepts
Thematic maps
Spatial databases
Spatial indexing
Metadata
Map projections
Rendering
Remote sensing concepts
Images as data
Remote sensing and color
Common vector GIS concepts
Data structures
Buffer
Dissolve
Generalize
Intersection
Merge
Point in polygon
Union
Join
Geospatial rules about polygons
Common raster data concepts
Band math
Change detection
Histogram
Feature extraction
Supervised classification
Unsupervised classification
Creating the simplest possible Python GIS
Getting started with Python
Building SimpleGIS
Step by step
Summary
Chapter 2: Geospatial Data
An overview of common data formats
Data structures
Common traits
Geolocation
Subject information
Spatial indexing
Indexing algorithms
Quadtree index
R-tree index
Grids
Overviews
Metadata
File structure
Vector data
Shapefiles
CAD files
Tag-based and markup-based formats
GeoJSON
Raster data
TIFF files
JPEG, GIF, BMP, and PNG
Compressed formats
ASCII grids
World files
Point cloud data
Web services
Summary
Chapter 3: The Geospatial Technology Landscape
Data access
GDAL
OGR
Computational geometry
The PROJ.4 projection library
CGAL
JTS
GEOS
PostGIS
Other spatially-enabled databases
Oracle spatial and graph
ArcSDE
Microsoft SQL Server
MySQL
SpatiaLite
Routing
Esri Network Analyst and Spatial Analyst
pgRouting
Desktop tools (including visualization)
Quantum GIS
OpenEV
GRASS GIS
uDig
gvSIG
OpenJUMP
Google Earth
NASA World Wind
ArcGIS
Metadata management
GeoNetwork
CatMDEdit
Summary
Chapter 4: Geospatial Python Toolbox
Installing third-party Python modules
Installing GDAL
Windows
Linux
Mac OS X
Python networking libraries for acquiring data
The Python urllib module
FTP
ZIP and TAR files
Python markup and tag-based parsers
The minidom module
ElementTree
Building XML
Well-known text (WKT)
Python JSON libraries
The json module
The geojson module
OGR
PyShp
dbfpy
Shapely
Fiona
GDAL
NumPy
PIL
PNGCanvas
GeoPandas
PyMySQL
PyFPDF
Spectral Python
Summary
Chapter 5: Python and Geographic Information Systems
Measuring distance
Pythagorean theorem
Haversine formula
Vincenty's formula
Calculating line direction
Coordinate conversion
Reprojection
Editing shapefiles
Accessing the shapefile
Reading shapefile attributes
Reading shapefile geometry
Changing a shapefile
Adding fields
Merging shapefiles
Merging shapefiles with dbfpy
Splitting shapefiles
Subsetting spatially
Performing selections
Point in polygon formula
Bounding Box Selections
Attribute selections
Creating images for visualization
Dot density calculations
Choropleth maps
Using spreadsheets
Using GPS data
Geocoding
Summary
Chapter 6: Python and Remote Sensing
Swapping image bands
Creating histograms
Performing a histogram stretch
Clipping images
Classifying images
Extracting features from images
Change detection
Summary
Chapter 7: Python and Elevation Data
ASCII Grid files
Reading grids
Writing grids
Creating a shaded relief
Creating elevation contours
Working with LIDAR
Creating a grid from LIDAR
Using PIL to visualize LIDAR
Creating a triangulated irregular network
Summary
Chapter 8: Advanced Geospatial Python Modeling
Creating a Normalized Difference Vegetative Index
Setting up the framework
Loading the data
Rasterizing the shapefile
Clipping the bands
Using the NDVI formula
Classifying the NDVI
Additional functions
Loading the NDVI
Preparing the NDVI
Creating classes
Creating a flood inundation model
The flood fill function
Making a flood
Creating a color hillshade
Least cost path analysis
Setting up the test grid
The simple A* algorithm
Generating the test path
Viewing the test output
The real-world example
Loading the grid
Defining the helper functions
The real-world A* algorithm
Generating a real-world path
Routing along streets
Geolocating photos
Summary
Chapter 9: Real-Time Data
Tracking vehicles
The NextBus agency list
The NextBus route list
NextBus vehicle locations
Mapping NextBus locations
Storm chasing
Reports from the field
Summary
Chapter 10: Putting It All Together
A typical GPS report
Working with GPX-Reporter.py
Stepping through the program
The initial setup
Working with utility functions
Parsing the GPX
Getting the bounding box
Downloading map and elevation images
Creating the hillshade
Creating maps
Measuring the elevation
Measuring the distance
Retrieving weather data
Summary
Index