logo资料库

Learning Geospatial Analysis with Python.pdf

第1页 / 共394页
第2页 / 共394页
第3页 / 共394页
第4页 / 共394页
第5页 / 共394页
第6页 / 共394页
第7页 / 共394页
第8页 / 共394页
资料共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
[ 1 ] www.it-ebooks.info
Learning Geospatial Analysis with Python Second Edition An effective guide to geographic information system and remote sensing analysis using Python 3 Joel Lawhead BIRMINGHAM - MUMBAI www.it-ebooks.info
Learning Geospatial Analysis with Python Second Edition Copyright © 2015 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 Second edition: December 2015 Production reference: 1211215 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78355-242-9 www.packtpub.com www.it-ebooks.info
Credits Project Coordinator Izzat Contractor Proofreader Safis Editing Indexer Mariammal Chettiyar Graphics Jason Monteiro Production Coordinator Arvindkumar Gupta Cover Work Arvindkumar Gupta Author Joel Lawhead Reviewers Mark Cederholm Truc Viet Le John Maurer Julia Wood Commissioning Editor Kartikey Pandey Acquisition Editors Kevin Colaco Usha Iyer Kartikey Pandey Content Development Editor Anish Sukumaran Technical Editor Manthan Raja Copy Editor Tasneem Fatehi www.it-ebooks.info
About the Author Joel Lawhead is a project management institute-certified Project Management Professional (PMP), certified GIS Professional (GISP), and the Chief Information Officer (CIO) of NVision Solutions Inc., an award-winning firm that specializes in geospatial technology integration and sensor engineering. Joel began using Python in 1997 and started combining it with geospatial software development in 2000. He is the author of the first edition of Learning Geospatial Analysis with Python and QGIS Python Programming Cookbook, both by Packt Publishing. His Python cookbook recipes were featured in two editions of Python Cookbook, O'Reilly Media. He is also the developer of the widely-used, open source Python Shapefile Library (PyShp). He maintains the geospatial technical blog http://geospatialpython.com/ and the Twitter feed, @SpatialPython, which discusses the use of the Python programming language in the geospatial industry. In 2011, Joel 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. Joel serves as the lead architect, project manager, and co-developer for geospatial applications used by U.S. government agencies, including NASA, FEMA, NOAA, the U.S. Navy, and many other commercial and non-profit organizations. In 2002, he received the international Esri Special Achievement in GIS award for his work on the Real-Time Emergency Action Coordination Tool (REACT), for emergency management using geospatial analysis. www.it-ebooks.info
About the Reviewers Mark Cederholm, GISP, has over 20 years of experience in developing GIS applications using various Esri technologies, from ARC/INFO AML to ArcObjects to ArcGIS Runtime and Web SDKs. He lives in Flagstaff, Arizona. He has been a technical reviewer for the book, Developing Mobile Web ArcGIS Applications, Packt Publishing. Truc Viet Le is currently a PhD candidate in information systems at the Singapore Management University. His research interests primarily involve novel methods for the modeling and predicting of human mobility patterns and trajectories, learning smart strategies for urban transportation, and traffic flow prediction from fine-grained GPS and sensor network data. He uses R and Python every day for his work, where he finds R superb for data manipulation/visualization and Python an ideal environment for machine learning tasks. He is also interested in applying data science for the social work and international development work. When not behind the computer screen, he is an avid traveler, adventurer, and an aspiring travel writer and photographer. His work portfolio and some of his writings can be found on his personal website at http://vietletruc.com/. He spent a wonderful year at Carnegie Mellon University in Pittsburgh, Pennsylvania, while pursuing his PhD. Previously, he obtained his bachelor's and master's degrees from Nanyang Technological University in computer engineering and mathematical sciences. www.it-ebooks.info
John Maurer is a programmer and data manager at the Pacific Islands Ocean Observing System (PacIOOS) in Honolulu, Hawaii. He creates and configures web interfaces and data services to provide access, visualization, and mapping of oceanographic data from a variety of sources, including satellite remote sensing, forecast models, GIS layers, and in situ observations (buoys, sensors, shark tracking, and so on) throughout the insular Pacific. He obtained a graduate certificate in remote sensing as well as a master's degree in geography from the University of Colorado, Boulder, where he developed software to analyze ground-penetrating radar (GPR) for snow accumulation measurements on the Greenland ice sheet. While in Boulder, he worked with the National Snow and Ice Data Center (NSIDC) for eight years, sparking his initial interest in Earth science and all things geospatial: an unexpected but comfortable detour from his undergraduate degree in music, science, and technology at Stanford University. Julia Wood is currently a Geospatial Information Sciences (GIS) analyst who spends her professional time completing projects as a contractor in the Washington D.C. area. She graduated magna cum laude from the University of Mary Washington in Fredericksburg, Virginia, in the spring of 2014 with a bachelor's degree in both history and geography as well as a minor in GIS. Though her career is still in its early stages, Julia has aspirations to keep growing her skill set, and working on this review has certainly helped expand her professional experience; she hopes to continue learning and eventually work toward a master's degree while still working full time. In her non-work life, she enjoys reading, crafting, cooking, and exploring the big city, one local restaurant at a time. Reviewing this book for Packt Publishing was Julia's first professional reviewing experience and she hopes that she can pursue similar endeavors in the future. I'd like to thank my parents, John and Diana, for always encouraging me to do well in my educational and professional endeavors; my sister, Sarrina, and my brother, Jonathan, for offering support and advice when I needed it; and my boyfriend, Max, and my cat, Coco, for keeping me company while I conducted the reviews for this book. A thank you to Packt for letting me be a part of this experience! www.it-ebooks.info
www.PacktPub.com Support files, eBooks, discount offers, and more For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via a web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access. www.it-ebooks.info
分享到:
收藏