[3.0.x] Fixed #30562 -- Doc'd MariaDB support for GIS spatial lookups.

Backport of 1c5ec221a4 from master
This commit is contained in:
Mariusz Felisiak 2019-10-16 13:16:30 +02:00 committed by Carlton Gibson
parent 8047961d7c
commit 336c9cb7f4
2 changed files with 66 additions and 50 deletions

View File

@ -219,7 +219,7 @@ in the :doc:`model-api` documentation for more details.
Distance Lookups
----------------
*Availability*: PostGIS, MySQL, Oracle, SpatiaLite, PGRaster (Native)
*Availability*: PostGIS, MariaDB, MySQL, Oracle, SpatiaLite, PGRaster (Native)
The following distance lookups are available:
@ -227,7 +227,7 @@ The following distance lookups are available:
* :lookup:`distance_lte`
* :lookup:`distance_gt`
* :lookup:`distance_gte`
* :lookup:`dwithin` (except MySQL)
* :lookup:`dwithin` (except MariaDB and MySQL)
.. note::
@ -310,41 +310,41 @@ 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 MySQL [#]_ SpatiaLite PGRaster
================================= ========= ======== ============ ========== ========
:lookup:`bbcontains` X X X N
:lookup:`bboverlaps` X X X N
:lookup:`contained` X X X N
:lookup:`contains <gis-contains>` X X X X B
:lookup:`contains_properly` X B
:lookup:`coveredby` X X X B
:lookup:`covers` X X X B
:lookup:`crosses` X X X C
:lookup:`disjoint` X X X X B
:lookup:`distance_gt` X X X X N
:lookup:`distance_gte` X X X X N
:lookup:`distance_lt` X X X X N
:lookup:`distance_lte` X X X X N
:lookup:`dwithin` X X X B
:lookup:`equals` X X X X C
:lookup:`exact` X X X X B
:lookup:`intersects` X X X X B
:lookup:`isvalid` X X X (≥ 5.7.5) X (LWGEOM)
:lookup:`overlaps` X X X X B
:lookup:`relate` X X X C
:lookup:`same_as` X X X X B
:lookup:`touches` X X X X B
:lookup:`within` 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 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 B
:lookup:`covers` 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` X X X X X B
:lookup:`intersects` X X X X X B
:lookup:`isvalid` X X X (≥ 5.7.5) X (LWGEOM)
:lookup:`overlaps` X X X X X B
:lookup:`relate` 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:

View File

@ -66,7 +66,7 @@ Spatial lookups with rasters are only supported for PostGIS backends
--------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Geometry_Contain.html>`__,
MySQL, SpatiaLite, PGRaster (Native)
MariaDB, MySQL, SpatiaLite, PGRaster (Native)
Tests if the geometry or raster field's bounding box completely contains the
lookup geometry's bounding box.
@ -79,6 +79,7 @@ Example::
Backend SQL Equivalent
========== ==========================
PostGIS ``poly ~ geom``
MariaDB ``MBRContains(poly, geom)``
MySQL ``MBRContains(poly, geom)``
SpatiaLite ``MbrContains(poly, geom)``
========== ==========================
@ -89,7 +90,7 @@ SpatiaLite ``MbrContains(poly, geom)``
--------------
*Availability*: `PostGIS <https://postgis.net/docs/geometry_overlaps.html>`__,
MySQL, SpatiaLite, PGRaster (Native)
MariaDB, MySQL, SpatiaLite, PGRaster (Native)
Tests if the geometry field's bounding box overlaps the lookup geometry's
bounding box.
@ -102,6 +103,7 @@ Example::
Backend SQL Equivalent
========== ==========================
PostGIS ``poly && geom``
MariaDB ``MBROverlaps(poly, geom)``
MySQL ``MBROverlaps(poly, geom)``
SpatiaLite ``MbrOverlaps(poly, geom)``
========== ==========================
@ -112,7 +114,7 @@ SpatiaLite ``MbrOverlaps(poly, geom)``
-------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Geometry_Contained.html>`__,
MySQL, SpatiaLite, PGRaster (Native)
MariaDB, MySQL, SpatiaLite, PGRaster (Native)
Tests if the geometry field's bounding box is completely contained by the
lookup geometry's bounding box.
@ -125,6 +127,7 @@ Example::
Backend SQL Equivalent
========== ==========================
PostGIS ``poly @ geom``
MariaDB ``MBRWithin(poly, geom)``
MySQL ``MBRWithin(poly, geom)``
SpatiaLite ``MbrWithin(poly, geom)``
========== ==========================
@ -135,7 +138,7 @@ SpatiaLite ``MbrWithin(poly, geom)``
------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Contains.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Bilateral)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral)
Tests if the geometry field spatially contains the lookup geometry.
@ -148,6 +151,7 @@ Backend SQL Equivalent
========== ============================
PostGIS ``ST_Contains(poly, geom)``
Oracle ``SDO_CONTAINS(poly, geom)``
MariaDB ``ST_Contains(poly, geom)``
MySQL ``ST_Contains(poly, geom)``
SpatiaLite ``Contains(poly, geom)``
========== ============================
@ -238,7 +242,7 @@ SpatiaLite ``Covers(poly, geom)``
-----------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Crosses.html>`__,
MySQL, SpatiaLite, PGRaster (Conversion)
MariaDB, MySQL, SpatiaLite, PGRaster (Conversion)
Tests if the geometry field spatially crosses the lookup geometry.
@ -250,6 +254,7 @@ Example::
Backend SQL Equivalent
========== ==========================
PostGIS ``ST_Crosses(poly, geom)``
MariaDB ``ST_Crosses(poly, geom)``
MySQL ``ST_Crosses(poly, geom)``
SpatiaLite ``Crosses(poly, geom)``
========== ==========================
@ -264,7 +269,7 @@ SpatiaLite ``Crosses(poly, geom)``
------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Disjoint.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Bilateral)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral)
Tests if the geometry field is spatially disjoint from the lookup geometry.
@ -277,6 +282,7 @@ Backend SQL Equivalent
========== =================================================
PostGIS ``ST_Disjoint(poly, geom)``
Oracle ``SDO_GEOM.RELATE(poly, 'DISJOINT', geom, 0.05)``
MariaDB ``ST_Disjoint(poly, geom)``
MySQL ``ST_Disjoint(poly, geom)``
SpatiaLite ``Disjoint(poly, geom)``
========== =================================================
@ -292,7 +298,7 @@ SpatiaLite ``Disjoint(poly, geom)``
----------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Equals.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Conversion)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Conversion)
Tests if the geometry field is spatially equal to the lookup geometry.
@ -305,6 +311,7 @@ Backend SQL Equivalent
========== =================================================
PostGIS ``ST_Equals(poly, geom)``
Oracle ``SDO_EQUAL(poly, geom)``
MariaDB ``ST_Equals(poly, geom)``
MySQL ``ST_Equals(poly, geom)``
SpatiaLite ``Equals(poly, geom)``
========== =================================================
@ -321,7 +328,7 @@ SpatiaLite ``Equals(poly, geom)``
----------------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Geometry_Same.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Bilateral)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral)
Tests if the geometry field is "equal" to the lookup geometry. On Oracle,
MySQL, and SpatiaLite, it tests spatial equality, while on PostGIS it tests
@ -336,6 +343,7 @@ Backend SQL Equivalent
========== =================================================
PostGIS ``poly ~= geom``
Oracle ``SDO_EQUAL(poly, geom)``
MariaDB ``ST_Equals(poly, geom)``
MySQL ``ST_Equals(poly, geom)``
SpatiaLite ``Equals(poly, geom)``
========== =================================================
@ -351,7 +359,7 @@ SpatiaLite ``Equals(poly, geom)``
--------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Intersects.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Bilateral)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral)
Tests if the geometry field spatially intersects the lookup geometry.
@ -364,6 +372,7 @@ Backend SQL Equivalent
========== =================================================
PostGIS ``ST_Intersects(poly, geom)``
Oracle ``SDO_OVERLAPBDYINTERSECT(poly, geom)``
MariaDB ``ST_Intersects(poly, geom)``
MySQL ``ST_Intersects(poly, geom)``
SpatiaLite ``Intersects(poly, geom)``
========== =================================================
@ -400,7 +409,7 @@ Oracle ``SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(poly, 0.05
------------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Overlaps.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Bilateral)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral)
Tests if the geometry field spatially overlaps the lookup geometry.
@ -409,6 +418,7 @@ Backend SQL Equivalent
========== ============================
PostGIS ``ST_Overlaps(poly, geom)``
Oracle ``SDO_OVERLAPS(poly, geom)``
MariaDB ``ST_Overlaps(poly, geom)``
MySQL ``ST_Overlaps(poly, geom)``
SpatiaLite ``Overlaps(poly, geom)``
========== ============================
@ -495,7 +505,7 @@ Oracle SQL equivalent:
-----------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Touches.html>`__,
Oracle, MySQL, SpatiaLite
Oracle, MariaDB, MySQL, SpatiaLite
Tests if the geometry field spatially touches the lookup geometry.
@ -507,6 +517,7 @@ Example::
Backend SQL Equivalent
========== ==========================
PostGIS ``ST_Touches(poly, geom)``
MariaDB ``ST_Touches(poly, geom)``
MySQL ``ST_Touches(poly, geom)``
Oracle ``SDO_TOUCH(poly, geom)``
SpatiaLite ``Touches(poly, geom)``
@ -523,7 +534,7 @@ SpatiaLite ``Touches(poly, geom)``
----------
*Availability*: `PostGIS <https://postgis.net/docs/ST_Within.html>`__,
Oracle, MySQL, SpatiaLite, PGRaster (Bilateral)
Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral)
Tests if the geometry field is spatially within the lookup geometry.
@ -535,6 +546,7 @@ Example::
Backend SQL Equivalent
========== ==========================
PostGIS ``ST_Within(poly, geom)``
MariaDB ``ST_Within(poly, geom)``
MySQL ``ST_Within(poly, geom)``
Oracle ``SDO_INSIDE(poly, geom)``
SpatiaLite ``Within(poly, geom)``
@ -720,7 +732,7 @@ PostGIS equivalent:
Distance Lookups
================
*Availability*: PostGIS, Oracle, MySQL, SpatiaLite, PGRaster (Native)
*Availability*: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Native)
For an overview on performing distance queries, please refer to
the :ref:`distance queries introduction <distance-queries>`.
@ -765,6 +777,7 @@ Example::
Backend SQL Equivalent
========== ==================================================
PostGIS ``ST_Distance/ST_Distance_Sphere(poly, geom) > 5``
MariaDB ``ST_Distance(poly, geom) > 5``
MySQL ``ST_Distance(poly, geom) > 5``
Oracle ``SDO_GEOM.SDO_DISTANCE(poly, geom, 0.05) > 5``
SpatiaLite ``Distance(poly, geom) > 5``
@ -786,6 +799,7 @@ Example::
Backend SQL Equivalent
========== ===================================================
PostGIS ``ST_Distance/ST_Distance_Sphere(poly, geom) >= 5``
MariaDB ``ST_Distance(poly, geom) >= 5``
MySQL ``ST_Distance(poly, geom) >= 5``
Oracle ``SDO_GEOM.SDO_DISTANCE(poly, geom, 0.05) >= 5``
SpatiaLite ``Distance(poly, geom) >= 5``
@ -807,6 +821,7 @@ Example::
Backend SQL Equivalent
========== ==================================================
PostGIS ``ST_Distance/ST_Distance_Sphere(poly, geom) < 5``
MariaDB ``ST_Distance(poly, geom) < 5``
MySQL ``ST_Distance(poly, geom) < 5``
Oracle ``SDO_GEOM.SDO_DISTANCE(poly, geom, 0.05) < 5``
SpatiaLite ``Distance(poly, geom) < 5``
@ -828,6 +843,7 @@ Example::
Backend SQL Equivalent
========== ===================================================
PostGIS ``ST_Distance/ST_Distance_Sphere(poly, geom) <= 5``
MariaDB ``ST_Distance(poly, geom) <= 5``
MySQL ``ST_Distance(poly, geom) <= 5``
Oracle ``SDO_GEOM.SDO_DISTANCE(poly, geom, 0.05) <= 5``
SpatiaLite ``Distance(poly, geom) <= 5``