Class Raster
Bases: safe.storage.layer.Layer
InaSAFE representation of raster data
Only used if data is provide as a numeric array, if None, WGS84 geographic is assumed
(top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolution). See e.g. http://www.gdal.org/gdal_tutorial.html Only used if data is provide as a numeric array,
name: Optional name for layer. If None, basename is used.
layer. When the layer is stored, these keywords will be written into an associated file with extension .keywords. Keywords can for example be used to display text about the layer in a web application.
should be styled. See impact_functions/styles.py for examples.
Return raster layer data as qgis QgsRasterayer.
Return copy of raster layer
This copy will be equal to self in the sense defined by __eq__
Get N values between the min and the max occurred in this dataset.
Return sorted list of length N+1 where the first element is min and the last is max. Intermediate values depend on the keyword quantiles: If quantiles is True, they represent boundaries between quantiles. If quantiles is False, they represent equidistant interval boundaries.
Get bounding box coordinates for raster layer
Get raster data as numeric array
nan: Optional flag controlling handling of missing values.
If keyword nan has a numeric value, nodata values will be replaced by that value. E.g. to set missing values to 0, do get_data(nan=0.0)
NOTE: The following behaviour is depricated, since we handle this on file load: [If nan is True (default), nodata values will be replaced with numpy.nan]
if it has been resampled. Admissible values are
False: data is retrieved without modification.
between its current and native resolution. This is typically required if raster data represents a density such as population per km^2
“population” associated with the layer. If it is “density”, scaling will be applied otherwise not. This is the default.
that will be use to scale the data
copy (optional): If present and True return copy
Get min and max from raster
Return longitudes and latitudes (the axes) for grid.
Return two vectors (longitudes and latitudes) corresponding to grid. The values are offset by half a pixel size to correspond to pixel registration.
I.e. If the grid origin (top left corner) is (105, 10) and the resolution is 1 degrees in each direction, then the vectors will take the form
longitudes = [100.5, 101.5, ..., 109.5] latitudes = [0.5, 1.5, ..., 9.5]
Return geotransform for this raster layer
Returns:
(top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolution).
copy (optional): If present and True return copy
Get the internal representation of NODATA
Get raster resolution as a 2-tuple (resx, resy)
If False return 2-tuple (dx, dy)
available. Otherwise return actual.
Read raster data from qgis layer QgsRasterLayer.
TypeError if qgis is not avialable
IOError if can’t store temporary file
dataProvider
Convert raster grid to vector point data
Convert raster grid to vector point data
Save raster data to file
Gdal documentation at: http://www.gdal.org/classGDALRasterBand.html