[R-sig-Geo] How to identify the different discrete classes from a raster of land cover data (tif).

Ben Tupper btupper @end|ng |rom b|ge|ow@org
Tue Mar 2 19:50:04 CET 2021


Hi,

I'm not familiar with the dataset, but I am guessing it is related to how
the labels are encoded. If that is the case, then it is possible the stored
class labels are not literally 1-23 but are 23 labels selected from the
range of 0-255.  You could do a brief check with ...

table(r[])

Cheers,
Ben



On Tue, Mar 2, 2021 at 12:15 PM Manuel Spínola <mspinola10 using gmail.com> wrote:

> Dear list members,
>
> I am working with a .tif file from the Copernicus Global Land Service with
> land cover data.  The file has 23 discrete classes but the raster shows a
> continuous range of values (0 to 255).
>
> r =
>
> raster(W100N20_PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif)
>
> class      : RasterLayer
> dimensions : 20160, 20160, 406425600  (nrow, ncol, ncell)
> resolution : 0.0009920635, 0.0009920635  (x, y)
> extent     : -100, -80, 0, 20  (xmin, xmax, ymin, ymax)
> crs        : +proj=longlat +datum=WGS84 +no_defs
> source     :
> /Users/manuelspinola/Documents/01-Manolo/R_OVS_material/landscape_ecology/datos_copernicus/W100N20_PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif
> names      :
> W100N20_PROBAV_LC100_global_v3.0.1_2019.nrt_Discrete.Classification.map_EPSG.4326
> values     : 0, 255  (min, max)
>
>
>
> How can I recognize the different discrete classes included in the raster
> representing each land cover type.
>
> Manuel
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspinola using una.cr <mspinola using una.ac.cr>
> mspinola10 using gmail.com
> Teléfono: (506) 8706 - 4662
> Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
Ben Tupper
Bigelow Laboratory for Ocean Science
East Boothbay, Maine
http://www.bigelow.org/
https://eco.bigelow.org

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list