2
This module holds the base `SpatialBackend` object, which is
3
instantiated by each spatial backend with the features it has.
5
# TODO: Create a `Geometry` protocol and allow user to use
6
# different Geometry objects -- for now we just use GEOSGeometry.
7
from django.contrib.gis.geos import GEOSGeometry, GEOSException
9
class BaseSpatialBackend(object):
10
Geometry = GEOSGeometry
11
GeometryException = GEOSException
13
def __init__(self, **kwargs):
14
kwargs.setdefault('distance_functions', {})
15
kwargs.setdefault('limited_where', {})
16
for k, v in kwargs.iteritems(): setattr(self, k, v)
18
def __getattr__(self, name):
20
All attributes of the spatial backend return False by default.
23
return self.__dict__[name]