Пример #1
0
 def contribute_to_class(self, cls, name, **kwargs):
     super().contribute_to_class(cls, name, **kwargs)
     # Setup for lazy-instantiated Raster object. For large querysets, the
     # instantiation of all GDALRasters can potentially be expensive. This
     # delays the instantiation of the objects to the moment of evaluation
     # of the raster attribute.
     setattr(cls, self.attname, SpatialProxy(gdal.GDALRaster, self))
Пример #2
0
 def contribute_to_class(self, cls, name, **kwargs):
     super(RasterField, self).contribute_to_class(cls, name, **kwargs)
     # Importing GDALRaster raises an exception on systems without gdal.
     from django.contrib.gis.gdal import GDALRaster
     # Setup for lazy-instantiated Raster object. For large querysets, the
     # instantiation of all GDALRasters can potentially be expensive. This
     # delays the instantiation of the objects to the moment of evaluation
     # of the raster attribute.
     setattr(cls, self.attname, SpatialProxy(GDALRaster, self))
Пример #3
0
    def contribute_to_class(self, cls, name, **kwargs):
        super().contribute_to_class(cls, name, **kwargs)

        # Setup for lazy-instantiated Geometry object.
        setattr(
            cls, self.attname,
            SpatialProxy(self.geom_class or GEOSGeometry,
                         self,
                         load_func=GEOSGeometry))
Пример #4
0
    def contribute_to_class(self, cls, name, **kwargs):
        super(GeometryField, self).contribute_to_class(cls, name, **kwargs)

        # Setup for lazy-instantiated Geometry object.
        setattr(cls, self.attname, SpatialProxy(Geometry, self))