Iterative random selection of train sites for supervised classification of image using GRASS GIS and R
The procedure combines GRASS GIS, R and bash scripts to automatically perform several supervised classifications, randomly selecting a different subset of train areas each time.
Maria Francisca Carreño (mariafra # um.es), Jose Antonio Palazon (palazon # um.es) and Javier Martinez-Lopez (javier.martinez # um.es).
Ecology and Hydrology Department - University of Murcia (Spain)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Carreño, M. Francisca, Palazón, José Antonio, & Martínez-López, Javier. (2013, May 19). randomclasiter (Version 1.0). Zenodo. http://doi.org/10.5281/zenodo.1415391
Plain text scripts used for the iterative train selection classification procedure (in order of execution). Tested under Linux. The # symbol appear before comments and '...' stands for input variables.
This first Step is executed under the GRASS GIS environment in order to generate several subsets of random train areas and the corresponding supervised classification maps. Train sites map is used as input, together with the number of train areas to be randomly selected from each land cover class for each classification.
The second script is executed under the GRASS GIS environment in order to create assignation frequency maps for each class and pixel in the map.
This third script is executed under the GRASS GIS environment in order to assign the most frequent land cover class to each pixel.
The fourth script is an intermediate step executed under the GRASS GIS environment in order to rename maps to avoid overwriting.
The fifth script is an intermediate step executed under the GRASS GIS environment in order to delete null values from the class and frequency maps in order to read them properly with R.
The sixth and last script is executed under the R environment (within the GRASS GIS environment) in order to obtain a final classification map in with each pixel has been assigned the class with highest assignment frequency.