[Django] #22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.

53 views
Skip to first unread message

Django

unread,
Apr 11, 2014, 9:44:35 PM4/11/14
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-------------------------------+-------------------------
Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Keywords: gis, mysql,
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------
Hi,

Starting from 5.6 version, mysql implemented spatial functions properly.
(ie, 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

This needs to be fixed.
related Ticket :

https://code.djangoproject.com/ticket/13430

--
Ticket URL: <https://code.djangoproject.com/ticket/22423>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 12, 2014, 9:42:52 AM4/12/14
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: => 0
* component: Uncategorized => GIS
* needs_tests: => 0
* version: 1.6 => master
* needs_docs: => 0
* has_patch: 1 => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:1>

Django

unread,
Apr 16, 2014, 12:42:52 PM4/16/14
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by visu):

* needs_docs: 0 => 1
* has_patch: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:2>

Django

unread,
Sep 19, 2014, 8:13:07 AM9/19/14
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by timgraham):

* needs_docs: 1 => 0
* needs_better_patch: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:3>

Django

unread,
Jan 17, 2015, 10:36:44 AM1/17/15
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: 1 => 0


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:4>

Django

unread,
Jan 17, 2015, 5:09:36 PM1/17/15
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by claudep):

See the pull request for the remaining failure with
`test_disjoint_lookup`.

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:5>

Django

unread,
Jan 29, 2015, 3:21:10 PM1/29/15
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:6>

Django

unread,
Nov 2, 2015, 7:24:02 AM11/2/15
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by claudep):

#25659 was a duplcate with a [https://github.com/django/django/pull/5532
patch].

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:7>

Django

unread,
Nov 2, 2015, 1:32:00 PM11/2/15
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by claudep):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:8>

Django

unread,
Jan 19, 2019, 9:39:44 AM1/19/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Claude Paroz):

This [https://github.com/django/django/pull/10876 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?

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:9>

Django

unread,
Jan 19, 2019, 3:40:27 PM1/19/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham):

It would be fine with me.

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:10>

Django

unread,
Jan 20, 2019, 1:33:51 PM1/20/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Claude Paroz):

* needs_better_patch: 1 => 0


Comment:

[https://github.com/django/django/pull/10877 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:11>

Django

unread,
Jan 29, 2019, 4:16:57 PM1/29/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+---------------------------------------------

Reporter: visu | Owner: visu
Type: New feature | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: gis, mysql, | Triage Stage: Ready for checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Tim Graham):

* stage: Accepted => Ready for checkin


Old description:

> Hi,
>
> Starting from 5.6 version, mysql implemented spatial functions properly.
> (ie, 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
>
> This needs to be fixed.
> related Ticket :
>
> https://code.djangoproject.com/ticket/13430

New description:

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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:12>

Django

unread,
Feb 12, 2019, 6:06:16 PM2/12/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+---------------------------------------------
Reporter: visu | Owner: visu
Type: New feature | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed

Keywords: gis, mysql, | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"15715bf2a2303b8f24edefc6c517cad7294edbe9" 15715bf2]:
{{{
#!CommitTicketReference repository=""
revision="15715bf2a2303b8f24edefc6c517cad7294edbe9"
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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:13>

Django

unread,
Oct 16, 2019, 7:57:33 AM10/16/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+---------------------------------------------
Reporter: visu | Owner: visu

Type: New feature | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: gis, mysql, | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"5becb36a79a0c31c7cc9e76237239ebd0fdda18d" 5becb36a]:
{{{
#!CommitTicketReference repository=""
revision="5becb36a79a0c31c7cc9e76237239ebd0fdda18d"
Refs #22423 -- Corrected crosses lookup support on MySQL in documentation.

Support was added in 15715bf.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:14>

Django

unread,
Oct 16, 2019, 7:58:03 AM10/16/19
to django-...@googlegroups.com
#22423: Geodjango spatial functions should leverage mysql 5.6 spatial functions.
-----------------------------+---------------------------------------------
Reporter: visu | Owner: visu

Type: New feature | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed
Keywords: gis, mysql, | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"76e159e2c3059f04f3a56e79e8a27297b264b33c" 76e159e2]:
{{{
#!CommitTicketReference repository=""
revision="76e159e2c3059f04f3a56e79e8a27297b264b33c"
[3.0.x] Refs #22423 -- Corrected crosses lookup support on MySQL in
documentation.

Support was added in 15715bf.

Backport of 5becb36a79a0c31c7cc9e76237239ebd0fdda18d from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22423#comment:15>

Reply all
Reply to author
Forward
0 new messages