'Retrieve the geometry or raster, initializing it using the
corresponding class specified during initialization and the value of
the field. Currently, GEOS or OGR geometries as well as GDALRasters are
supported.'

def __get__(self, instance, cls=None):

    if (instance is None):
        return self
    try:
        geo_value = instance.__dict__[self._field.attname]
    except KeyError:
        geo_value = super().__get__(instance, cls)
    if isinstance(geo_value, self._klass):
        geo_obj = geo_value
    elif ((geo_value is None) or (geo_value == '')):
        geo_obj = None
    else:
        geo_obj = self._klass(geo_value)
        setattr(instance, self._field.attname, geo_obj)
    return geo_obj
