rasterio.mask.mask
How Rasterio runs Clip raster: rasterio.mask.mask.
| Engine | Rasterio |
|---|---|
| Tool name | rasterio.mask.mask |
| Interface | python |
| Implements | Clip raster |
| Preset | {"crop":true} |
| Documentation | Not stated |
| Effects | modifies input: no, network: no |
| Notes | Not stated |
| Status | active |
Parameters
| Name | Type | Required | Default | Choices | Note |
|---|---|---|---|---|---|
dataset | any | yes | Not stated | Not stated | Not stated |
shapes | any | yes | Not stated | Not stated | Not stated |
all_touched | boolean | no | no | Not stated | Not stated |
invert | boolean | no | no | Not stated | Not stated |
nodata | any | no | Not stated | Not stated | Not stated |
filled | boolean | no | yes | Not stated | Not stated |
crop | boolean | no | no | Not stated | Not stated |
pad | boolean | no | no | Not stated | Not stated |
pad_width | number | no | 0.5 | Not stated | Not stated |
indexes | any | no | Not stated | Not stated | Not stated |
How it maps to the operation
| Operation parameter | Parameter here | Note |
|---|---|---|
raster | dataset | Not stated |
mask | shapes | Not stated |
all_touched | all_touched | Not stated |
bbox | Not stated | Pass the box as a polygon in shapes. |
Differences from the operation
- Takes an open dataset and GeoJSON-like shapes in the raster's CRS; returns an array and its transform rather than writing a file.
- Without crop = True the result keeps the full extent, with cells outside the shapes set to nodata.
Harvested by the python-packages harvester from engine version
1.5.2. Names can change when an engine is harvested again.