djangodocs.org

674 sections in Django 4.2 Search all versions →

equals

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Conversion) Tests if the geometry field is spatially equal to the lookup geometry.

exact, same_as

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, 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 equality of bounding boxes.

intersects

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field spatially intersects the lookup geometry.

isvalid

Reference GIS QuerySet API Reference Spatial Lookups

Availability: MySQL, PostGIS, Oracle, SpatiaLite Tests if the geometry is valid. Example: | Backend | SQL Equivalent | | --- | --- | | MySQL, PostGIS, SpatiaLite | ST_IsValid(poly) | | Oracle | SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(poly, 0.05) = 'TRUE' |

overlaps

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field spatially overlaps the lookup geometry.

relate

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, MariaDB, Oracle, SpatiaLite, PGRaster (Conversion) Tests if the geometry field is spatially related to the lookup geometry by the values given in the given pattern.

Reference GIS QuerySet API Reference Spatial Lookupsrelate

On these spatial backends the intersection pattern is a string comprising nine characters, which define intersections between the interior, boundary, and exterior of the geometry field and the lookup geometry.

Oracle

Reference GIS QuerySet API Reference Spatial Lookupsrelate

Here the relation pattern is comprised of at least one of the nine relation strings: TOUCH, OVERLAPBDYDISJOINT, OVERLAPBDYINTERSECT, EQUAL, INSIDE, COVEREDBY, CONTAINS, COVERS, ON, and ANYINTERACT. Multiple strings may be combined with the logical Boolean operator OR, for example, 'inside+touch'.

touches

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite Tests if the geometry field spatially touches the lookup geometry.

within

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field is spatially within the lookup geometry.

left

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly to the left of the lookup geometry’s bounding box. Example: PostGIS equivalent:

right

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly to the right of the lookup geometry’s bounding box. Example: PostGIS equivalent:

overlaps_left

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Bilateral) Tests if the geometry field’s bounding box overlaps or is to the left of the lookup geometry’s bounding box. Example: PostGIS equivalent:

overlaps_right

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Bilateral) Tests if the geometry field’s bounding box overlaps or is to the right of the lookup geometry’s bounding box. Example: PostGIS equivalent:

overlaps_above

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box overlaps or is above the lookup geometry’s bounding box. Example: PostGIS equivalent:

overlaps_below

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box overlaps or is below the lookup geometry’s bounding box. Example: PostGIS equivalent:

strictly_above

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly above the lookup geometry’s bounding box. Example: PostGIS equivalent:

strictly_below

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly below the lookup geometry’s bounding box. Example: PostGIS equivalent:

Distance Lookups

Reference GIS QuerySet API Reference

Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Native) For an overview on performing distance queries, please refer to the distance queries introduction.