gis.db.models.functions.SnapToGrid

class SnapToGrid(expression, *args, **extra) Availability: PostGIS, SpatiaLite (≥ 3.1) Accepts a single geographic field or expression and returns a geometry with all points snapped to the given grid. How the geometry is snapped to the grid depends on how many numeric (either float, integer, or long) arguments are given. Number of Arguments Description 1 A single size to snap both the X and Y grids to. 2 X and Y sizes to snap the grid to. 4 X, Y sizes and the corresponding X, Y origins.

gis.db.models.GeometryCollectionField

class GeometryCollectionField

gis.db.models.functions.Union

class Union(expr1, expr2, **extra) Availability: MySQL (≥ 5.6.1), PostGIS, Oracle, SpatiaLite Accepts two geographic fields or expressions and returns the union of both geometries.

gis.db.models.functions.SymDifference

class SymDifference(expr1, expr2, **extra) Availability: MySQL (≥ 5.6.1), PostGIS, Oracle, SpatiaLite Accepts two geographic fields or expressions and returns the geometric symmetric difference (union without the intersection) between the given parameters. Changed in Django 1.10: MySQL support was added.

gis.db.models.functions.Translate

class Translate(expression, x, y, z=0.0, **extra) Availability: PostGIS, SpatiaLite Accepts a single geographic field or expression and returns a geometry with its coordinates offset by the x, y, and optionally z numeric parameters.

gis.db.models.functions.Scale

class Scale(expression, x, y, z=0.0, **extra) Availability: PostGIS, SpatiaLite Accepts a single geographic field or expression and returns a geometry with scaled coordinates by multiplying them with the x, y, and optionally z parameters.

gis.db.models.functions.NumGeometries

class NumGeometries(expression, **extra) Availability: MySQL, PostGIS, Oracle, SpatiaLite Accepts a single geographic field or expression and returns the number of geometries if the geometry field is a collection (e.g., a GEOMETRYCOLLECTION or MULTI* field); otherwise returns None.

gis.db.models.functions.PointOnSurface

class PointOnSurface(expression, **extra) Availability: PostGIS, Oracle, SpatiaLite Accepts a single geographic field or expression and returns a Point geometry guaranteed to lie on the surface of the field; otherwise returns None.

gis.db.models.functions.Reverse

class Reverse(expression, **extra) Availability: PostGIS, Oracle, SpatiaLite (≥ 4.0) Accepts a single geographic field or expression and returns a geometry with reversed coordinates.

gis.db.models.functions.Perimeter

class Perimeter(expression, **extra) Availability: PostGIS, Oracle, SpatiaLite (≥ 4.0) Accepts a single geographic field or expression and returns the perimeter of the geometry field as a Distance object. On MySQL, a raw float value is returned, as it’s not possible to automatically determine the unit of the field.