Opened 10 years ago

Closed 5 years ago

Last modified 4 years 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: dev
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 (15)

comment:1 by Claude Paroz, 10 years ago

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

comment:2 by visu, 10 years ago

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 by Tim Graham, 10 years ago

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 by Claude Paroz, 9 years ago

Patch needs improvement: unset

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

comment:5 by Claude Paroz, 9 years ago

See the pull request for the remaining failure with test_disjoint_lookup.

comment:6 by Tim Graham, 9 years ago

Patch needs improvement: set

comment:7 by Claude Paroz, 8 years ago

#25659 was a duplcate with a patch.

comment:8 by Claude Paroz, 8 years ago

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

comment:9 by Claude Paroz, 5 years ago

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 by Tim Graham, 5 years ago

It would be fine with me.

comment:11 by Claude Paroz, 5 years ago

Patch needs improvement: unset

comment:12 by Tim Graham, 5 years ago

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

comment:13 by Tim Graham <timograham@…>, 5 years ago

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.

comment:14 by GitHub <noreply@…>, 4 years ago

In 5becb36a:

Refs #22423 -- Corrected crosses lookup support on MySQL in documentation.

Support was added in 15715bf.

comment:15 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 76e159e2:

[3.0.x] Refs #22423 -- Corrected crosses lookup support on MySQL in documentation.

Support was added in 15715bf.
Backport of 5becb36a79a0c31c7cc9e76237239ebd0fdda18d from master

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