From 1c5ec221a44fc9ce1585fc1f94830957df4322e7 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 16 Oct 2019 13:16:30 +0200 Subject: [PATCH] Fixed #30562 -- Doc'd MariaDB support for GIS spatial lookups. --- docs/ref/contrib/gis/db-api.txt | 74 +++++++++++++-------------- docs/ref/contrib/gis/geoquerysets.txt | 42 ++++++++++----- 2 files changed, 66 insertions(+), 50 deletions(-) diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt index 88c2676eb4..ad896f3e5d 100644 --- a/docs/ref/contrib/gis/db-api.txt +++ b/docs/ref/contrib/gis/db-api.txt @@ -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 `: 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 ` 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 ` 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: diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt index 1de9a27122..6f191c0af4 100644 --- a/docs/ref/contrib/gis/geoquerysets.txt +++ b/docs/ref/contrib/gis/geoquerysets.txt @@ -66,7 +66,7 @@ Spatial lookups with rasters are only supported for PostGIS backends -------------- *Availability*: `PostGIS `__, -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 `__, -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 `__, -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 `__, -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)`` ========== ============================ @@ -230,7 +234,7 @@ SpatiaLite ``Covers(poly, geom)`` ----------- *Availability*: `PostGIS `__, -MySQL, SpatiaLite, PGRaster (Conversion) +MariaDB, MySQL, SpatiaLite, PGRaster (Conversion) Tests if the geometry field spatially crosses the lookup geometry. @@ -242,6 +246,7 @@ Example:: Backend SQL Equivalent ========== ========================== PostGIS ``ST_Crosses(poly, geom)`` +MariaDB ``ST_Crosses(poly, geom)`` MySQL ``ST_Crosses(poly, geom)`` SpatiaLite ``Crosses(poly, geom)`` ========== ========================== @@ -256,7 +261,7 @@ SpatiaLite ``Crosses(poly, geom)`` ------------ *Availability*: `PostGIS `__, -Oracle, MySQL, SpatiaLite, PGRaster (Bilateral) +Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field is spatially disjoint from the lookup geometry. @@ -269,6 +274,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)`` ========== ================================================= @@ -284,7 +290,7 @@ SpatiaLite ``Disjoint(poly, geom)`` ---------- *Availability*: `PostGIS `__, -Oracle, MySQL, SpatiaLite, PGRaster (Conversion) +Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Conversion) Tests if the geometry field is spatially equal to the lookup geometry. @@ -297,6 +303,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)`` ========== ================================================= @@ -313,7 +320,7 @@ SpatiaLite ``Equals(poly, geom)`` ---------------------- *Availability*: `PostGIS `__, -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 @@ -328,6 +335,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)`` ========== ================================================= @@ -343,7 +351,7 @@ SpatiaLite ``Equals(poly, geom)`` -------------- *Availability*: `PostGIS `__, -Oracle, MySQL, SpatiaLite, PGRaster (Bilateral) +Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field spatially intersects the lookup geometry. @@ -356,6 +364,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)`` ========== ================================================= @@ -392,7 +401,7 @@ Oracle ``SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(poly, 0.05 ------------ *Availability*: `PostGIS `__, -Oracle, MySQL, SpatiaLite, PGRaster (Bilateral) +Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field spatially overlaps the lookup geometry. @@ -401,6 +410,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)`` ========== ============================ @@ -487,7 +497,7 @@ Oracle SQL equivalent: ----------- *Availability*: `PostGIS `__, -Oracle, MySQL, SpatiaLite +Oracle, MariaDB, MySQL, SpatiaLite Tests if the geometry field spatially touches the lookup geometry. @@ -499,6 +509,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)`` @@ -515,7 +526,7 @@ SpatiaLite ``Touches(poly, geom)`` ---------- *Availability*: `PostGIS `__, -Oracle, MySQL, SpatiaLite, PGRaster (Bilateral) +Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field is spatially within the lookup geometry. @@ -527,6 +538,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)`` @@ -712,7 +724,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 `. @@ -757,6 +769,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`` @@ -778,6 +791,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`` @@ -799,6 +813,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`` @@ -820,6 +835,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``