Sponsored Links

Book Review: Python Geospatial Development PDF Print E-mail
Written by Richard Marsden   
Monday, 30 May 2011 19:05

"Python Geospatial Development" by Erik Westra (URL) provides a good introduction to geospatial development with Python. Python is ideal for "swiss army knife" geospatial operations, but the book concentrates on the development of applications including geospatial databases and Django-based geospatial web applications.

 

 


Python is an increasingly popular scripting language that is capable of heavy processing as well as prototyping and "swiss army knife" scripting. As such, it is becoming increasingly popular for a range of geospatial applications. This book covers many of the applications, libraries, and toolkits that can be used with Python in order to use it for geospatial work. It culminates in a complete Django-based geospatial web application.

An initial chapter of "core GIS concepts" cover subjects such as coordinate systems, projections, and distances. Compared to many books, this section is very short but should be a good enough introduction considering the generally technical audience that will be reading the book.

The next two chapters introduce some relatively basic geospatial libraries, and some data sources. The book is then able to build on these to solve tasks and build applications. Most of the libraries are actually C++ based but come with Python bindings or interfaces. Libraries introduced include GDAL/OGR, PyProj (wrapper for Proj.4), Geod, Shapely, and Mapnik. Initial coverage is very basic and covers little beyond installation. However, once the libraries have been introduced, later chapters can use them in a more productive manner. The data sources give a similar level of introductory coverage, but is more thorough than similar chapters in other books. Most, if not all, sources are free or partially free.

Finally, the book can start to perform some geospatial tasks with Python. Examples include polygon bounding box calculations, analyzing digital elevation models, querying shapes, converting between units, and performing shapefile manipulations.

This is followed by a look at geospatial databases. After a quick look at what makes a database spatially-enabled, the book introduces PostGIS (with psycopg), MySQL, and SpatiaLite (with pysqlite). MySQL is popular for webservers, and PostGIS is popular in open source geospatial stacks. SpatiaLite is less function but is faster. The final application uses PostGIS. Most readers will probably choose their database according to what is available or what they need to use with the database. If they do not have an implementation-specific database book already, then they will probably need one to expand upon the introduction and comparison coverage that has been provided.

Before embarking on a complete web application, the book discusses a hypothetical web application that queries shorelines, towns, and lakes. This is used to look at a range of issues, including the handling of large amounts of data in a scalable manner, complex spatial queries, limiting queries by distance, and improving an application's design and implementation. Code is provided primarily as an illustration, but it is real code accompanied by real architectural diagrams, and references real (free) data. Therefore it should be possible for a student to use this chapter as a framework for building a real, working application. Even if a working application is not created, the reader should learn a lot from this chapter if they take the time to work through it step-by-step.

The next chapter gives a substantial overview of Mapnik for map rendering. This overview is much greater than that given for other libraries and packages. Map rendering is important so it deserves substantial coverage, but I would argue that a similarly large chapter should have been devoted to PostGIS.

The final chapters introduce web-specific frameworks, and then put everything together to create a work Django-based geospatial web application. The framework coverage includes web services (eg. UMN MapServer), tile caching (TileCache), user interface libraries (OpenLayers and Mapiator), and application frameworks (Django and GeoDjango).

All things considered, this is an excellent introduction to geospatial processing with Python. It leans towards building web applications, but should also be useful for people working offline. The book is an overview, and should introduce the various libraries, and applications. However, coverage is quite shallow in places. For example, it might show you how to use Python with PostGIS and GDAL/OGR, but you will need to look elsewhere for good coverage of PostGIS and GDAL/OGR topics.

 


Addenda (May 2013): The above review is for the book's first edition. I recently served as a technical editor for the second edition of this book, which has just been published.

 


Last Updated on Monday, 03 June 2013 15:16