0

I am trying to figure out how to using the ST_AsGeoJSON function in MySQL, but I keep getting an error that says that this function does not exist. I have found in the MySQL documentation that this spatial function does exist.

mysql> SELECT ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2);

https://dev.mysql.com/doc/refman/8.0/en/spatial-geojson-functions.html

My current setup is Windows 10 with XAMPP with Wordpress.

  • What's your exact MySQL version? (should be somewhere in the XAMPP documentation for your particular installation, or see stackoverflow.com/questions/8987679/… ) – IvanSanchez Aug 16 '18 at 14:08
  • Thanks for responding. My version is 10.1.32-MariaDB. I just did some research and learned that this function is not supported in MariaDB until version 10.2. I will try to upgrade my db to see if that fixes the problem. – Jacob Todd Aug 17 '18 at 20:11
1

It turns out that MariaDB did not begin supporting spatial functions until version 10.2. To resolve my issue I simply upgraded my version of MariaDB from 10.1.32 to version 10.3. This however, took quite a bit of configuration to get XAMPP and PhpMyAdmin to perform correctly.

MariaDB upgrade: https://medium.com/@meness/steps-to-upgrade-mariadb-for-xampp-7924326731d3

**I did not perform the last step, but everything worked ***You may have to configure various credentials within phpmyadmin config files

After performing the upgrade, I was able to display markers on within Wordpress on a leaflet map.

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.