Spatial Data Management with DuckDB#

image image

Introduction#

Welcome to the official repository for Spatial Data Management with DuckDB: From SQL Basics to Advanced Geospatial Analytics. This repository contains all the code examples featured in the book, designed to help you learn and apply DuckDB for geospatial analysis.

Get the Book#

  • 🇺🇸 English Full-Color Print Edition (400 pages): Coming soon.

  • 🇺🇸 English PDF Edition (400 pages): Available on Leanpub (link)

Cite the Book#

If you use this book in your research or teaching, please consider citing it as follows:

Wu, Q. (2025). Spatial Data Management with DuckDB: From SQL Basics to Advanced Geospatial Analytics. Independently published. https://duckdb.gishub.org

book cover

Table of Contents#

  • Preface

    • Introduction

    • Who This Book Is For

    • What This Book Covers

    • Getting the Most Out of This Book

    • Conventions Used in This Book

    • Downloading the Code Examples

    • Video Tutorials and Supplementary Resources

    • Community and Feedback

    • Acknowledgments

    • About the Author

    • Licensing and Copyright

  • DuckDB Foundations

    • Getting Started with DuckDB

    • Essential SQL for Spatial Analysis

    • DuckDB Python Integration

  • Spatial Data Operations

    • Loading Spatial Data Formats

    • Exporting and Converting Spatial Data

    • Geometry Operations and Functions

    • Spatial Queries and Relationships

    • Advanced Spatial Joins

    • Interactive Data Visualization

    • Working with Vector Tiles and PMTiles

  • Real-World Geospatial Analytics

    • Analyzing the US National Wetlands Inventory

    • Analyzing Global Building Footprints

    • Analyzing NYC Taxi Data

    • Developing Interactive Dashboards with Streamlit and Solara

How to Run Code Examples#

The code examples are organized into folders, each corresponding to a chapter in the book. The code examples are written in Python and can be run using MyBinder, Google Colab, or Docker.

Using MyBinder#

The code examples can be run using MyBinder.

image

Using Google Colab#

The code examples can be run using Google Colab.

image

Video Tutorials#

Complementing the written content, this book is supported by a comprehensive series of video tutorials that walk through key concepts and provide additional examples:

https://www.youtube.com/playlist?list=PLAxJ4-o7ZoPe9SkgnophygyLjTDBzIEbi

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

  • Visual learners who benefit from seeing code being written and executed

  • Understanding complex concepts through multiple explanations

  • Learning about the development workflow and best practices

  • Seeing how to approach problems and debug issues

The playlist is organized to follow the book’s structure. You can watch them in order as you progress through the book, or jump to specific topics as needed.

The videos were created in Fall 2023 when I was teaching the Spatial Data Management course at the University of Tennessee. Although the course has concluded, the videos remain relevant and can be used as a reference for the book. Additional videos will be added in the future.

About the Author#

Dr. Qiusheng Wu is an Associate Professor in the Department of Geography & Sustainability at the University of Tennessee, Knoxville. He is also an Amazon Scholar. Dr. Wu’s research focuses on advancing open-source geospatial analytics through cloud computing and GeoAI. He is the creator and maintainer of several widely used open-source Python packages, including Geemap [1], Leafmap [2], SAMGeo [3], and GeoAI [4], which integrate cloud-based geospatial platforms with AI-powered analysis and visualization. Dr. Wu’s work bridges remote sensing, Earth observation, and artificial intelligence to make large-scale geospatial data more accessible, reproducible, and intelligent for researchers, educators, and practitioners worldwide. His open-source projects can be found on GitHub at opengeos.