PostGIS vs. SQL Server for GIS data

I've worked with both Postgres and SQL Server. I found Postgres to be superior in GIS functionality. And while I'm going to briefly detail my findings below, I'd suggest this: Give yourself a brief but reasonable time period to review the unfamiliar solution over the one you know, with specific goals in mind. For example, maybe a 2 week time period to install and learn some specific functionality that is currently in use. If you find that you are stuck or lack functionality within that time period, then you know it's not for you. It's a investment in research that broadens your view and helps you realize you may have been missing something that you were unaware of before, or simply confirm your current course is the right now.

As far as the database goes, I found Postgres to have a shorter, and more shallow, learning curve. The documentation is just incredible. SQL Server does have quite a bit of documentation, but I find a lot of it hard to read, with not enough examples and tutorials.

PostGIS vs SQL Server Spatial is similar to the above regarding documentation, but PostGIS beats the pants off SQL Server Spatial in functionality. For example, Google Maps, and to a lesser degree Bing Maps, has recently added full geoJSON support to their maps API. Well, PostGIS can easily return a geoJSON result directly from a database query using ST_AsGeoJSON(). This geoJSON result can then be passed directly to whatever can understand geoJSON. SQL Server requires you to use additional library and processing, or use ogr2ogr. In addition PostGIS has over 300 functions available for data conversion into and out of the database, compared to SQL Server which has around 70-100.


Having worked with the GIS capabilities of both systems, I'd suggest the following:

  • If you are primarily looking to store and query geometries, their capabilities are pretty comparable.
  • If you want to perform raster operations, PostGIS is your only option without 3rd party plugins such as ArcGIS's ST_Raster. SQL Server will store an image, but forget about it if you want to do raster manipulation or queries.
  • Some would dispute this, but in general I find SQL Server to be faster and more consistent. If all other things are equal, for a production runtime, I prefer it.
  • PostgreSQL has a far richer and more elegant SQL dialect and a query processor less riddled with arbitrary restrictions. In terms of language power and elegance, there is no comparison, pgSQL makes TSQL look like child's scrawl. I've considered writing a book about how bad Transact SQL is as a means to learn good language design. :-)