Book Review: Beginning Spatial with SQL Server 2008

“Beginning Spatial with SQL Server 2008” by Alastair Aitchison is a good introduction to the geospatial features introduced in SQL Server 2008. It is primarily aimed at developers who have SQL Server experience but with limited or no geospatial experience. It is recommended for such developers who wish to build a geospatial database, or to use SQL Server as the backend database for a geospatial web application.


In recent years most, if not all, of the mainstream relational database systems have introduced a range of geospatial extensions. SQL Server is no exception, with Microsoft adding geospatial extensions in SQL Server 2008. This book serves as a good introduction to these extensions and includes both reference sections and applied examples.

The book is divided into five sections covering an introduction, creating data, presentation, analysis, and performance.

Almost half of the introduction consists of a chapter that introduces basic geospatial concepts such as polygons, shapes, projections, coordinate systems and spatial references. Although only an introduction, the spatial reference section is particularly good with comparison examples and practical information such as WKT definitions. This should help to avoid much of the confusion that spatial references attract.

The introduction also introduces the geospatial datatypes supported by SQL Server 2008, describes how to enable the  geospatial extensions, and gives examples of use. It finishes with a chapter explaining the basics of using SQL Server with .NET. Although the book generally assumes some familiarity with SQL Server, this chapter helps to ensure those without this experience are not entirely left in the dark

The section on creating spatial data includes the process of importing WKT, WKB, and GML shapes for situations where shape coordinates are known. It also covers third party data sources, and how to import tabular, KML, and Shapefile and KML data. An entire chapter looks at the creation of WKT shape definitions using a simple point&click web application based around Virtual Earth (now Bing Maps). Finally, this section looks at the process of geocoding. Although the beginning of this chaper will have some value, it relies on the MapPoint Web Service which is being discontinued at the end of 2011.

The presentation section includes a section on using the Spatial Results tab in the SQL Server Management Studio, primarily for diagnostic purposes. However the bulk of the presentation content covers web applications, and starts with a discussion of syndicated data. This might seem an odd choice, but really syndication is a way of supplying data – ie. presenting it to a client application. This chapter covers the creation of GeoRSS feeds, and plotting a GeoRSS feed in both Google Maps and Virtual Earth.  This is followed by a discussion of Web Mapping Services. This is not actually a WMS tile server, but the display of SQL Server spatial data in a Google Maps and Virtual Earth AJAX client. This is probably the most useful section for our readers.

The analysis section covers spatial object properties, modifying spatial objects, and testing their relationships. This is the most reference-like section of the book, and lists the various properties and tests that can be applied. It is generally an abstract section, and it is an exercise for the reader to apply the tests to their application. Some of the operations have code examples.

The final section covers performance issues and indexing. This is very important for most database applications, but is especially important in geospatial databases where relationship calculations are computationally intensive and not necessarily intuitive. In conclusion, this is recommended for those who are already familiar with SQL Server but who are looking to us it for geospatial applications or to use it as a backend database for a geospatial web application. It should also prove useful for those with geospatial knowledge who need to use SQL Server’s geospatial extensions for the first time. Such readers may find that a general SQL Server book will prove to be a good complement to this text.

Leave a Reply