colX and rowY coordinates. The width and height parameters specify the dimensions
of the rectangular region. The new values to be assigned to the pixels in this region can be specified as an array passed
to this function.
Since
v1.5.1, if the coordinate reference system (CRS) of the input geom geometry differs from that of the raster, then geom will be transformed to match the CRS of the raster. If the raster or geom doesn’t have a CRS then it will default to 4326/WGS84.Signatures
Parameters
For polygon geometries, the
allTouched parameter determines how pixels are selected:- When true, pixel selection also includes cells entered by the polygon’s boundary, following the RS_AsRaster rules.
- When false (default), pixels whose centroid intersects the polygon will be included.
allTouched. Line rasterization follows the cells entered by its segments rather than requiring a pixel-centre intersection. A point or line lying on an internal grid edge selects the pixel after it in pixel order; one lying on the raster’s last edge selects none. A neighboring pixel contacted only at a line endpoint is not selected unless the segment enters it.For LineString geometries, allTouched can also change the rasterization window at grid boundaries and therefore the selected pixels.If the shape of
newValues doesn’t match with provided width and height, IllegalArgumentException is thrown.If the mentioned
bandIndex doesn’t exist, this will throw an IllegalArgumentException.Return type
The resulting raster.

