summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/gis/db-api.txt72
-rw-r--r--docs/ref/contrib/gis/functions.txt12
-rw-r--r--docs/ref/contrib/gis/geoquerysets.txt26
-rw-r--r--docs/releases/6.0.txt4
4 files changed, 79 insertions, 35 deletions
diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt
index 5ce009e9bb..be7e5440b4 100644
--- a/docs/ref/contrib/gis/db-api.txt
+++ b/docs/ref/contrib/gis/db-api.txt
@@ -339,42 +339,43 @@ divided into the three categories described in the :ref:`raster lookup details
<spatial-lookup-raster>`: native support ``N``, bilateral native support ``B``,
and geometry conversion support ``C``.
-================================= ========= ======== ============ ============ ========== ========
-Lookup Type PostGIS Oracle MariaDB MySQL [#]_ SpatiaLite PGRaster
-================================= ========= ======== ============ ============ ========== ========
-:lookup:`bbcontains` X X X X N
-:lookup:`bboverlaps` X X X X N
-:lookup:`contained` X X X X N
-:lookup:`contains <gis-contains>` X X X X X B
-:lookup:`contains_properly` X B
-:lookup:`coveredby` X X X (≥ 12.0.1) X X B
-:lookup:`covers` X X X X B
-:lookup:`crosses` X X X X C
-:lookup:`disjoint` X X X X X B
-:lookup:`distance_gt` X X X X X N
-:lookup:`distance_gte` X X X X X N
-:lookup:`distance_lt` X X X X X N
-:lookup:`distance_lte` X X X X X N
-:lookup:`dwithin` X X X B
-:lookup:`equals` X X X X X C
-:lookup:`exact <same_as>` X X X X X B
-:lookup:`intersects` X X X X X B
+================================= ========= ========= ============ ============ ========== ========
+Lookup Type PostGIS Oracle MariaDB MySQL [#]_ SpatiaLite PGRaster
+================================= ========= ========= ============ ============ ========== ========
+:lookup:`bbcontains` X X X X N
+:lookup:`bboverlaps` X X X X N
+:lookup:`contained` X X X X N
+:lookup:`contains <gis-contains>` X X X X X B
+:lookup:`contains_properly` X B
+:lookup:`coveredby` X X X (≥ 12.0.1) X X B
+:lookup:`covers` X X X X B
+:lookup:`crosses` X X X X C
+:lookup:`disjoint` X X X X X B
+:lookup:`distance_gt` X X X X X N
+:lookup:`distance_gte` X X X X X N
+:lookup:`distance_lt` X X X X X N
+:lookup:`distance_lte` X X X X X N
+:lookup:`dwithin` X X X B
+:lookup:`equals` X X X X X C
+:lookup:`exact <same_as>` X X X X X B
+:lookup:`geom_type` X X (≥ 23c) X X X
+:lookup:`intersects` X X X X X B
:lookup:`isempty` X
-:lookup:`isvalid` X X X (≥ 12.0.1) 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
-:lookup:`touches` X X X X X B
-:lookup:`within` X X X X X B
-:lookup:`left` X C
-:lookup:`right` X C
-:lookup:`overlaps_left` X B
-:lookup:`overlaps_right` X B
-:lookup:`overlaps_above` X C
-:lookup:`overlaps_below` X C
-:lookup:`strictly_above` X C
-:lookup:`strictly_below` X C
-================================= ========= ======== ============ ============ ========== ========
+:lookup:`isvalid` X X X (≥ 12.0.1) 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
+:lookup:`touches` X X X X X B
+:lookup:`within` X X X X X B
+:lookup:`left` X C
+:lookup:`right` X C
+:lookup:`overlaps_left` X B
+:lookup:`overlaps_right` X B
+:lookup:`overlaps_above` X C
+:lookup:`overlaps_below` X C
+:lookup:`strictly_above` X C
+:lookup:`strictly_below` X C
+================================= ========= ========= ============ ============ ========== ========
.. _database-functions-compatibility:
@@ -408,6 +409,7 @@ Function PostGIS Oracle MariaDB MySQL
:class:`FromWKT` X X X X X
:class:`GeoHash` X X (≥ 12.0.1) X X (LWGEOM/RTTOPO)
:class:`GeometryDistance` X
+:class:`GeometryType` X X (≥ 23c) X X X
:class:`Intersection` X X X X X
:class:`IsEmpty` X
:class:`IsValid` X X X (≥ 12.0.1) X X
diff --git a/docs/ref/contrib/gis/functions.txt b/docs/ref/contrib/gis/functions.txt
index f9939c5e63..8c9c1cf82f 100644
--- a/docs/ref/contrib/gis/functions.txt
+++ b/docs/ref/contrib/gis/functions.txt
@@ -635,6 +635,18 @@ Returns ``True`` if its value is a valid geometry and ``False`` otherwise.
MariaDB 12.0.1+ support was added.
+``GeometryType``
+----------------
+
+.. versionadded:: 6.0
+
+.. class:: GeometryType(expr)
+
+*Availability*: `PostGIS <https://postgis.net/docs/GeometryType.html>`__,
+Oracle 23c+, MariaDB, MySQL, SpatiaLite
+
+Accepts a geographic field or expression and returns its geometry type.
+
``MemSize``
-----------
diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt
index 0231ce6af8..1ab0f7c309 100644
--- a/docs/ref/contrib/gis/geoquerysets.txt
+++ b/docs/ref/contrib/gis/geoquerysets.txt
@@ -399,6 +399,32 @@ Oracle ``SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(p
MariaDB 12.0.1+ support was added.
+.. fieldlookup:: geom_type
+
+``geom_type``
+-------------
+
+.. versionadded:: 6.0
+
+*Availability*: `PostGIS <https://postgis.net/docs/GeometryType.html>`__,
+Oracle 23c+, MariaDB, MySQL, SpatiaLite
+
+Returns the geometry type of the geometry field.
+
+Example::
+
+ Zipcode.objects.filter(poly__geom_type="POLYGON")
+
+========== ==========================
+Backend SQL Equivalent
+========== ==========================
+PostGIS ``GeometryType(geom)``
+MariaDB ``ST_GeometryType(geom)``
+MySQL ``ST_GeometryType(geom)``
+Oracle ``SDO_GEOMETRY.GET_GTYPE(geom)``
+SpatiaLite ``GeometryType(geom)``
+========== ==========================
+
.. fieldlookup:: overlaps
``overlaps``
diff --git a/docs/releases/6.0.txt b/docs/releases/6.0.txt
index 3f4ce44a75..c5fa1bac63 100644
--- a/docs/releases/6.0.txt
+++ b/docs/releases/6.0.txt
@@ -119,6 +119,10 @@ Minor features
:class:`~django.contrib.gis.db.models.functions.IsValid` database functions
are now supported on MariaDB 12.0.1+.
+* The new :lookup:`geom_type` lookup and
+ :class:`GeometryType() <django.contrib.gis.db.models.functions.GeometryType>`
+ database function allow filtering geometries by their types.
+
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~