[Django] #35058: Update GDAL integration

25 views
Skip to first unread message

Django

unread,
Dec 22, 2023, 3:09:48 AM12/22/23
to django-...@googlegroups.com
#35058: Update GDAL integration
-----------------------------------------+------------------------
Reporter: David Smith | Owner: nobody
Type: Uncategorized | Status: new
Component: GIS | Version: 4.2
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 |
-----------------------------------------+------------------------
During the GDAL 2.x and 3.x releases GDAL has expanded its public entry
points, added new features. While one of these new features is curved
geometries #34406 I think we should conduct a review and consider if new
items should be added to Django. Here's a few specific items to start
with:

**OGR_G_CoordinateDimension**

[https://gdal.org/api/vector_c_api.html#_CPPv428OGR_G_GetCoordinateDimension12OGRGeometryH
OGR_G_CoordinateDimension ] is deprecated in favour of
`OGR_G_CoordinateDimension()`, `OGR_G_Is3D()` and `OGR_G_IsMeasured()`.

**OGRwkbGeometryType**

Support should be added to understand a wider scope of WKT inputs. For
example [https://en.wikipedia.org/wiki/Well-
known_text_representation_of_geometry `POINT ZM (1 1 5 60)`] is valid but
currently results in an error. ( `Invalid OGR Integer Type: 3001`).

I think maybe this is because new WKB types are supported see
OGRwkbGeometryType : https://gdal.org/doxygen/ogr__core_8h.html and
https://github.com/OSGeo/gdal/blob/62c1489feab9312d0468abde0ad13d7b35ce27f7/ogr/ogr_core.h#L529.

This likely needs to be fixed before `OGR_G_CoordinateDimension`. (You
can't write a test for `OGR_G_IsMeasured` without first creating a
geometry with a measure)

**OGR_G_CreateFromWkbEx**

[https://gdal.org/api/vector_c_api.html#_CPPv421OGR_G_CreateFromWkbExPKv20OGRSpatialReferenceHP12OGRGeometryH6size_t
OGR_G_CreateFromWkbEx] is added in GDAL 3.3. I think we should prefer this
over the existing `OGR_G_CreateFromWkb` when available. The difference is
the new method supports large (2gb+) inputs. In 3.3+ the old method now
raises and error suggesting use of the new method, and was unsupported in
previous versions.

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

Django

unread,
Dec 22, 2023, 3:41:11 AM12/22/23
to django-...@googlegroups.com
#35058: Update GDAL integration
--------------------------------------+------------------------------------

Reporter: David Smith | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 4.2
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 Mariusz Felisiak):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Agreed, we definitely needs some cleaning there.

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

Django

unread,
Dec 23, 2023, 11:26:32 AM12/23/23
to django-...@googlegroups.com
#35058: Update GDAL integration
--------------------------------------+------------------------------------
Reporter: David Smith | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 4.2
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:"623597c786e89daae15a52dccfcdded7f808da9f" 623597c7]:
{{{
#!CommitTicketReference repository=""
revision="623597c786e89daae15a52dccfcdded7f808da9f"
Refs #35058 -- Added support for WKB > 2GB with GDAL 3.3+.

GDAL 3.3.0 added OGR_G_WkbSizeEx() and OGR_G_CreateFromWkbEx() to handle
WKB > 2GB. Prefer these new functions when available.

https://github.com/OSGeo/gdal/blob/master/NEWS.md#ogr-330---overview-of-
changes
}}}

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

Django

unread,
Dec 26, 2023, 3:23:45 PM12/26/23
to django-...@googlegroups.com
#35058: Update GDAL integration
--------------------------------------+------------------------------------
Reporter: David Smith | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 4.2
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:"2a2481f5a2179ac11947d92a097c9042bb57e17c" 2a2481f]:
{{{
#!CommitTicketReference repository=""
revision="2a2481f5a2179ac11947d92a097c9042bb57e17c"
Refs #35058 -- Added __repr__() to OGRGeomType.
}}}

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

Django

unread,
Dec 27, 2023, 6:47:05 AM12/27/23
to django-...@googlegroups.com
#35058: Update GDAL integration
--------------------------------------+------------------------------------
Reporter: David Smith | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 4.2
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 Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"21b0b23a67ee1aa1a35f7f64cd8fe997e4de89d7" 21b0b23]:
{{{
#!CommitTicketReference repository=""
revision="21b0b23a67ee1aa1a35f7f64cd8fe997e4de89d7"
Refs #35058 -- Made OGRGeomType aware of additional WKB geometry types.

This commit increases OGRGeomType's knowledge of WKB types and allows
for improved error messages when Django doesn't yet have a corresponding
class to wrap a given type.
}}}

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

Django

unread,
Jan 7, 2024, 6:35:43 AMJan 7
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned

Component: GIS | Version: 4.2
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 David Smith):

* owner: nobody => David Smith
* status: new => assigned


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

