clip_weighted

gis.overlay.clip_weighted(ft, band, gtf, upscale=3)

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
ft ogr.Feature A Feature according to the ogr module of osgeo. Can be optained by indexing a GeomSource. required
band Grid An object that contains a connection the band within the dataset. For further information, see Grid! 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
upscale int How much the underlying grid will be upscaled. The higher the value, the higher the accuracy. 3

Returns

Name Type Description
array A 1D array containing the clipped values.

See Also

Back to top