Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Preface

Department of Geography & Sustainability, University of Tennessee, Knoxville

Abstract

This book is a hands-on guide to GeoAI, the intersection of geospatial science and artificial intelligence. Through 23 chapters of executable Python examples, it takes readers from environment setup and geospatial data preparation through core deep learning tasks (image recognition, object detection, semantic segmentation, instance segmentation, image translation, change detection, and pixel-level regression) to cutting-edge foundation models including the Segment Anything Model (SAM), vision-language models, and satellite embeddings. A dedicated section on QGIS plugins shows how to run these AI workflows without writing code. Designed for GIS professionals, remote sensing scientists, and Python developers, the book uses only open-source tools and real-world satellite imagery throughout.

Introduction

We are in the midst of a revolution in Earth observation. Each day, satellites capture a massive volume of data, including multispectral images, radar, LiDAR, and more. While this information holds the keys to understanding climate vulnerability and urbanization, the gap between data collection and real-world application has remained a major hurdle.

This is where GeoAI comes in.

As the intersection of geospatial science and AI, GeoAI is closing this gap at an incredible pace. Deep learning models can now identify every building at scale or pinpoint individual vehicles across vast areas. New foundation models allow these tools to work in unfamiliar environments with minimal human input. Furthermore, vision-language models and autonomous agents are enabling analysts to query imagery and manage workflows using simple commands. The manual digitization tasks that once took months are now being completed in a matter of minutes.

This book, “GeoAI with Python: A Practical Guide to Open-Source Geospatial AI,” is your practical guide to this revolution. It is built on a simple premise: the best way to learn GeoAI is by doing it. Rather than dwelling on abstract theory, every chapter puts real tools in your hands, from preparing training datasets and running deep learning models to visualizing and interpreting your results interactively. The code is real, the datasets are real, and the problems mirror what practitioners encounter every day.

The Python ecosystem for GeoAI has matured dramatically. Libraries like PyTorch, torchgeo, and segment-geospatial bring state-of-the-art deep learning to geospatial practitioners, while packages such as leafmap and geoai provide high-level interfaces that make complex workflows accessible. Cloud computing platforms and GPU acceleration have lowered the barrier to training and deploying models at scale. Together, these advances mean that a researcher with a laptop can now accomplish what once required a team of specialists and a room full of servers.

Our journey begins with the foundations: understanding geospatial data formats, setting up a deep learning environment, and mastering interactive visualization. We then cover the essential work of acquiring satellite imagery and preparing training datasets. From there, we progress through the core AI tasks that define modern remote sensing: image recognition, object detection, semantic segmentation, instance segmentation, image translation, change detection, and pixel-level regression. We then explore the frontier of foundation models, including the Segment Anything Model (SAM), vision-language models, and satellite embeddings. Finally, a dedicated section on QGIS plugins brings these AI capabilities into a familiar desktop GIS environment, enabling sophisticated workflows without writing code.

Whether you are a GIS professional seeking to integrate AI into your workflows, a data scientist curious about geospatial applications, a researcher pushing the boundaries of Earth observation, or a student embarking on a career at the intersection of geography and machine learning, this book will equip you with the knowledge and skills to turn satellite imagery into insight.

The future of geospatial analysis is intelligent, automated, and accessible. Let us build it together.

Who This Book Is For

This book is designed for anyone who wants to apply artificial intelligence to geospatial data. If you’ve ever stared at a satellite image wondering how to extract buildings, roads, or land cover automatically, or if you’ve trained deep learning models but struggled to apply them to geographic data with projections, coordinates, and massive file sizes, this book is for you.

You’ll Find the Most Value If You Are

A GIS Professional ready to move beyond manual digitization and visual interpretation. You’re proficient with QGIS or ArcGIS and understand spatial analysis concepts, but you want to harness deep learning to automate feature extraction, classify land cover at scale, or detect changes across time-series imagery.

A Remote Sensing Scientist or Researcher working with satellite or aerial imagery. You understand spectral bands, spatial resolution, and image preprocessing, but you need a practical bridge to modern AI techniques, from training segmentation models to applying foundation models like SAM to your study areas.

A Data Scientist or Machine Learning Engineer with experience in deep learning who wants to apply your skills to geospatial problems. You’re comfortable with PyTorch or TensorFlow and understand CNNs and transformers, but you need guidance on the unique challenges of geographic data: coordinate reference systems, tiling large rasters, handling multi-band imagery, and georeferencing model outputs.

