-
RasSelec: Selection of a subset of raster cells
Direct access to online help: RasSelec
Access the application from the menu: "Tools | Image processing | Selection of a subset of raster cells"
Presentation
This application selects a subset of cells from a single-band or multiband raster, from the IMG format or by reading the file through the GDAL/OGR libraries. Its interface and operation are highly symmetrical with those of the VecSelec application, which allows similar operations to be performed on vector layers, and with the MiraMon query by attributes.
By default, the result contains a raster with the original values of the selected cells and a NoData value in all cells that do not meet the condition (as well as in cells that were already NoData in the original raster or rasters). However, the output file can also be defined in the form of a raster mask, in which the cells that meet the condition will contain a 1, and those that do not, will contain a 0 or a NoData value (recommended), at the user's choice.
In addition, the application allows, optionally, to clip the raster adjusted to the bounding box of the selection. It is also possible to define the output file in mask format with the option to mark cells that do not meet the selection as a NoData value.
If the raster is multiband, the user can define the selection using several bands without the obligation to use the indicated band as the source file; this flexibility applies whether the output file is single-band or multiband. If bands with different grid sizes of the multiband raster are chosen in the selection, the selection will not be possible and, therefore, no output file will be generated; in this case, the user can achieve the same area and grid size by previously executing AdapRas.
In case of selecting the output file as multiband, the selection will only be applied to the bands that have the same grid size as the band in the source file.

Dialog boxes of the application
|
|
RasSelec dialog boxes in a selection case on an IMG raster |
|
|
RasSelec dialog boxes in a selection case on an IMG raster which is accessed via GDAL |

Graphic examples
|
|
|
Example of applying RasSelec on an IMG raster (first image) in which orthometric altitudes greater than or equal to 2500 m have been selected (second image) and a mask has been generated with this selection (third image). |

Syntax
Syntax:
- RasSelec InputFile OutputFile [/RETALL_SEL] [/PREFIX] [/MASC_NODATA] [/MULTIBANDA] [/COND#_OP] [/COND#_CAMP] [/COND#_VALOR] [/COND#_NEXE] [/BANDA] [/SDS] [/MASC]
Parameters:
- InputFile
(Input file -
Input parameter): Input file for selection.
- OutputFile
(Output file or directory -
Output parameter): Output file in case of single-band, or output directory in case of multiband.
Modifiers:
/RETALL_SEL
(Clip to selection)
Clip output raster to selection. (Input parameter) /PREFIX=
(Multibanda prefix)
Prefix in the output files in case of multiband. (Input parameter) /MASC_NODATA
(Set 0 as NoData)
In case the output is selected as mask format, 0 (false condition) is marked as a value without data. (Input parameter) /MULTIBANDA
(Multiband output)
In case the source file is multiband, the output is also set to be multiband. (Input parameter) /COND#_OP=
(Conditions or operator)
Selecting the logical operator acting on /COND_CAMP(band) to filter the cells of the source file. For more details on this and the following modifiers, see Selection of graphic objects according to database attributes, or raster cells for querying their values in General syntax aspects in the MiraMon Support Applications (MSA). (Input parameter) /COND#_CAMP=
(Bands of the condition)
Selection of the field on which they will apply the /COND_OP (Input parameter) /COND#_VALOR=
(Value of the condition)
Value of /COND_CAMP on which it will apply the /COND_OP. It must be between double quotation marks if it has spaces. (Input parameter) /COND#_NEXE=
(Nexus between conditions)
Nexus between conditions # and #+1. It can be AND or OR. (Input parameter) /BANDA=
(Band)
In the case of a file read via GDAL, it refers to the reference band to which the selection is to be applied. If the band is not indicated, the first reference band will be used. If multiband output is selected, all bands from the same data subset that have the same grid spacing as the reference band will be written. (Input parameter) /SDS=
(Subdataset)
In the case of a file read via GDAL, it is the subset of data from the input file on which the selection is to be applied. (Input parameter) /MASC
(Output file as a mask)
The output file will be saved as a mask; that is, cells matching the selection conditions will have a value of 1, while cells that do not will have a value of 0 (/MASC_NODATA can also be consulted). The output file will be saved in compressed and indexed byte format. (Input parameter)
