Within our company we are deciding which DBMS we will use to store spatial data. IT wants MySQL with the Spatial extension because there is already knowledge about handling MySQL DB. We are doing quite simple calculations with the data. The only thing I am worried about is the polygon handling of MySQL.

Is it still true that MySQL only supports bounding box calculations instead of the real polygon geometry? Or is this problem gone with newer versions of MySQL?


Your assumption is pretty much correct. MySQL's spatial support is ... simplistic to say the least. It does work, but you'll find very few GIS applications support it. This isn't specific to just polygons, any spatial feature is more limited in MySQL because while it does store them in the same way (WKB), there simply aren't as many functions to manipulate or interogate it.

Full details of the MySQL Spatial Extension analysis functions can be found here: http://dev.mysql.com/doc/refman/5.0/en/spatial-analysis-functions.html

Compare that to Oracle Locator (their "free" spatial extension if you have Oracle Enterprise and the $$$ to match): http://docs.oracle.com/cd/B19306_01/appdev.102/b14255/sdo_locator.htm

And of course, PostGIS: http://postgis.net/docs/manual-2.0/reference.html

MS SQL Server has spatial too - http://msdn.microsoft.com/en-us/library/bb964708%28v=sql.105%29.aspx

That's before you start playing with things like topography's, geography's and rasters, none of which I believe MySQL supports. You can clearly see which of those four products is the least feature-complete for spatial data (Hint: MySQL). Its very subjective which is the winner; thats an eternal religious war that belongs in other threads. ;-)

You may only be doing very simple things with the data at this point, however going forward non-MySQL will give you more options if you decide to expand your spatial data processing/storage.


The accepted response is fairly outdated for the current state of the art.

MySQL 5.6 has decent support for the OGC data types on MyISAM tables. You probably don't want to use MyISAM tables though.

MySQL 5.7 has decent support for the OGC data types on innodb tables:

MySQL 8.0 improves on this quite a bit and adds support for srids and projected coordinate systems and generally gets things right:

Here's a comparison between 5.7 and 8.0: https://image.slidesharecdn.com/mysql-8-0-gis-are-you-ready-170203182904/95/mysql-80-gis-are-you-ready-10-638.jpg?cb=1520281401

Postgres with GIS extensions is still probably the standard for open source databases, but MySQL is fairly capable circa summer 2019.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.