A Graduate Student or Early-Career Researcher in geography, environmental science, urban planning, ecology, or a related field. Your research involves spatial data, and you want to incorporate cutting-edge AI methods into your thesis or publications while building skills that are increasingly in demand.

A Software Developer building geospatial applications that require intelligent analysis. You need to integrate AI-powered feature extraction, classification, or change detection into web applications, APIs, or automated pipelines, and you want to understand the full workflow from model training to deployment.

Essential Prerequisites

You should be comfortable with:

Helpful Background (But Not Required)

If You’re New to Geospatial Python Programming

If you’re new to geospatial Python programming, the following book provides an excellent introduction to both foundational GIS concepts and Python programming:

Wu, Q. (2025). Introduction to GIS Programming: A Practical Python Guide to Open Source Geospatial Tools. Independently published. PDF edition ISBN 9798993859712; Print edition ISBN 979-8286979455. Available at gispro.gishub.org.

For those interested in spatial data management and SQL-based geospatial analytics, the companion book offers a comprehensive guide:

Wu, Q. (2025). Spatial Data Management with DuckDB. Independently published. PDF edition ISBN 979-8993859705; Print edition ISBN 979-8274710572. Available at duckdb.gishub.org.

What This Book Covers

This book offers a structured journey from geospatial fundamentals to production-ready GeoAI applications, equipping you with practical skills through hands-on examples at every step. Each chapter builds on the previous, progressively expanding your ability to apply AI to real-world geospatial problems.

Part I: Foundations (Chapters 1–3)

Establish the essential knowledge and tools that underpin all subsequent content:

By the end of Part I, you’ll have a fully configured deep learning environment and a solid understanding of the data formats and concepts needed to work with GeoAI.

Part II: Data Acquisition and Preparation (Chapters 4–6)

Master the critical but often underappreciated work of obtaining and preparing geospatial data for AI:

By the end of Part II, you’ll be able to acquire satellite imagery from multiple sources, visualize it interactively, and prepare well-structured training datasets ready for deep learning models.

Part III: Core AI Tasks (Chapters 7–13)

Dive into the fundamental AI tasks that define modern geospatial analysis:

By the end of Part III, you’ll have hands-on experience with all major GeoAI tasks, understand when to apply each approach, and be able to train and evaluate models for your own geospatial applications.

Part IV: Foundation Models and Satellite Embeddings (Chapters 14–16)

Explore the cutting edge of GeoAI, where pre-trained foundation models are redefining what’s possible:

By the end of Part IV, you’ll understand how foundation models are reshaping GeoAI, and you’ll be equipped to apply these advanced techniques to your own research and projects.

Part V: QGIS Plugins (Chapters 17–23)

Bring GeoAI capabilities into the familiar QGIS desktop GIS environment through the GeoAI plugin:

By the end of Part V, you’ll be able to run sophisticated GeoAI workflows directly within QGIS, making AI-powered analysis accessible to GIS practitioners without requiring Python programming expertise.

Cross-Cutting Themes Throughout

Getting the Most Out of This Book

To maximize your learning experience with this book, consider the following recommendations:

Set Up Your Environment Early: Follow Chapter 2 carefully to configure your Python environment with GPU support. Many GeoAI tasks benefit significantly from GPU acceleration, and a properly configured environment will save you considerable time throughout the book. If you don’t have a local GPU, the book provides guidance on using cloud-based GPU platforms like Google Colab.

Follow Along with the Code: This book is designed to be interactive. Don’t just read the code. Type it out, run it, and observe the results. Modify parameters, try different datasets, and experiment. Understanding comes through practice, and the hands-on examples are the heart of this book. When something does not work as expected, resist the urge to skip ahead. Debugging is one of the most valuable learning experiences, and the troubleshooting skills you develop will serve you throughout your GeoAI career.

Work Through the Chapters Sequentially: While experienced practitioners may jump to specific topics, the chapters build on each other. Concepts introduced in earlier chapters (environment setup, data formats, visualization techniques) are used throughout the book. If you skip ahead, refer back when needed.

Use Your Own Data: While the book provides datasets for every example, the real learning happens when you apply these techniques to data you care about. Try running the segmentation models on imagery of your study area, or train an object detection model on features relevant to your research.

Embrace the Errors: Training deep learning models involves iteration. Models won’t always converge on the first try, predictions won’t always be perfect, and GPUs will occasionally run out of memory. These are learning opportunities. The book addresses common pitfalls and debugging strategies, but developing the instinct to diagnose problems comes through experience.

