laravel-mysql-spatial
laravel-mysql-spatial copied to clipboard
Cannot insert/update spatial column in MariaDB
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"