Reference GIS QuerySet API Reference
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:
1413 sections across all versions Narrow to Django 6.0 (current) →
Reference GIS QuerySet API Reference
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:
Reference GIS QuerySet API Reference
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:
Reference GIS QuerySet API Reference
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:
Reference GIS QuerySet API Reference
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:
Reference GIS QuerySet API Reference
Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly above the lookup geometry’s bounding box. Example: PostGIS equivalent:
Reference GIS QuerySet API Reference
Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly below the lookup geometry’s bounding box. Example: PostGIS equivalent:
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.
Reference GIS QuerySet API Reference
Returns models where the distance to the geometry field from the lookup geometry is greater than the given distance value.
Reference GIS QuerySet API Reference
Returns models where the distance to the geometry field from the lookup geometry is greater than or equal to the given distance value.
Reference GIS QuerySet API Reference
Returns models where the distance to the geometry field from the lookup geometry is less than the given distance value.
Reference GIS QuerySet API Reference
Returns models where the distance to the geometry field from the lookup geometry is less than or equal to the given distance value.
Reference GIS QuerySet API Reference
Returns models where the distance to the geometry field from the lookup geometry are within the given distance from one another. Note that you can only provide Distance objects if the targeted geometries are in a projected system.
Reference GIS QuerySet API Reference
Django provides some GIS-specific aggregate functions. For details on how to use these aggregate functions, see the topic guide on aggregation.
Reference GIS QuerySet API Reference
classCollect(geo_field,filter=None)[source] Availability: PostGIS, MariaDB, MySQL, SpatiaLite Returns a GEOMETRYCOLLECTION or a MULTI geometry object from the geometry column.
Reference GIS QuerySet API Reference
The spatial lookups in this section are available for GeometryField and RasterField. For an introduction, see the spatial lookups introduction. For an overview of what lookups are compatible with a particular spatial backend, refer to the spatial lookup compatibility table.
Reference GIS QuerySet API Reference Spatial Lookups
All examples in the reference below are given for geometry fields and inputs, but the lookups can be used the same way with rasters on both sides.
Reference GIS QuerySet API Reference Spatial Lookups
Availability: PostGIS, MariaDB, MySQL, SpatiaLite, PGRaster (Native) Tests if the geometry or raster field’s bounding box completely contains the lookup geometry’s bounding box.
Reference GIS QuerySet API Reference Spatial Lookups
Availability: PostGIS, MariaDB, MySQL, SpatiaLite, PGRaster (Native) Tests if the geometry field’s bounding box overlaps the lookup geometry’s bounding box.
Reference GIS QuerySet API Reference Spatial Lookups
Availability: PostGIS, MariaDB, MySQL, SpatiaLite, PGRaster (Native) Tests if the geometry field’s bounding box is completely contained by the lookup geometry’s bounding box.
Reference GIS QuerySet API Reference Spatial Lookups
Availability: PostGIS, Oracle, MariaDB, MySQL, SpatiaLite, PGRaster (Bilateral) Tests if the geometry field spatially contains the lookup geometry.