Learning Geospatial Analysis with Python - Third Edition

Book description

Learn the core concepts of geospatial data analysis for building actionable and insightful GIS applications

Key Features

  • Create GIS solutions using the new features introduced in Python 3.7
  • Explore a range of GIS tools and libraries such as PostGIS, QGIS, and PROJ
  • Learn to automate geospatial analysis workflows using Python and Jupyter

Book Description

Geospatial analysis is used in almost every domain you can think of, including defense, farming, and even medicine. With this systematic guide, you'll get started with geographic information system (GIS) and remote sensing analysis using the latest features in Python.

This book will take you through GIS techniques, geodatabases, geospatial raster data, and much more using the latest built-in tools and libraries in Python 3.7. You'll learn everything you need to know about using software packages or APIs and generic algorithms that can be used for different situations. Furthermore, you'll learn how to apply simple Python GIS geospatial processes to a variety of problems, and work with remote sensing data.

By the end of the book, you'll be able to build a generic corporate system, which can be implemented in any organization to manage customer support requests and field support personnel.

What you will learn

  • Automate geospatial analysis workflows using Python
  • Code the simplest possible GIS in just 60 lines of Python
  • Create thematic maps with Python tools such as PyShp, OGR, and the Python Imaging Library
  • Understand the different formats 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

Who this book is for

This book is for Python developers, researchers, or analysts who want to perform geospatial modeling and GIS analysis with Python. Basic knowledge of digital mapping and analysis using Python or other scripting languages will be helpful.

