From cfacd69ab81c37564799a7b8a0a765e3c1f40941 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 17 Jan 2024 06:48:45 +0000 Subject: Refs #35058 -- Added is_3d and set_3d() to OGRGeometry. --- docs/ref/contrib/gis/gdal.txt | 21 +++++++++++++++++++++ docs/releases/5.1.txt | 6 ++++++ 2 files changed, 27 insertions(+) (limited to 'docs') diff --git a/docs/ref/contrib/gis/gdal.txt b/docs/ref/contrib/gis/gdal.txt index c0221a17a9..c98c76cd10 100644 --- a/docs/ref/contrib/gis/gdal.txt +++ b/docs/ref/contrib/gis/gdal.txt @@ -556,6 +556,27 @@ coordinate transformation: Returns or sets the coordinate dimension of this geometry. For example, the value would be 2 for two-dimensional geometries. + .. attribute:: is_3d + + .. versionadded:: 5.1 + + A boolean indicating if this geometry has Z coordinates. + + .. method:: set_3d(value) + + .. versionadded:: 5.1 + + A method that adds or removes the Z coordinate dimension. + + .. code-block:: pycon + + >>> p = OGRGeometry("POINT (1 2 3)") + >>> p.is_3d + True + >>> p.set_3d(False) + >>> p.wkt + "POINT (1 2)" + .. attribute:: geom_count Returns the number of elements in this geometry: diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index f8393303be..be609cea7f 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -72,6 +72,12 @@ Minor features * :class:`~django.contrib.gis.measure.Area` now supports the ``ha`` unit. +* The new :attr:`.OGRGeometry.is_3d` attribute allows checking if a geometry + has a ``Z`` coordinate dimension. + +* The new :meth:`.OGRGeometry.set_3d` method allows addition and removal of the + ``Z`` coordinate dimension. + :mod:`django.contrib.messages` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.3