clip_weighted
gis.overlay.clip_weighted(band, srs, gtf, ft, upscale=1)
Clip a grid based on a feature (vector), but weighted.
This method caters to those who wish to have information about the percentages of cells that are touched by the feature.
Warnings
A high upscale value comes with a calculation penalty!
Parameters
Name | Type | Description | Default |
---|---|---|---|
band |
Grid |
An object that contains a connection the band within the dataset. For further information, see Grid! | required |
srs |
osr .SpatialReference |
Spatial reference (Projection) of the Grid object (e.g. WGS84). Can be optained with the get_srs method. | required |
gtf |
tuple | The geotransform of a grid dataset. Can be optained via the get_geotransform method. Has the following shape: (left, xres, xrot, upper, yrot, yres). | required |
ft |
ogr .Feature |
A Feature according to the ogr module of osgeo. Can be optained by indexing a GeomSource. | required |
upscale |
int | How much the underlying grid will be upscaled. The higher the value, the higher the accuracy. | 1 |
Returns
Type | Description |
---|---|
array | A 1D array containing the clipped values. |