GIS – When to Use a GIS-enabled Database?

spatial-database

I am a long-time programmer, new to GIS. I am trying to get a feel for the database aspects of GIS and I understand that there are some databases which are specialized for GIS use. Basically I am trying to understand whether to use such a database or to stick with the hugely popular, well established, widely supported (and free) MySql.

The sort of applications I am liable to code would things like:

  • fleet management (land or ocean based vehicles)
  • employee tracking
  • inventory control (at a granularity of a physical position accurate to with a metre or so)
  • errm, that's about it, really

I would normally expect to be tracking no more than 1 few hundred (maximum, possibly a few thousand) items. Sometimes the items will be located in the same (large) building, series of building, city, country or world-wide, depending on the application.

I will occasionally be visually representing them either on a custom floor plan of a building or, more likely, in Google Earth or the like (more of which in another question).

It seems to me that I am as well off with MySql and adding columns for lat/long or other positional data, but that might just be because I know MySql.

Is there any reason why I should be looking at a more specialized database?

Best Answer

The real advantage to spatial databases (PostGIS, spatial extensions to MySQL or anything else) is that you can do spatial operations on spatial data. If you are just storing point coordinates, then you don't really gain much from spatial (just use two numerical columns). If you store combinations of point coordinates (where the customers are), and line coordinates (where the delivery trucks go), and polygons (sales regions), and then do queries that relate those various bits of information (how many customers within a sales zone, how many trucks traveled less than 2km from a customer site today but did not make a delivery or pickup), you can gain a lot.

As pointed out by iant, PostGIS is certainly worth a look for a server application. SpatiaLite is the spatial extensions to SQLite, which may be a better fit for a desktop / embedded / offline mobile application, while offering fairly similar SQL functions [Disclosure: I work on SpatiaLite], noting that there is nothing that stops you using PostGIS in a desktop application.

Related Question