[Django] #36009: Add support for PostGIS 3.5

23 views
Skip to first unread message

Django

unread,
Dec 14, 2024, 8:05:18 AM12/14/24
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+-----------------------------------------
Reporter: David Smith | 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
-----------------------------+-----------------------------------------
[https://postgis.net/2024/09/PostGIS-3.5.0/ PostGIS 3.5] was released on
26 September 2024.

My initial try showed that there is one test failure when using this new
version that needs to be investigated.


{{{
======================================================================
ERROR: test_relate_lookup
(gis_tests.geoapp.tests.GeoLookupTest.test_relate_lookup)
Testing the 'relate' lookup type.
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\smith\projects\django\tests\gis_tests\geoapp\tests.py",
line 581, in test_relate_lookup
"Lawrence", City.objects.get(point__relate=(ks.poly,
within_mask)).name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\smith\projects\django\django\db\models\manager.py", line
87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\smith\projects\django\django\db\models\query.py", line
633, in get
raise self.model.DoesNotExist(
gis_tests.geoapp.models.City.DoesNotExist: City matching query does not
exist.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36009>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 14, 2024, 9:39:36 AM12/14/24
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Claude Paroz):

* stage: Unreviewed => Accepted
* type: Uncategorized => New feature
* version: 5.1 => dev

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

Django

unread,
May 27, 2025, 10:03:22 AMMay 27
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by Mohammad Ali Mehdizadeh):

I want to contribute on this issue
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:2>

Django

unread,
Jun 12, 2025, 9:12:28 AMJun 12
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by Natalia Bidart):

[https://github.com/django/django/pull/19557 PR] to run tests with PostGIS
3.5 (test pass) via a label-triggered GH action.
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:3>

Django

unread,
Jun 17, 2025, 2:25:59 PMJun 17
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by GitHub <noreply@…>):

In [changeset:"8c56e939750ae785b806dfa4e043590760c90ab6" 8c56e939]:
{{{#!CommitTicketReference repository=""
revision="8c56e939750ae785b806dfa4e043590760c90ab6"
Refs #36009 -- Added GitHub action workflow to run tests with latest
stable postgis version.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:4>

Django

unread,
Jun 23, 2025, 2:22:51 AMJun 23
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by David Smith):

The `test_relate_lookup` is failing with PostGIS, and (I'm fairly sure)
with GEOS 3.13+. PostGIS made a change to the way "relate" works when GEOS
3.13 is available so I'm guessing this is relavent
https://trac.osgeo.org/postgis/ticket/5770. PostGIS will now use the new
implementation for "relate" which is available in GEOS 3.13.
[https://libgeos.org/posts/2024-08-13-relateng/ see docs on RelateNG]

Running the tests with `--debug-sql`, I get the output
[https://gist.github.com/smithdc1/86ff4bb4ef27dd975a93d3105d0bebdd seen
here]. Happy to post to trac, but the "wkb" for Kansas is quite big.

If I connect to the database, load the values for Lawrence and run the
same query, I get one result (Lawrence). However, that same query being
run by Django's returns 0 results. I'm unsure how to continue to debug
this.

{{{
insert into geoapp_city values
(1, 'Lawrence', 'POINT (-95.235060 38.971823)')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:5>

Django

unread,
Jun 23, 2025, 8:09:36 AMJun 23
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by Natalia Bidart):

Thank you David for the debugging information. One thing I'm not sure I
follow is:
* `test_relate_lookup` works with PostGIS 3.5 and GEOS 3.9 (this is the
confg in the new GHA workflow), but
* `test_relate_lookup` fails with PostGIS 3.5 and GEOS 3.13 (this is the
failure posted in this ticket).

Given the above, and given than `RelateNG` is provided by GEOS and its
implementation changed in 3.13, shouldn't the issue be that we need to
(re) confirm support for GEOS 3.13? Seems like we should close this ticket
as `fixed` and re-open #35775.
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:6>

Django

unread,
Jun 26, 2025, 3:22:10 PMJun 26
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Natalia Bidart):

* has_patch: 0 => 1
* needs_better_patch: 0 => 1

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

Django

unread,
Jul 22, 2025, 5:32:23 PMJul 22
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by David Smith):

* needs_better_patch: 1 => 0

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

Django

unread,
Jul 22, 2025, 9:20:48 PMJul 22
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+---------------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | 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 Natalia Bidart):

* stage: Accepted => Ready for checkin

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

Django

unread,
Jul 23, 2025, 7:17:29 AMJul 23
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: nessita
| <124304+nessita@…>
Type: New feature | Status: closed
Component: GIS | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | 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 nessita <124304+nessita@…>):

* owner: (none) => nessita <124304+nessita@…>
* resolution: => fixed
* status: new => closed

Comment:

In [changeset:"1909108f9f0f2a91c1ec0fcdb65b01f58743a871" 1909108]:
{{{#!CommitTicketReference repository=""
revision="1909108f9f0f2a91c1ec0fcdb65b01f58743a871"
Fixed #36009 -- Confirmed support for PostGIS 3.5.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:11>

Django

unread,
Jul 23, 2025, 7:17:29 AMJul 23
to django-...@googlegroups.com
#36009: Add support for PostGIS 3.5
-----------------------------+---------------------------------------------
Reporter: David Smith | Owner: (none)
Type: New feature | Status: new
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | 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 nessita <124304+nessita@…>):

In [changeset:"d0113c17119a1946a49f2160375997eeb9cddc4e" d0113c17]:
{{{#!CommitTicketReference repository=""
revision="d0113c17119a1946a49f2160375997eeb9cddc4e"
Refs #36009 -- Adjusted
gis_tests.geoapp.tests.GeoLookupTest.test_relate_lookup for bug in
PostGIS.

ST_Relate() with PostGIS 3.5 and GEOS 3.13 gives a different result when
a series of calls are made vs. single call of the same function.

The fix for this is expected to be released in PostGIS 3.5.4 and 3.6.0.

https://lists.osgeo.org/pipermail/postgis-devel/2025-July/030581.html
https://trac.osgeo.org/postgis/ticket/5938
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36009#comment:10>
Reply all
Reply to author
Forward
0 new messages