[Django] #36417: Intersects result not matching 'not disjoint' result for geography field

7 views
Skip to first unread message

Django

unread,
May 25, 2025, 9:54:04 AM5/25/25
to django-...@googlegroups.com
#36417: Intersects result not matching 'not disjoint' result for geography field
--------------------------+-----------------------------------------
Reporter: jshirota | Type: Uncategorized
Status: new | Component: GIS
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------+-----------------------------------------
The following two queries don't always result in the same output.

{{{

.filter(my_geography_field__intersects=polygon)

.exclude(my_geography_field__disjoint=polygon)

}}}

''Also the intersects example above is significantly slower.''

It may be that ::geometry casting needs to be applied to a geography field
all the time (not just for operations supported for geography). Possibly
remove the second condition in the following if statement?

https://github.com/django/django/blob/b373721af0e5c3de0986977ac07e3ad55061ecbe/django/contrib/gis/db/backends/postgis/operations.py#L94
--
Ticket URL: <https://code.djangoproject.com/ticket/36417>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 26, 2025, 9:09:44 AM5/26/25
to django-...@googlegroups.com
#36417: Intersects result not matching 'not disjoint' result for geography field
------------------------------+--------------------------------------
Reporter: Jiro Shirota | Owner: (none)
Type: Bug | Status: closed
Component: GIS | Version: 5.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* resolution: => needsinfo
* status: new => closed
* type: Uncategorized => Bug

Comment:

Hello Jiro Shirota, thank you for taking the time to create this ticket.
Unfortunately, we'll need more information in order to investigate this
issue further. In particular, it would be helpful if you could provide:
* A minimal Django project or test case that reproduces the issue.
* The specific versions of Django, Python, PostGIS, and any relevant
database backends you're using.
* Any relevant model definitions, data setup, and queries that demonstrate
the unexpected behavior.

Without these details, it's difficult to determine whether this is a bug
in Django or an issue with the specific usage or environment. If you're
unsure how to isolate the problem or would like guidance from other users,
feel free to post on the [https://forum.djangoproject.com/ Django Forum],
where community members can help troubleshoot and clarify expected
behavior. There is a specific category for
[https://forum.djangoproject.com/c/internals/geodjango/13 GeoDjango].

For now, I'm going to close this ticket as `needsinfo` following the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets ticket triaging process], but please feel free to
reopen it once you're able to provide the additional details.
--
Ticket URL: <https://code.djangoproject.com/ticket/36417#comment:1>

Django

unread,
May 26, 2025, 9:09:54 AM5/26/25
to django-...@googlegroups.com
#36417: Intersects result not matching 'not disjoint' result for geography field
------------------------------+--------------------------------------
Reporter: Jiro Shirota | Owner: (none)
Type: Bug | Status: closed
Component: GIS | Version: 5.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* cc: Claude Paroz (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36417#comment:2>
Reply all
Reply to author
Forward
0 new messages