Downloading the example code for this ebook: You can download the example code files for this ebook on GitHub at the following link: https://github.com/PacktPublishing/Learning-Geospatial-Analysis-with-Python-Third-Edition. If you require support please email: customercare@packt.com

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Learning Geospatial Analysis with Python Third Edition
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. Section 1: The History and the Present of the Industry
  8. Learning about Geospatial Analysis with Python
    1. Technical requirements
    2. Geospatial analysis and our world
    3. History of geospatial analysis
    4. GIS
    5. Remote sensing
    6. Elevation data
    7. Computer-aided drafting
    8. Geospatial analysis and computer programming
      1. Object-oriented programming for geospatial analysis
    9. The importance of geospatial analysis
    10. GIS concepts
      1. Thematic maps
      2. Spatial indexing
      3. Metadata
      4. Map projections
      5. Rendering
    11. Remote sensing concepts
      1. Images as data
      2. Remote sensing and color
    12. Common vector GIS concepts
      1. Data structures
        1. Geospatial rules about polygons
      2. Buffer
      3. Dissolve
      4. Generalize
      5. Intersection
      6. Union
      7. Join
    13. Common raster data concepts
      1. Band math
      2. Change detection
      3. Histogram
      4. Feature extraction
      5. Supervised and unsupervised classification
    14. Creating the simplest possible Python GIS
      1. Getting started with Python
      2. Building a SimpleGIS
        1. Setting up the data model
        2. Rendering the map 
    15. Summary
    16. Further reading
  9. Learning Geospatial Data
    1. Getting an overview of common data formats
    2. Understanding data structures
      1. Common traits
    3. Understanding spatial indexing
      1. Spatial indexing algorithms
        1. Quadtree index
        2. R-tree index
      2. Grids
    4. What are overviews?
    5. What is metadata?
    6. Understanding the file structure
    7. Knowing the most widely used vector data types
      1. Shapefiles
      2. CAD files
      3. Tag-based and markup-based formats
      4. GeoJSON
      5. GeoPackage
    8. Understanding raster data types
      1. TIFF files
      2. JPEG, GIF, BMP, and PNG
      3. Compressed formats
      4. ASCII Grids
      5. World files
    9. What is point cloud data?
      1. LIDAR
    10. What are web services?
    11. Understanding geospatial databases
    12. Summary
    13. Further reading
  10. The Geospatial Technology Landscape
    1. Technical requirements
    2. Understanding data access
      1. GDAL
        1. GDAL and raster data
        2. GDAL and vector data
    3. Understanding computational geometry
      1. The PROJ projection library
      2. CGAL
      3. JTS
      4. GEOS
      5. PostGIS
      6. Other spatially enabled databases
        1. Oracle Spatial and Graph
        2. ArcSDE
        3. Microsoft SQL Server
        4. MySQL
        5. SpatiaLite
        6. GeoPackage
      7. Routing
        1. Esri Network Analyst and Spatial Analyst
        2. pgRouting
    4. Understanding desktop tools (including visualization)
      1. Quantum GIS
      2. OpenEV
      3. GRASS GIS
      4. gvSIG
      5. OpenJUMP
      6. Google Earth
      7. NASA WorldWind
      8. ArcGIS
    5. Understanding metadata management
      1. Python's pycsw Library
      2. GeoNode
      3. GeoNetwork
    6. Summary
    7. Further reading
  11. Section 2: Geospatial Analysis Concepts
  12. Geospatial Python Toolbox
    1. Technical requirements
    2. Installing third-party Python modules
    3. Python virtualenv
    4. Conda
    5. Installing GDAL
      1. Windows
      2. Linux
      3. macOS X
    6. Python networking libraries for acquiring data
      1. The Python urllib module
      2. The Python requests module
      3. FTP
    7. ZIP and TAR files
    8. Python markup and tag-based parsers
      1. The minidom module
      2. ElementTree
      3. Building XML using ElementTree and Minidom
      4. Well-Known Text (WKT)
    9. Python JSON libraries
      1. The json module
      2. The geojson module
    10. OGR
    11. PyShp
    12. dbfpy
    13. Shapely
    14. Fiona
    15. ESRI shapefile
    16. GDAL
    17. NumPy
    18. PIL
    19. PNGCanvas
    20. GeoPandas
    21. PyMySQL
    22. PyFPDF
    23. Geospatial PDF
    24. Rasterio
    25. OSMnx
    26. Jupyter
    27. Conda
    28. Summary
    29. Further reading
  13. Python and Geographic Information Systems
    1. Technical requirements
    2. Measuring distance
      1. Using the Pythagorean theorem
      2. Using the haversine formula
      3. Using the Vincenty formula
    3. Calculating line direction
    4. Understanding coordinate conversion
    5. Understanding reprojection
    6. Understanding coordinate format conversion
    7. Calculating the area of a polygon
    8. Editing shapefiles
      1. Accessing the shapefile
        1. Reading shapefile attributes
        2. Reading shapefile geometry
      2. Changing a shapefile
      3. Adding fields
      4. Merging shapefiles
        1. Merging shapefiles with dbfpy
      5. Splitting shapefiles
        1. Subsetting spatially
      6. Performing selections
        1. The point-in-polygon formula
        2. Bounding box selections
        3. Attribute selections
    9. Aggregating geometry
    10. Creating images for visualization
      1. Dot density calculations
      2. Choropleth maps
      3. Using spreadsheets
      4. Creating heat maps
    11. Using GPS data
    12. Geocoding
    13. Multiprocessing
    14. Summary
  14. Python and Remote Sensing
    1. Technical requirements
    2. Swapping image bands
    3. Creating histograms
    4. Performing a histogram stretch
    5. Clipping images
    6. Classifying images
    7. Extracting features from images
    8. Understanding change detection
    9. Summary
    10. Further reading
  15. Python and Elevation Data
    1. Accessing ASCII Grid files
      1. Reading grids
      2. Writing grids
    2. Creating a shaded relief
    3. Creating elevation contours
    4. Working with LIDAR data
      1. Creating a grid from the LIDAR data
      2. Using PIL to visualize LIDAR data
      3. Creating a triangulated irregular network
    5. Summary
    6. Further reading
  16. Section 3: Practical Geospatial Processing Techniques
  17. Advanced Geospatial Python Modeling
    1. Technical requirements
    2. Creating a normalized difference vegetative index
      1. Setting up the framework
      2. Loading the data
      3. Rasterizing the shapefile
      4. Clipping the bands
      5. Using the NDVI formula
      6. Classifying the NDVI
      7. Additional functions
      8. Loading the NDVI
      9. Preparing the NDVI
      10. Creating classes
    3. Creating a flood inundation model
      1. The flood fill function
      2. Predicting flood inundation
    4. Creating a color hillshade
    5. Performing least cost path analysis
      1. The simple A* algorithm
      2. Generating the test path
      3. Viewing the test output
      4. The real-world example
      5. Loading the grid
      6. Defining the helper functions
      7. The real-world A* algorithm
      8. Generating a real-world path
    6. Converting the route to a shapefile
    7. Routing along streets
    8. Geolocating photos
    9. Calculating satellite image cloud cover
    10. Summary
  18. Real-Time Data
    1. Technical requirements
    2. Limitations of real-time data
    3. Using real-time data
    4. Tracking vehicles
      1. The NextBus agency list
      2. The NextBus route list
      3. NextBus vehicle locations
      4. Mapping NextBus locations 
    5. Storm chasing
    6. Reports from the field
    7. Summary
  19. Putting It All Together
    1. Technical requirements
    2. Understanding a typical GPS report
    3. Building a GPS reporting tool
      1. Initial setup
      2. Working with utility functions
      3. Parsing the GPX
      4. Getting the bounding box
      5. Downloading map and elevation images
      6. Creating the hillshade
      7. Creating maps
      8. Locating the photo
      9. Measuring elevation
      10. Measuring distance
      11. Retrieving weather data
    4. Summary
    5. Further reading
  20. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Learning Geospatial Analysis with Python - Third Edition
  • Author(s): Joel Lawhead
  • Release date: September 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781789959277