Opened 4 months ago

Last modified 3 months ago

#35058 assigned Cleanup/optimization

Update GDAL integration

Reported by: David Smith Owned by: David Smith
Component: GIS Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

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 `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

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.

Change History (19)

comment:1 by Mariusz Felisiak, 4 months ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Agreed, we definitely needs some cleaning there.

comment:2 by GitHub <noreply@…>, 4 months ago

In 623597c7:

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

comment:3 by GitHub <noreply@…>, 4 months ago

In 2a2481f:

Refs #35058 -- Added repr() to OGRGeomType.

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

In 21b0b23:

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.

comment:5 by David Smith, 4 months ago

Owner: changed from nobody to David Smith
Status: newassigned

comment:6 by David Smith, 4 months ago

Has patch: set

PR to add support for the "M" dimension to "POINT" geometries.

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 4 months ago

In cfacd69:

Refs #35058 -- Added is_3d and set_3d() to OGRGeometry.

comment:8 by Mariusz Felisiak, 4 months ago

Patch needs improvement: set

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 3 months ago

In f4c59734:

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().

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 3 months ago

In 3f6d939c:

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

Co-authored-by: Nick Pope <nick@…>

comment:11 by Mariusz Felisiak, 3 months ago

Patch needs improvement: unset
Resolution: fixed
Status: assignedclosed

comment:12 by Mariusz Felisiak, 3 months ago

Resolution: fixed
Status: closednew

comment:13 by Mariusz Felisiak, 3 months ago

Status: newassigned

comment:14 by David Smith, 3 months ago

PR to promote centroid to being available on all geometry types.

comment:15 by Mariusz Felisiak <felisiak.mariusz@…>, 3 months ago

In 2005530:

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

comment:16 by Mariusz Felisiak <felisiak.mariusz@…>, 3 months ago

In 1df8983a:

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

comment:17 by Mariusz Felisiak, 3 months ago

Has patch: unset

comment:18 by GitHub <noreply@…>, 3 months ago

In d3922e9e:

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

comment:19 by Mariusz Felisiak <felisiak.mariusz@…>, 3 months ago

In 222bf293:

Refs #35058 -- Added support for measured geometries to GDAL GeometryCollection and subclasses.

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