- Notifications
You must be signed in to change notification settings - Fork330
Allow setting WKT options or disabling WKT options entirely.#152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Fixes#153 |
madbob commentedOct 4, 2020
Testing now (MariaDB 15.1) and working as expected. |
polyskalov commentedNov 14, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@grimzy, will this request be merged? Install package and got this error with parameters count, don't know what to do |
ccantet commentedNov 22, 2020
I'm waiting a merge of this pull request too |
Wulfheart commentedDec 14, 2020
This would be really helpful! |
carestad commentedSep 15, 2021
This would be nice indeed. Any plans of looking this over and perhaps merging@grimzy? |
vdomah commentedDec 7, 2021
same, merge is strongly needed |
a-hardin commentedDec 16, 2021
please add this |
bernhardh commentedFeb 21, 2022
please add this :( |
No activity on the master branch since Oct 2020. Looks like@grimzy might have abandoned the project. |
Surzhikov commentedSep 1, 2022
My problem is related to two Issues at once (this one, about wktOptions with MariaDB, and another one, with Laravel 9.x Compatibility). So the solution is to make it work with Laravel 9.x + MariaDB 10.x
You can use this solution, while we hope that the@grimzy will have some time to build version for Laravel 9 with wktOptions ;) |
MySQL allows 3 parameters, MariaDB only two:-https://dev.mysql.com/doc/refman/8.4/en/gis-wkt-functions.html#function_st-geomfromtext-https://mariadb.com/kb/en/st_geomfromtext/Related:grimzy#152Related:grimzy#138
MySQL allows 3 parameters, MariaDB only two:-https://dev.mysql.com/doc/refman/8.4/en/gis-wkt-functions.html#function_st-geomfromtext-https://mariadb.com/kb/en/st_geomfromtext/Related:grimzy#152Related:grimzy#138
MySQL allows 3 parameters, MariaDB only two:-https://dev.mysql.com/doc/refman/8.4/en/gis-wkt-functions.html#function_st-geomfromtext-https://mariadb.com/kb/en/st_geomfromtext/Related:grimzy#152Related:grimzy#138
Uh oh!
There was an error while loading.Please reload this page.
Unlike MySQL, the WKT-input spatial analysis functions inMariaDB like
ST_GeomFromText
andST_DISTANCE
do not take an options parameter:https://mariadb.com/kb/en/st_geomfromtext/If I understand correctly, we need to pass "
axis-order=long-lat
" because otherwise some versions of MySQL will interpret coordinate pairs as lat-long. For MariaDB, this is not necessary because MariaDB reads WKT values as long-lat by default.In its current state, using this package with MariaDB will throw the following exception when trying to insert or update values for a spatial column, because we force the third options parameter in
ST_GeomFromText
:This is because the MariaDB function expects at most two arguments:https://github.com/MariaDB/server/blob/cf87f3e08c10dd7a944447ddee93fbc3827e6570/sql/item_geofunc.cc#L2993
This PR adds the option to set a
$wktOptions
property on the model that will overwrite the default options "axis-order=long-lat". It can be set to false to remove the options parameter entirely, which fixes the errors when using MariaDB.Additionally, it adds flexibility for users that may want or need to change the WKT options for whichever reason.
This is completely backwards-compatible, because if
$wktOptions
is not set, it will default to "axis-order=long-lat".