RustProof Labs: blogging for education (logo)
My book Mastering PostGIS and OpenStreetMap is available!

Book Release! Mastering PostGIS and OpenStreetMap

By Ryan Lambert -- Published October 01, 2022

I'm excited to announce my book, Mastering PostGIS and OpenStreetMap, is available to purchase as of October 1, 2022! This book provides a practical guide to introduce readers to PostGIS, OpenStreetMap data, and spatial querying. Queries used for examples are written against real OpenStreetMap data (included) to help you learn how to navigate and explore complex spatial data. The examples start simple and quickly progress through a variety of clever spatial queries and powerful techniques.

Section 12.3, Create Denver specific tables, is available as a free preview section. The full Table of Contents is available from the free preview page.

Who is this book for?

Mastering PostGIS and OpenStreetMap is for anyone that wants to learn more about PostGIS and/or OpenStreetMap data. The hefty Appendix helps keep new users on track without distracting users with more experience. The following table gives an idea of the topics covered.

Topic Included?
Install PostGIS
Spatial SQL queries
Basics of OpenStreetMap tagging
Load OpenStreetMap data to PostGIS
Find and use local SRIDs everywhere
Handle real-world (dirty!) data
Performance of Geometry vs. Geography

Routing with pgRouting is the core topic of four (4) of the 18 chapters! The routing chapters show the importance of understanding your data structure and definitions, building an appropriate model, data minimization to maintain performance, and the use of functions and stored procedures for advanced logic.

The data set used throughout is a Colorado OpenStreetMap extract from 2020. The use of a real data set in all of its messy glory provides the opportunity to work through real-world data challenges.

Formats available

The initial release of Mastering PostGIS and OpenStreetMap has three (3) eBook formats, with more formats likely to be added in the future. There is one purchase option providing access to the book all digital formats: in-browser (HTML), ePub, and PDF. The book was designed for browser-first reading in mind due to the prevalence of code examples and liberal use of bookmarks for those examples you want to easily reference in the future. There are hundreds of queries intended to be copied and pasted into your local PostGIS environment while you follow along. Every example in the book has been tested to work with the provided OpenStreetMap extract.

Each eBook format has its own ISBN. They are all included with a single purchase.

If there is a specific format you would like to see added please let us know.

Tip: When reading on a tablet or smart phone, landscape mode provides the best experience.

Behind the book

While my name is on the book as the author, this book did not happen in a vacuum. Throughout this project I have had a number of experiences, influences, sounding boards, and reality checks... you know who you are! That said, a couple big shout outs are in order.

First and foremost on my Thank You list: Julie. Thank you! This massive project would not have been seen through to completion without your consistent support and encouragement. You listened to me ramble on about maps and queries and data nuances and dirty data and performance and more maps. After all that, you still edited from cover to cover. "Thank you" doesn't even begin to cover it.

Next up is the core of what Mastering PostGIS and OpenStreetMap is all about: PostGIS and OpenStreetMap! The amazing communities and ecosystems involved with these projects make everything I wrote about in this book possible. To give back to PostGIS and OpenStreetMap, 10% of all revenue from sales of Mastering PostGIS and OpenStreetMap will be split. PostGIS contributions will be made as outlined on their sponsor page; OpenStreetMap contributions will be made as outlined on their donate page. And yes, that's 10% of revenue. When you spend $99.99 on your copy, that's $5 to PostGIS and $5 to OpenStreetMap before any other expenses are factored in.

What's next?

I get to write more blog posts again! I have a few topics queued up that I've been wanting to write. Some are even well underway and just need polishing. I'm also looking forward to the #PSQLPhriday blog event Ryan Booz from Timescale DB has organized. The first monthly topic is coming up in a few days (10/7/2022). I hope a lot of folks will get involved with that initiative and we get see a wide variety of takes on common themes.


I am beyond excited to have Mastering PostGIS and OpenStreetMap out in the wild. I hope this is a resource that can help you turn spatial data challenges into success stories!

Book cover for Mastering PostGIS and OpenStreetMap.  The image shows a route (dotted green line) through Denver, Colorado starting at Union Station and ending at McNichols Civic Center Building. This route is the example used in Chapter 15!

Need help with your PostgreSQL servers or databases? Contact us to start the conversation!

By Ryan Lambert
Published October 01, 2022
Last Updated August 10, 2023