From 9af83a62e7639567afde8b76ce70e7982873e4c5 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Fri, 22 Jun 2018 14:13:49 +0500 Subject: [PATCH] Added description, example, and SQL equivalents for equals and same_as GIS lookups. --- docs/ref/contrib/gis/geoquerysets.txt | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt index b7bd83b3a3..d88454ed28 100644 --- a/docs/ref/contrib/gis/geoquerysets.txt +++ b/docs/ref/contrib/gis/geoquerysets.txt @@ -279,6 +279,21 @@ SpatiaLite ``Disjoint(poly, geom)`` *Availability*: `PostGIS `__, Oracle, MySQL, SpatiaLite, PGRaster (Conversion) +Tests if the geometry field is spatially equal to the lookup geometry. + +Example:: + + Zipcode.objects.filter(poly__equals=geom) + +========== ================================================= +Backend SQL Equivalent +========== ================================================= +PostGIS ``ST_Equals(poly, geom)`` +Oracle ``SDO_EQUAL(poly, geom)`` +MySQL ``MBREquals(poly, geom)`` +SpatiaLite ``Equals(poly, geom)`` +========== ================================================= + .. fieldlookup:: exact .. fieldlookup:: same_as @@ -288,6 +303,23 @@ Oracle, MySQL, SpatiaLite, PGRaster (Conversion) *Availability*: `PostGIS `__, Oracle, MySQL, SpatiaLite, PGRaster (Bilateral) +Tests if the geometry field is "equal" to the lookup geometry. On Oracle and +SpatiaLite it tests spatial equality, while on MySQL and PostGIS it tests +equality of bounding boxes. + +Example:: + + Zipcode.objects.filter(poly=geom) + +========== ================================================= +Backend SQL Equivalent +========== ================================================= +PostGIS ``poly ~= geom`` +Oracle ``SDO_EQUAL(poly, geom)`` +MySQL ``MBREquals(poly, geom)`` +SpatiaLite ``Equals(poly, geom)`` +========== ================================================= + .. fieldlookup:: intersects ``intersects``