From d86802f13fd821f006371b95d888d294297874fd Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 23 Sep 2024 18:21:02 +0100 Subject: Fixed #35783 -- Added NumDimensions GIS database function and __num_dimensions lookup. --- docs/ref/contrib/gis/db-api.txt | 2 ++ docs/ref/contrib/gis/functions.txt | 13 +++++++++++++ docs/ref/contrib/gis/geoquerysets.txt | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt index b51001ecd1..8f062e503d 100644 --- a/docs/ref/contrib/gis/db-api.txt +++ b/docs/ref/contrib/gis/db-api.txt @@ -365,6 +365,7 @@ Lookup Type PostGIS Oracle MariaDB MySQL [#]_ :lookup:`intersects` X X X X X B :lookup:`isempty` X X :lookup:`isvalid` X X X (≥ 12.0.1) X X +:lookup:`num_dimensions` X X :lookup:`overlaps` X X X X X B :lookup:`relate` X X X X C :lookup:`same_as` X X X X X B @@ -420,6 +421,7 @@ Function PostGIS Oracle MariaDB MySQL :class:`LineLocatePoint` X X :class:`MakeValid` X X (LWGEOM/RTTOPO) :class:`MemSize` X +:class:`NumDimensions` X X :class:`NumGeometries` X X X X X :class:`NumPoints` X X X X X :class:`Perimeter` X X X diff --git a/docs/ref/contrib/gis/functions.txt b/docs/ref/contrib/gis/functions.txt index ab540627eb..2c4d344867 100644 --- a/docs/ref/contrib/gis/functions.txt +++ b/docs/ref/contrib/gis/functions.txt @@ -669,6 +669,19 @@ Accepts a geographic field or expression and returns its geometry type. Accepts a single geographic field or expression and returns the memory size (number of bytes) that the geometry field takes. +``NumDimensions`` +----------------- + +.. versionadded:: 6.1 + +.. class:: NumDimensions(expression, **extra) + +*Availability*: `PostGIS `__, +SpatiaLite + +Accepts a single geometry field or expression and returns the number of +dimensions used by the geometry. + ``NumGeometries`` ----------------- diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt index 6109bafb4f..70ac9d4d28 100644 --- a/docs/ref/contrib/gis/geoquerysets.txt +++ b/docs/ref/contrib/gis/geoquerysets.txt @@ -425,6 +425,28 @@ Oracle ``SDO_GEOMETRY.GET_GTYPE(geom)`` SpatiaLite ``GeometryType(geom)`` ========== ========================== +.. fieldlookup:: num_dimensions + +``num_dimensions`` +------------------ + +.. versionadded:: 6.1 + +*Availability*: `PostGIS `__, +SpatiaLite + +Returns the number of dimensions used by the geometry. + +Example:: + + Zipcode.objects.filter(geom__num_dimensions=3) + +=================== ================== +Backend SQL Equivalent +=================== ================== +PostGIS, SpatiaLite ``ST_NDims(geom)`` +=================== ================== + .. fieldlookup:: overlaps ``overlaps`` -- cgit v1.3