Opened 5 years ago

Closed 7 days ago

#22423 closed New feature (fixed)

Geodjango spatial functions should leverage mysql 5.6 spatial functions.

Reported by: visu Owned by: visu
Component: GIS Version: master
Severity: Normal Keywords: gis, mysql,
Cc: visumrs@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

MySQL 5.6 and later implements spatial functions properly. (i.e., similar to PostGIS, mysql also supports ST_Contains, ST_Within and other ST_ queries.) http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html#function_st-contains

Geodjango currently implements poly__contains and other queries for mysql as "MBRContains" instead of "Contains"
https://docs.djangoproject.com/en/dev/ref/contrib/gis/geoquerysets/#std:fieldlookup-gis-contains

related Ticket: #13430

Change History (13)

comment:1 Changed 5 years ago by Claude Paroz

Component: UncategorizedGIS
Has patch: unset
Triage Stage: UnreviewedAccepted
Version: 1.6master

comment:2 Changed 5 years ago by visu

Has patch: set
Needs documentation: set

Hi,

I sent a pull request. Please review and let me know.
I attached a unit test in the pull request as well.

https://github.com/django/django/pull/2574

thanks,
Visu M

comment:3 Changed 4 years ago by Tim Graham

Needs documentation: unset
Patch needs improvement: set

I left comments for improvement on the PR. Please uncheck "Patch needs improvement" when you update it, thanks.

comment:4 Changed 4 years ago by Claude Paroz

Patch needs improvement: unset

https://github.com/django/django/pull/3941, MySQL 5.6.1+ testers welcome.

comment:5 Changed 4 years ago by Claude Paroz

See the pull request for the remaining failure with test_disjoint_lookup.

comment:6 Changed 4 years ago by Tim Graham

Patch needs improvement: set

comment:7 Changed 3 years ago by Claude Paroz

#25659 was a duplcate with a patch.

comment:8 Changed 3 years ago by Claude Paroz

The patch from #25659 has been committed, as it was orthogonal to this ticket.

comment:9 Changed 4 weeks ago by Claude Paroz

This PR shows that MySQL is still failing with GeoLookupTest.test_disjoint_lookup, while MariaDB runs it fine. It's a bit sad that the entire patch is blocked just because of the MySQL disjoint issue. Any idea on the way to go forward?

Would it be acceptable to mark the text as expected failure on MySQL?

comment:10 Changed 4 weeks ago by Tim Graham

It would be fine with me.

comment:11 Changed 4 weeks ago by Claude Paroz

Patch needs improvement: unset

comment:12 Changed 3 weeks ago by Tim Graham

Description: modified (diff)
Triage Stage: AcceptedReady for checkin

comment:13 Changed 7 days ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 15715bf2:

Fixed #22423 -- Added support for MySQL operators on real geometries.

Thanks Viswanathan Mahalingam for the report and initial patch, and
Nicke Pope and Tim Graham for the review.

Note: See TracTickets for help on using tickets.
Back to Top