PDOEngine - support Mysql ST_GeomFromWKB axis-order option - #60
Open
YasserB94 wants to merge 2 commits into
Open
PDOEngine - support Mysql ST_GeomFromWKB axis-order option#60YasserB94 wants to merge 2 commits into
YasserB94 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
============================================
+ Coverage 48.76% 48.92% +0.15%
- Complexity 2037 2038 +1
============================================
Files 75 75
Lines 4727 4730 +3
============================================
+ Hits 2305 2314 +9
+ Misses 2422 2416 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First: Thank you for this package. This has made the GeoJSON parsing I've had to do a lot quicker and easier!
Problem
Whilst working with an API that only allows Long-Lat axis orders in their GeoJSON I had quite some exceptions as Mysql's default does not accept this as input.
I currently resolved this by making a copy of PDOEngine (since it's final), and adding the option. Though this seems like something that could just be part of the PDOEngine, thus this PR.
I looked through issues and pull requests on a limited amount of keywords and found no matches regarding this.
Changes
mysqlGeoAxisOrderadded to PdoEngine defaulting to nullST_GeomFromWKBaccording to MySQL's documentation (linked below)I haven't found any resources on MariaDB supporting this, instead of a runtime version check (I found one the tests) and an extra round tip to the driver, I opted to just put warning comments in the code.
The full test suite including the added ones ran successfully on both MySQL (8.4) and MariaDB (11.4) (On MariaDB the tests get skipped).
TLDR: Adds support for the MySQL axis-order options in ST_GeomFromWKB. No breaking changes, one caveat: there is no runtime check for MariaDB, setting this for a MariaDB database will cause an exception.
Links and Context
I found out about the option here: https://dev.mysql.com/doc/refman/8.0/en/gis-wkb-functions.html
To quote:
Disclaimers