class documentation

class BaseSpatialField(Field):

Known subclasses: django.contrib.gis.db.models.fields.GeometryField, django.contrib.gis.db.models.fields.RasterField

View In Hierarchy

The Base GIS Field.

It's used as a base class for GeometryField and RasterField. Defines properties that are common to all GIS fields such as the characteristics of the spatial reference system of the field.

Method __init__ The initialization function for base spatial fields. Takes the following as keyword arguments:
Method db​_type Undocumented
Method deconstruct Undocumented
Method geodetic Return true if this field's SRID corresponds with a coordinate system that uses non-projected units (e.g., latitude/longitude).
Method get​_db​_prep​_value Undocumented
Method get​_placeholder Return the placeholder for the spatial column for the given value.
Method get​_prep​_value Undocumented
Method get​_raster​_prep​_value Return a GDALRaster if conversion is successful, otherwise return None.
Method get​_srid No summary
Method spheroid Undocumented
Method units Undocumented
Method units​_name Undocumented
Class Variable description Undocumented
Class Variable empty​_strings​_allowed Undocumented
Instance Variable spatial​_index Undocumented
Instance Variable srid Undocumented
def __init__(self, verbose_name=None, srid=4326, spatial_index=True, **kwargs):

The initialization function for base spatial fields. Takes the following as keyword arguments:

srid:
The spatial reference system identifier, an OGC standard. Defaults to 4326 (WGS84).
spatial_index:
Indicates whether to create a spatial index. Defaults to True. Set this instead of 'db_index' for geographic fields since index creation is different for geometry columns.
def db_type(self, connection):
def deconstruct(self):
def geodetic(self, connection):
Return true if this field's SRID corresponds with a coordinate system that uses non-projected units (e.g., latitude/longitude).
def get_db_prep_value(self, value, connection, *args, **kwargs):

Undocumented

def get_placeholder(self, value, compiler, connection):
Return the placeholder for the spatial column for the given value.
def get_prep_value(self, value):

Undocumented

def get_raster_prep_value(self, value, is_candidate):
Return a GDALRaster if conversion is successful, otherwise return None.
def get_srid(self, obj):
Return the default SRID for the given geometry or raster, taking into account the SRID set for the field. For example, if the input geometry or raster doesn't have an SRID, then the SRID of the field will be returned.
def spheroid(self, connection):

Undocumented

def units(self, connection):

Undocumented

def units_name(self, connection):

Undocumented

empty_strings_allowed: bool =

Undocumented

spatial_index =

Undocumented

srid =

Undocumented