Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release/3.8] MySQL: fix/workaround server-side spatial filtering when SRS is geographic with MySQL >= 8 (fixes qgis/QGIS#55463) #9180

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Feb 1, 2024

Backport #9152
Authored by: @rouault

…aphic with MySQL >= 8 (fixes qgis/QGIS#55463)

It seems spatial predicates are not directly usable when using geographic SRS. For some reason

select MBRIntersects(ST_GeomFromText('POLYGON((-90 -90, 90 -90, 90 90, -90 90, -90 -90))', 4326), ST_GeomFromText('POINT(0 0)', 4326));

returns true as expected

But

select MBRIntersects(ST_GeomFromText('POLYGON((-179 -89, 179 -89, 179 89, -179 89, -179 -89))', 4326, 'axis-order=long-lat'), ST_GeomFromText('POINT(0 0)', 4326));

returns false !!!!

And

select MBRIntersects(ST_GeomFromText('POLYGON((-179 -89, 179 -89, 179 89, -179 89, -179 -89))', 32631), ST_GeomFromText('POINT(0 0)', 32631));

returns true as expected

Consequence, we need to force a projected SRS for the arguments of MBRIntersects()
@rouault rouault added this to the 3.8.4 milestone Feb 1, 2024
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 67.935% (-0.002%) from 67.937%
when pulling 94d3dc8 on backport-9152-to-release/3.8
into a8818c4 on release/3.8.

@rouault rouault merged commit c281d94 into release/3.8 Feb 1, 2024
29 of 30 checks passed
@rouault rouault deleted the backport-9152-to-release/3.8 branch February 1, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants