-
CanviRes: Changing raster pixel side (exact multiples)
Access this help text as a web page: CanviRes
Presentation
This application changes a raster pixel side without changing its origin. Pixel side change can be done either by contraction or expansion of the original pixels. In order to change the origin of the raster grid, the application DensRas should be used, or the application AdapRas for more sophisticated operations, particularly to expand the geographic extent by filling it with NoData. At the end of this text there is a summary explaining when CanviRes should be used and when DensRas should be used, including the options for each one.
EXPANSION:
Is done by repeating pixel values both in rows and columns. Parameter WindowSide (or expansion factor) will be a positive integer number; e.g. a value of 3 indicates that the number of files and columns will be tripled (and make the file 9 times larger in number of cells).
CONTRACTION:
Is performed from the central value, the mode value, average, median or maximum value of a 'window' of pixels. The WindowSide parameter (or contraction factor) will be a negative integer number. When WindowSide is an even number and the Central value criterion is chosen the lower left pixel of the four central pixels is taken. When using the Modal value as the contraction criterion and if the most frequent value for a given window is represented two or more times, we can choose between: MODA_NO_UNICA_NODATA, MODA_NO_UNICA_PRIMER or MODA_NO_UNICA_IMPARCIAL, and/or MODA_NO_UNICA_FITXER
RECOMMENDATIONS for the EXPANSION:
- Images of CATEGORICAL variables (thematic classes). The duplication method of CanviRes is adequate. If we wish an aesthetical improvement we can complete the process by using the methodology described in Xavier Pons' Ph D thesis, p. 213, paragraph 3.4.3. The complete reference is:
Pons, X. (1993) Aportacions a la teledetecció i als sistemes d'informació geogràfica en estudis de vegetació. Bellaterra. Servei de Publicacions de la Universitat Autònoma de Barcelona. 427 p. ISBN: 84-7929-647-X.
- Images of CONTINUOUS variables.
- For sensor images CanviRes will be used in order to avoid corrupting the radiometry since a classification is wanted; this option will is rarely interesting since it is more efficient to classify the image in its original resolution (informative power) and then expand the result. We will use the mean or the application DensRas (RECOMMENDED, and in bilinear mode) when what the user wants to do is an expansion for visual interpretation.
- For digital elevation models the application DensRas is the optimal solution.
RECOMMENDATIONS for the CONTRACTION:
- Images of CATEGORICAL variables (thematic classes). The Central and Mode methods are adequate, even though the Mode is RECOMMENDED, in general, for its superior performance in generalization.
Notice that the Mode can originate new NoData values in those cells where it is not unequivocally defined, unless one of the options to avoid it will be specified: /MODA_NO_UNICA_IMPARCIAL, /MODA_NO_UNICA_PRIMER y/o /MODA_NO_UNICA_FITXER.
- Images for CONTINUOUS variables. Any of the six methods of CanviRes can be used, even though the Mode does not usually have any interesting spatial significance.
- For sensor images the Central value will be used to avoid corrupting the radiometry (for instance in image classification) and the median or the mean will be used to contract for a visual interpretation. Program DensRas is not usually adequate since it only takes into account pixels immediately around the central value and not the whole window, unless the user previously approximates the size of the desired cell with CanviRes.
- For digital elevation models the mean will be used in case the value of each pixel informs on the mean height of the whole cell and the application DensRas will be used in case the value of the pixel informs on the height of the central point of the cell (the method of the central value of CanviRes is nothing more than a particular case that DensRas already takes into account when performing its calculations since this application applies exact interpolators [bilinear mode is recommended]).
- Images of all kind (CATEGORICAL or CONTINUOUS): The Central value (with a value of WindowSide large enough) can be used to perform a sampling avoiding spatial autocorrelation. Given the characteristics of the CanviRes application, sampling will be regularly distributed over the space.
RECOMMENDATIONS SUMMARY (where DensRas is indicated also applies to AdapRas)
EXPANSION: + Categorical Map: CanviRes [followed by the method in X. Pons' Ph D thesis]
+ Sensor image: CanviRes for classification (not recommended)
DensRas L, for visual analysis
+ DEM: DensRas L
CONTRACTION:+ Categorical Map: CanviRes, M option
+ Sensor image: CanviRes, C option for classification
CanviRes, d or m option for visual analysis
+ DEM: CanviRes, d or m option for median or mean heights
DensRas L, for heights that prioritize central values in the resulting cell
Dialog box of the application
Syntax
Syntax:
- CanviRes InputFile OutputFile WindowSide [/NODATA_SI_NODATA_MAJORIA] [/RLE]
- CanviRes InputFile OutputFile WindowSide ContractionCriterion [/NODATA_SI_NODATA_MAJORIA] [/RLE] [/MODA_NO_UNICA_PRIMER] [/MODA_NO_UNICA_NODATA] [/MODA_NO_UNICA_IMPARCIAL] [/MODA_NO_UNICA_FITXER] [/MEDIANA_EMPAT]
Parameters:
- InputFile
(Input file -
Input parameter): Raster input file.
- OutputFile
(Output file -
Output parameter): Output raster file.
- WindowSide
(Window side -
Input parameter): Is an integer number. Its value is greater than 1 for expansion and less than -1 for contraction.
- ContractionCriterion
(Contraction criterion -
Input parameter): Contraction criterion is only specified when WindowSide is negative. Its value can be:
- C (Central value)
- M (Mode)
- m (mean)
- d (median)
- X (maximum)
- i (minimum)
Modifiers:
/NODATA_SI_NODATA_MAJORIA (Assigning NoData value when NoData is predominant) This option is used to assign the NoData value when this is predominant in the convolution window. Does not use it implies that the corresponding calculation despite that valid values are minority. (Input parameter) /RLE (RLE) When the output file is an IMG file, this file will be compressed and indexed. (Input parameter) /MODA_NO_UNICA_PRIMER
(Modal value not unique first candidate)
The candidate with the smallest value to the modal value is assigned to the result. It is the option used by default. (Input parameter) /MODA_NO_UNICA_NODATA
(Modal value not unique NoData)
In case there is more than one modal value, the value of NoData will be assigned. (Input parameter) /MODA_NO_UNICA_IMPARCIAL
(Modal value not unique impartial)
In case there is more than one modal value, the candidate will be chosen according to impartial criteria. (Input parameter) /MODA_NO_UNICA_FITXER=
(Modal value not unique raster value)
In case there is more than one modal value, the reference raster file will be where the programm consults the value to assign a value to the result. For the cells in which this raster has no value, the other criteria (smaller value, NoData or impartial) will be applied. (Input parameter) /MEDIANA_EMPAT=
(Decision for the median)
If the calculation of the median has been requested, indicate the type of tiebreaker to be used for its calculation, in case of having an even number of values. The criterion will also be applied when the mean of the absolute deviations with respect to the median must be calculated (since it requires calculating the median), or some quartile or percentile (in which tie situations can occur). The calculation options are:- 1 to choose alternate value.
- 2 to choose lower value.
- 3 to choose upper value. Li >
- 4 to choose average of the central values.
(Input parameter)