Learning Geospatial Analysis with Python
eBook - ePub

Learning Geospatial Analysis with Python

  1. 364 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Geospatial Analysis with Python

About this book

In Detail

Geospatial analysis is used in almost every field you can think of from medicine, to defense, to farming. It is an approach to use statistical analysis and other informational engineering to data which has a geographical or geospatial aspect. And this typically involves applications capable of geospatial display and processing to get a compiled and useful data.

"Learning Geospatial Analysis with Python" uses the expressive and powerful Python programming language to guide you through geographic information systems, remote sensing, topography, and more. It explains how to use a framework in order to approach Geospatial analysis effectively, but on your own terms.

"Learning Geospatial Analysis with Python" starts with a background of the field, a survey of the techniques and technology used, and then splits the field into its component speciality areas: GIS, remote sensing, elevation data, advanced modelling, and real-time data.

This book will teach you everything there is to know, from using a particular software package or API to using generic algorithms that can be applied to Geospatial analysis. This book focuses on pure Python whenever possible to minimize compiling platform-dependent binaries, so that you dont become bogged down in just getting ready to do analysis.

"Learning Geospatial Analysis with Python" will round out your technical library with handy recipes and a good understanding of a field that supplements many a modern day human endeavors.

Approach

This is a tutorial-style book that helps you to perform Geospatial and GIS analysis with Python and its tools/libraries. This book will first introduce various Python-related tools/packages in the initial chapters before moving towards practical usage, examples, and implementation in specialized kinds of Geospatial data analysis.

Who this book is for

This book is for anyone who wants to understand digital mapping and analysis and who uses Python or another scripting language for automation or crunching data manually.This book primarily targets Python developers, researchers, and analysts who want to perform Geospatial, modeling, and GIS analysis with Python.

Trusted by 375,005 students

Access to over 1 million titles for a fair monthly price.

Study more efficiently using our study tools.

Learning Geospatial Analysis with Python


Table of Contents

Learning Geospatial Analysis with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Learning Geospatial Analysis with Python
Geospatial analysis and our world
Beyond politics
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
Raster data 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
Summary
2. Geospatial Data
Data structures
Common traits
Geo-location
Subject information
Spatial indexing
Indexing algorithms
Quad-Tree index
R-Tree index
Grids
Overviews
Metadata
File structure
Vector data
Shapefiles
CAD files
Tag and markup-based formats
GeoJSON
Raster data
TIFF files
JPEG, GIF, BMP, and PNG
Compressed formats
ASCII GRIDS
World files
Point cloud data
Summary
3. The Geospatial Technology Landscape
Data access
GDAL
OGR
Computational geometry
PROJ.4
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
Quantum GIS
OpenEV
GRASS GIS
uDig
gvSIG
OpenJUMP
Google Earth
NASA World Wind
ArcGIS
Metadata management
GeoNetwork
CatMDEdit
Summary
4. Geospatial Python Toolbox
Installing third-party Python modules
Installing GDAL
Windows
Linux
Mac OS X
Python networking libraries for acquiring data
Python urllib module
FTP
ZIP and TAR files
Python markup and tag-based parsers
The minidom module
ElementTree
Building XML
WKT
Python JSON libraries
json module
geojson module
OGR
PyShp
dbfpy
Shapely
GDAL
NumPy
PIL
PNGCanvas
PyFPDF
Spectral Python
Summary
5. Python and Geographic Information Systems
Measuring distance
Pythagorean theorem
Haversine formula
Vincenty formula
Coordinate conversion
Reprojection
Editing shapefiles
Accessing the shapefile
Reading shapefile attributes
Reading shapefile geometry
Changing a shapefile
Adding fields
Merging shapefiles
Splitting shapefiles
Subsetting spatially
Performing selections
Point in polygon formula
Attribute selections
Creating images for visualization
Dot density calculations
Choropleth maps
Using spreadsheets
Using GPS data
Summary
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
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 (TIN)
Summary
8. Advanced Geospatial Python Modelling
Creating an NDVI
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
Creating classes
Creating a flood inundation model
The flood fill function
Making a flood
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
Summary
9. Real-Time Data
Tracking vehicles
Nextbus agency list
Nextbus route list
Nextbus vehicle locations
Mapping Nextbus locations
Storm chasing
Summary
10. Putting It All Together
A typical GPS report
Working with GPX-Reporter.py
Stepping through the program
Initial setup
Working with utility functions
Parsing the GPX
Getting the bounding box
Downloading OpenStreetMap images
Creating the hillshade
Creating maps
Measuring elevation
Measuring distance
Retrieving weather data
Summary
Index

Learning Geospatial Analysis with Python

Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2013
Production Reference: 1181013
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-113-8
www.packtpub.com
Cover Image by Jarek Blaminsky ()

Credits

Author
Joel Lawhead
Reviewers
Jorge Samuel Mendes de Jesus
Athanasios Tom Kralidis
Alessandro Pasotti
Acquisition Editor
Joanne Fitzpatrick
Lead Technical Editor
Balaji Naidu
Technical Editors
Pooja Arondekar
Anita Nayak
Anusri Ramchandran
Project Coordinator
Angel Jathanna
Proofreader
Bernadette Watkins
Indexer
Hemangini Bari
Graphics
Abhinash Sahu
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade

About the Author

Joel Lawhead is a PMI-certified Project Management Professional (PMP) and the Chief Information Officer (CIO) for NVisionSolutions.com, an award-winning firm specializing in geospatial technology integration and sensor engineering.
He began using Python in 1997 and began combining it with geospatial software development in 2000. He has been published in two editions of the Python Cookbook by O'Reilly. He is also the developer of the widely used open source Python Shapefile Library (PyShp) and maintains the geospatial technical blog GeospatialPython.com and Twitter feed @SpatialPython discussing the use of the Python programming language within the geospatial industry.
In 2011, he reverse engineered and published the undocumented shapefile spatial indexing format and assisted fellow geospatial Python developer, Marc Pfister, in reversing the algorithm used, allowing developers around the world to create better-integrated and more robust geospatial applications involving shapefiles.
He has serv...

Table of contents

  1. Learning Geospatial Analysis with Python

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Learning Geospatial Analysis with Python by Joel Lawhead in PDF and/or ePUB format, as well as other popular books in Technology & Engineering & Computer Science General. We have over one million books available in our catalogue for you to explore.