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
The input raster.
The 1-indexed band to modify.
The column index of the top-left corner of the rectangular region.
The row index of the top-left corner of the rectangular region.
The width of the rectangular region in pixels.
The height of the rectangular region in pixels.
An array of new pixel values to assign to the rectangular region.
The geometry defining the region of interest (ROI) for pixel replacement.
The new value to assign to pixels within the geometry ROI.
Whether to include all pixels touched by the geometry, not just those whose center is within it. Defaults to
false.Whether to preserve existing NoData values in the region. Defaults to
false.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.

