Book Image

Learning Geospatial Analysis with Python - Fourth Edition

By : Joel Lawhead
4 (1)
Book Image

Learning Geospatial Analysis with Python - Fourth Edition

4 (1)
By: Joel Lawhead

Overview of this book

Geospatial analysis is used in almost every domain you can think of, including defense, farming, and even medicine. In this special 10th anniversary edition, you'll embark on an exhilarating geospatial analysis adventure using Python. This fourth edition starts with the fundamental concepts, enhancing your expertise in geospatial analysis processes with the help of illustrations, basic formulas, and pseudocode for real-world applications. As you progress, you’ll explore the vast and intricate geospatial technology ecosystem, featuring thousands of software libraries and packages, each offering unique capabilities and insights. This book also explores practical Python GIS geospatial applications, remote sensing data, elevation data, and the dynamic world of geospatial modeling. It emphasizes the predictive and decision-making potential of geospatial technology, allowing you to visualize complex natural world concepts, such as environmental conservation, urban planning, and disaster management to make informed choices. You’ll also learn how to leverage Python to process real-time data and create valuable information products. By the end of this book, you'll have acquired the knowledge and techniques needed to build a complete geospatial application that can generate a report and can be further customized for different purposes.
Table of Contents (18 chapters)
1
Part 1:The History and the Present of the Industry
5
Part 2:Geospatial Analysis Concepts
11
Part 3:Practical Geospatial Processing Techniques

GeoPandas

pandas is a high-performance Python data analysis library that can handle large datasets that are tabular (similar to a database), ordered/unordered, labeled matrices, or unlabeled statistical data. GeoPandas is simply a geospatial extension to pandas that builds upon Shapely, Fiona, PyProj, matplotlib, and Descartes, all of which must be installed. It allows you to easily perform operations in Python that would otherwise require a spatial database such as PostGIS.

As GeoPandas has so many complex dependencies, we’ll create a separate environment for it in Anaconda to keep things clean. First we need to deactivate our current environment:

conda deactivate lgawp4

Next we’ll create a new one for GeoPandas:

conda create -n geopandas python=3.10.9

Then we can activate it as follows:

conda activate geopandas

Then we need to install GeoPandas itself:

conda install geopandas

The following script opens a shapefile and dumps it into GeoJSON. Then...