summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/gis/db-api.txt2
-rw-r--r--docs/ref/contrib/gis/functions.txt48
2 files changed, 47 insertions, 3 deletions
diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt
index 8010f6dcba..e652f7d3f6 100644
--- a/docs/ref/contrib/gis/db-api.txt
+++ b/docs/ref/contrib/gis/db-api.txt
@@ -364,6 +364,8 @@ Function PostGIS Oracle MariaDB MySQL
:class:`AsGML` X X X
:class:`AsKML` X X
:class:`AsSVG` X X
+:class:`AsWKB` X X X X X
+:class:`AsWKT` X X X X X
:class:`Azimuth` X X (LWGEOM)
:class:`BoundingCircle` X X
:class:`Centroid` X X X X X
diff --git a/docs/ref/contrib/gis/functions.txt b/docs/ref/contrib/gis/functions.txt
index a0403faf9b..651b9d3e6e 100644
--- a/docs/ref/contrib/gis/functions.txt
+++ b/docs/ref/contrib/gis/functions.txt
@@ -27,9 +27,9 @@ Measurement Relationships Operations Edi
:class:`Distance` :class:`BoundingCircle` :class:`Intersection` :class:`MakeValid` :class:`AsGML` :class:`MemSize`
:class:`GeometryDistance` :class:`Centroid` :class:`SymDifference` :class:`Reverse` :class:`AsKML` :class:`NumGeometries`
:class:`Length` :class:`Envelope` :class:`Union` :class:`Scale` :class:`AsSVG` :class:`NumPoints`
-:class:`Perimeter` :class:`LineLocatePoint` :class:`SnapToGrid` :class:`GeoHash`
-.. :class:`PointOnSurface` :class:`Transform`
-.. :class:`Translate`
+:class:`Perimeter` :class:`LineLocatePoint` :class:`SnapToGrid` :class:`AsWKB`
+.. :class:`PointOnSurface` :class:`Transform` :class:`AsWKT`
+.. :class:`Translate` :class:`GeoHash`
========================= ======================== ====================== ======================= ================== =====================
``Area``
@@ -168,6 +168,48 @@ Keyword Argument Description
__ https://www.w3.org/Graphics/SVG/
+``AsWKB``
+=========
+
+.. class:: AsWKB(expression, **extra)
+
+.. versionadded:: 3.1
+
+*Availability*: MariaDB, `MySQL
+<https://dev.mysql.com/doc/refman/en/gis-format-conversion-functions.html#function_st-asbinary>`__,
+Oracle, `PostGIS <https://postgis.net/docs/ST_AsBinary.html>`__, SpatiaLite
+
+Accepts a single geographic field or expression and returns a `Well-known
+binary (WKB)`__ representation of the geometry.
+
+Example::
+
+ >>> bytes(City.objects.annotate(wkb=AsWKB('point')).get(name='Chelyabinsk').wkb)
+ b'\x01\x01\x00\x00\x00]3\xf9f\x9b\x91K@\x00X\x1d9\xd2\xb9N@'
+
+__ https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary
+
+``AsWKT``
+=========
+
+.. class:: AsWKT(expression, **extra)
+
+.. versionadded:: 3.1
+
+*Availability*: MariaDB, `MySQL
+<https://dev.mysql.com/doc/refman/en/gis-format-conversion-functions.html#function_st-astext>`__,
+Oracle, `PostGIS <https://postgis.net/docs/ST_AsText.html>`__, SpatiaLite
+
+Accepts a single geographic field or expression and returns a `Well-known text
+(WKT)`__ representation of the geometry.
+
+Example::
+
+ >>> City.objects.annotate(wkt=AsWKT('point')).get(name='Chelyabinsk').wkt
+ 'POINT (55.137555 61.451728)'
+
+__ https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry
+
``Azimuth``
===========