gis.gdal.GDALRaster.geotransform

geotransform The affine transformation matrix used to georeference the source, as a tuple of six coefficients which map pixel/line coordinates into georeferenced space using the following relationship: Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2) Ygeo = GT(3) + Xpixel*GT(4) + Yline*GT(5) The same values can be retrieved by accessing the origin (indices 0 and 3), scale (indices 1 and 5) and skew (indices 2 and 4) properties. The default is [0.0, 1.0, 0.0, 0.0, 0.0, -1.0]. >>> rst = GDA

gis.gdal.GDALRaster.extent

extent Extent (boundary values) of the raster source, as a 4-tuple (xmin, ymin, xmax, ymax) in the spatial reference system of the source. >>> rst = GDALRaster({'width': 10, 'height': 20, 'srid': 4326}) >>> rst.extent (0.0, -20.0, 10.0, 0.0) >>> rst.origin.x = 100 >>> rst.extent (100.0, -20.0, 110.0, 0.0)

gis.gdal.GDALRaster.driver

driver The name of the GDAL driver used to handle the input file. For GDALRasters created from a file, the driver type is detected automatically. The creation of rasters from scratch is a in-memory raster by default ('MEM'), but can be altered as needed. For instance, use GTiff for a GeoTiff file. For a list of file types, see also the GDAL Raster Formats list. An in-memory raster is created through the following example: >>> GDALRaster({'width': 10, 'height': 10, 'srid': 4326}).dri

gis.gdal.GDALRaster.bands

bands List of all bands of the source, as GDALBand instances. >>> rst = GDALRaster({"width": 1, "height": 2, 'srid': 4326, ... "bands": [{"data": [0, 1]}, {"data": [2, 3]}]}) >>> len(rst.bands) 2 >>> rst.bands[1].data() array([[ 2., 3.]], dtype=float32)

gis.gdal.GDALRaster

class GDALRaster(ds_input, write=False) The constructor for GDALRaster accepts two parameters. The first parameter defines the raster source, it is either a path to a file or spatial data with values defining the properties of a new raster (such as size and name). If the input is a file path, the second parameter specifies if the raster should be opened with write access. If the input is raw data, the parameters width, height, and srid are required. The following example shows how rasters ca

gis.gdal.GDALBand.width

width The width of the band in pixels (X-axis).

gis.gdal.GDALBand.std

std New in Django 1.10. The standard deviation of all pixel values of the band (excluding the “no data” value).

gis.gdal.GDALBand.statistics()

statistics(refresh=False, approximate=False) New in Django 1.10. Compute statistics on the pixel values of this band. The return value is a tuple with the following structure: (minimum, maximum, mean, standard deviation). If the approximate argument is set to True, the statistics may be computed based on overviews or a subset of image tiles. If the refresh argument is set to True, the statistics will be computed from the data directly, and the cache will be updated with the result. If a pe

gis.gdal.GDALBand.pixel_count

pixel_count New in Django 1.9. The total number of pixels in this band. Is equal to width * height.

gis.gdal.GDALBand.nodata_value

nodata_value The “no data” value for a band is generally a special marker value used to mark pixels that are not valid data. Such pixels should generally not be displayed, nor contribute to analysis operations. To delete an existing “no data” value, set this property to None (requires GDAL ≥ 2.1). Changed in Django 1.9: This property can now be set as well. Changed in Django 1.10: The “no data” value can now be deleted by setting the nodata_value attribute to None.