技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
features-masks【数据与研究】Routes Rasterio raster/vector feature extraction, rasterization, sieving, geometry windows, dataset masks, and nodata-mask workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a user wants to extract GeoJSON-like shapes from raster values, burn vector shapes into rasters, crop/mask rasters by geometry, or debug nodata masks.
rasterio.features.shapes, rasterize, sieve, bounds, geometry_mask, geometry_window, and dataset_features.rasterio.mask.raster_geometry_mask and rasterio.mask.mask.__geo_interface__ objects.dataset-io-profiles first if the output profile is missing.Window math and MemoryFile handling; use windows-memory-vsi.reprojection-merge-vrt when geometry CRS changes are part of the task.rio shapes, rio rasterize, and rio mask command construction; use rio-cli for CLI-specific flag routing.references/api-reference.md for verified signatures and parameter notes.references/workflows.md for shape extraction, rasterization, mask/crop, and nodata cleanup recipes.references/troubleshooting.md for invalid geometries, no-overlap crops, all_touched, dtype, and mask-sense issues.scripts/extract_shapes.py — output a limited GeoJSON-like FeatureCollection from raster values.scripts/rasterize_geometry.py — rasterize a GeoJSON geometry/feature/collection to a small GeoTIFF.scripts/sieve_raster.py — remove small regions from a raster band and write the result.shapes or burn features with rasterize depending on direction.mask or raster_geometry_mask and update the output profile with the returned transform.sieve only when removing small connected regions is the intended cleanup.all_touched=True only when every touched pixel should be included.skip_invalid=False when invalid geometry should be a hard failure.filled=False in mask when the caller needs a numpy.ma.MaskedArray.geometry_window when you need a pixel window around shapes before reading data.reprojection-merge-vrt before masking if the shape CRS does not match the dataset CRS.out_shape, out, or destination path.all_touched=True and center-based rasterization produce identical pixels.tests/test_features.py::test_rasterize_polygontests/test_features.py::test_rasterize_invalid_geomtests/test_features.py::test_geometry_window_north_uptests/test_mask.py::test_mask_croptests/test_mask.py::test_mask_filledA future agent should be able to answer shape-extraction, rasterization, mask-cropping, and nodata-mask-repair questions from this sub-skill plus its bundled files.