Build a Portfolio Project: As you progress through the book, identify a geospatial problem that interests you and apply the techniques you’re learning. A complete project, from data acquisition to model training to visualization, demonstrates your skills far more effectively than any certification.

Stay Current: GeoAI is a rapidly evolving field. New foundation models, architectures, and tools emerge regularly. The book’s GitHub repository is updated periodically with new content and examples for continuing your learning journey.

Conventions Used in This Book

This book uses several conventions to help you navigate the content and understand the code examples:

Code Formatting: All Python code appears in monospaced font within code blocks. When code appears within regular text, it is formatted like this. File and directory names, package names, and function names are also formatted in monospaced font.

Code Examples: Most code examples are complete and runnable. They include comments explaining the key concepts and techniques being demonstrated. Here is a typical example using the leafmap library:

import leafmap

m = leafmap.Map(center=[40, -100], zoom=4)
m.add_basemap("Esri.WorldImagery")
m

Package Imports: At the beginning of each chapter, all required imports are listed. Key packages you’ll encounter throughout the book include:

Figures and Maps: Interactive maps are rendered directly in Jupyter notebooks. In the print edition, static snapshots are shown with captions describing the interactive features available in the online version.

Downloading the Code Examples

All code examples and supplementary materials for this book are freely available on GitHub: https://github.com/giswqs/GeoAI-Book

All sample datasets are available at Source Cooperative: https://source.coop/opengeos/geoai

To download the materials, you can use one of the following methods:

The repository is regularly updated with corrections, improvements, and additional examples. Check back periodically for updates, or star and watch the repository on GitHub to be notified of changes.

If you find errors in the code or have suggestions for improvements, please open an issue or submit a pull request on GitHub. Community contributions help make this resource better for everyone.

Video Tutorials

Complementing the written content, this book is supported by video tutorials that walk through key concepts and provide additional demonstrations:

https://youtube.com/@giswqs

The videos are designed to complement, not replace, the written material. They are particularly helpful for:

Additional video tutorials will be added as the book evolves. Subscribe to the channel to stay notified of new content.

Community and Feedback

I welcome feedback, questions, and suggestions from readers. Your input helps improve the book and makes it more useful for the GeoAI community.

For book-related questions and discussions:

For package-specific questions:

Types of feedback that are particularly helpful:

About the Author

Dr. Qiusheng Wu is an Associate Professor and the Director of Graduate Studies in the Department of Geography & Sustainability at the University of Tennessee, Knoxville. He also serves as an Amazon Scholar. Dr. Wu’s research focuses on advancing open-source geospatial analytics through cloud computing and GeoAI, with an emphasis on leveraging big geospatial data and artificial intelligence to study environmental change, particularly surface water and wetland inundation dynamics.

He is the creator and maintainer of several widely used open-source Python packages, including geemap [1] for interactive Google Earth Engine visualization, leafmap [2] for versatile geospatial mapping, segment-geospatial [3] for applying the Segment Anything Model to geospatial data, and geoai [4] for high-level GeoAI workflows. His open-source projects, available through the Open Geospatial Solutions [5] organization on GitHub, have been widely adopted by researchers, educators, and practitioners worldwide.

Dr. Wu’s work bridges remote sensing, Earth observation, and artificial intelligence to make large-scale geospatial data more accessible, reproducible, and intelligent. He is passionate about open science and believes that the best tools for understanding our planet should be freely available to everyone.

This book embraces the principles of open science and open education. To support transparency, learning, and reuse, the code examples in this book are released under a Creative Commons Attribution 4.0 International (CC BY 4.0) license. This means you are free to copy, modify, and distribute the code, even for commercial purposes, as long as appropriate credit is given.

Please attribute code usage by citing the book or linking to the GitHub repository:

Wu, Q. (2026). GeoAI with Python: A Practical Guide to Open-Source Geospatial AI. Independently published. PDF edition ISBN 979-8993859729; Print edition ISBN 979-8253507414. Available at book.opengeoai.org.

While the code is freely available, the text, figures, and images in this book are copyrighted © 2026 by the author and may not be reproduced, redistributed, or modified without explicit permission. This includes all written content, custom diagrams, and embedded visualizations unless otherwise noted.

If you wish to reuse or adapt any non-code material from the book (for example, for teaching, presentations, or publications), please contact the author to request permission.

This dual licensing approach helps balance open access to learning materials with the protection of original creative work. Thank you for respecting these terms and supporting the open-source geospatial community.

Footnotes