Historically, the open-source spatial analysis workflows lived in different silos
- Python: You use Pandas, GeoPandas, and Jupyter Notebooks.
- SQL: You use SQL with PostGIS.
If you lived in the Python ecosystem, you rarely have to switch to SQL for analysis and vice versa. Many people, including me, had little motivation to sharpen their SQL skills when you could get away with doing things in Python. Many of our students who wanted to learn SQL, found themselves choosing between these two stacks and found SQL had a much higher friction to get started.
Recently, I have been using DuckDB and find that it is the perfect bridge between these two ecosystems. DuckDB + Python + LLMs provide the easiest and most rewarding pathway for Python users to learn and incorporate SQL in their workflows.
In this post, we will cover the following topics
- What is DuckDB?
- Using DuckDB to learn SQL with the help of LLMs
- Example Workflow with LLMs
- Querying and Loading Administrative Boundaries from GeoBoundaries
- Advanced Workflows
- Extracting Overture Maps Data
- Extracting Farm Boundaries from Global Fields of The World (FTW)
Open our companion notebook learning_sql_duckdb.ipynb in Google Colab to follow along and run the queries yourself.
Continue reading





