From Open Foris Wiki
oft-admin-mask.bash - this script prepares a mask of administrative areas within a satellite image
Usage: oft-admin-mask.bash <mask for Landsat image> <administrative area image> [ID of wanted administrative area]
- If no ID is given the script just clips and re-projects (if needed) the admin image to match the Landsat image mask
- If an ID is given, the admin area with this ID is added to the base mask and other areas are set to 0
- The input administrative image does not need to be of the same size and projection (script utilises oft-clip.pl for clipping and re-projecting)
- Get Example data set
- For this exercise following tools are used: oft-admin-mask.bash, oft-shptif.bash
- Open your working directory using
- In a first step we need to prepare an image with administrative areas using oft-shptif.bash. For exercise purpose we simply use landuse.shp as an input for hypothetical admin areas. Output: landuse_raster.tif
oft-shptif.bash landuse.shp landsat_t1.tif landuse_raster.tif landuse
- Let's run oft-admin-mask.bash now using landuse_raster.tif. Note: the output is automatically called landsat_t1_adm.tif.
oft-admin-mask.bash landsat_t1.tif landuse_raster.tif
- Verify in QGIS using a contrast enhancement if the pixel values of landsat_t1_adm.tif are correctly processed.