(When) should I use a GIS-enabled database?

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.


You should certainly consider the hugely popular, well established, widely supported (and free) PostGIS. It will do every thing that MySQL can do and handle spatial locations as first class objects. Thus you can carry out selections based on points with in a bounding box (or other polygon) without having to write out all the comparisons etc.

Once you start to need to ask questions like which objects are in which country (or building) then PostGIS really comes into it's own and should you decide that you need to map your objects then all the popular open source tools will talk to PostGIS out of the box.


To add to the answers and reiterate some points, one uses a spatially-enabled database if you have queries that relate to the spatial relations of the data, a few of which are the following:

  1. which points are within x kilometers of my points of interest
  2. which points are nearer
  3. how far a point is from other point
  4. which points are x kilometers within the access road

If such queries relating to WHERE is a significant feature for an application, then usually it strongly recommended to use a spatial database.

Of course, one can resort to coding / application logic for some of this queries, such as using the distance formula for 1, but one does not need to reinvent the wheel.