laravel-mysql-spatial icon indicating copy to clipboard operation
laravel-mysql-spatial copied to clipboard

Cannot insert/update spatial column in MariaDB

Open Persaeus opened this issue 4 years ago • 1 comments

When trying to insert or update a spatial column when using MariaDB, the following exception is thrown:

Syntax error or access violation: 1582 Incorrect parameter count in the call to native function 'ST_GeomFromText'

This is because WKT spatial analysis functions, like ST_GeomFromText, in MariaDB do not accept the options parameter like they do in MySQL, and we hard-code the options parameter as "axis-order=long-lat"

Persaeus avatar Oct 03 '20 21:10 Persaeus