Django

unread,
Jan 15, 2024, 1:29:11 PMJan 15
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/17696 PR] to add support for the
"M" dimension to "POINT" geometries.

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

Django

unread,
Jan 18, 2024, 5:45:00 AMJan 18
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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
-------------------------------------+-------------------------------------

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

In [changeset:"cfacd69ab81c37564799a7b8a0a765e3c1f40941" cfacd69]:
{{{
#!CommitTicketReference repository=""
revision="cfacd69ab81c37564799a7b8a0a765e3c1f40941"
Refs #35058 -- Added is_3d and set_3d() to OGRGeometry.
}}}

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

Django

unread,
Jan 18, 2024, 5:45:53 AMJan 18
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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 Mariusz Felisiak):

* needs_better_patch: 0 => 1


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

Django

unread,
Jan 23, 2024, 12:08:29 AMJan 23
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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
-------------------------------------+-------------------------------------

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

In [changeset:"f4c597346453c44769726d2ac061fbc028b2fd5b" f4c59734]:
{{{
#!CommitTicketReference repository=""
revision="f4c597346453c44769726d2ac061fbc028b2fd5b"
Refs #35058 -- Deprecated OGRGeometry.coord_dim setter.

Reflecting a change in the underlying GDAL library (since GDAL 2.1)
using coord_dim to set a geometries dimensions is deprecated in favor
of set_3d().
}}}

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

Django

unread,
Jan 25, 2024, 3:45:23 AMJan 25
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"3f6d939c62efd967f548c27a265748cc2cc47ca5" 3f6d939c]:
{{{#!CommitTicketReference repository=""
revision="3f6d939c62efd967f548c27a265748cc2cc47ca5"
Refs #35058 -- Added support for measured geometries to GDAL Point.

Co-authored-by: Nick Pope <ni...@nickpope.me.uk>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:10>

Django

unread,
Jan 25, 2024, 3:48:06 AMJan 25
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: closed
Component: GIS | Version: 4.2
Severity: Normal | Resolution: fixed

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 Mariusz Felisiak):

* status: assigned => closed
* needs_better_patch: 1 => 0
* resolution: => fixed

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

Django

unread,
Jan 26, 2024, 4:08:52 AMJan 26
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: new

Component: GIS | Version: 4.2
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 Mariusz Felisiak):

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

Comment:

[https://github.com/django/django/pull/17777 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:12>

Django

unread,
Jan 26, 2024, 4:09:09 AMJan 26
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned

Component: GIS | Version: 4.2
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 Mariusz Felisiak):

* status: new => assigned

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

Django

unread,
Jan 28, 2024, 3:44:46 AMJan 28
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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
-------------------------------------+-------------------------------------
Comment (by David Smith):

[https://github.com/django/django/pull/17786 PR] to promote centroid to
being available on all geometry types.
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:14>

Django

unread,
Jan 28, 2024, 9:09:14 AMJan 28
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2005530920e7c290bb1cf7d9ada155250faa81ad" 2005530]:
{{{#!CommitTicketReference repository=""
revision="2005530920e7c290bb1cf7d9ada155250faa81ad"
Refs #35058 -- Made centroid available on all geometry types.

Centroid is available on all geometry types since GDAL 1.8.0.
Previously it was restricted to Polygon.

https://gdal.org/doxygen/classOGRGeometry.html#a91787f669b2a148169667e270e7e40df
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:15>

Django

unread,
Jan 29, 2024, 3:40:46 AMJan 29
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1df8983aa3b51bd37a5b9acf92475ad3a9180fe4" 1df8983a]:
{{{#!CommitTicketReference repository=""
revision="1df8983aa3b51bd37a5b9acf92475ad3a9180fe4"
Refs #35058 -- Added support for measured geometries to GDAL LineString.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:16>

Django

unread,
Jan 29, 2024, 3:41:04 AMJan 29
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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 Mariusz Felisiak):

* has_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:17>

Django

unread,
Jan 31, 2024, 7:11:27 AMJan 31
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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:"d3922e9e5ad045f5408b02216a824f26a50950f0" d3922e9e]:
{{{#!CommitTicketReference repository=""
revision="d3922e9e5ad045f5408b02216a824f26a50950f0"
Refs #35058 -- Added support for measured geometries to GDAL Polygon.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:18>

Django

unread,
Feb 12, 2024, 11:44:11 AMFeb 12
to django-...@googlegroups.com
#35058: Update GDAL integration
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
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 Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"222bf2932b55ebc964ffc5f9a6f47bad083e5ac2" 222bf293]:
{{{#!CommitTicketReference repository=""
revision="222bf2932b55ebc964ffc5f9a6f47bad083e5ac2"


Refs #35058 -- Added support for measured geometries to GDAL

GeometryCollection and subclasses.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35058#comment:19>

Reply all
Reply to author
Forward
0 new messages