2

I am trying to load raster image which is in tiff formate in Rstudio. For this I used code

#library (raster)
#library (sp)
#library (rgdal)
#library (tiff)
#wd <- ("E:\\phd\\data\\calliberation test\\rstudio")
#setwd(wd)

#NTL1997F12 <- raster(paste0("cliped images/1997_F12_Indiamap.tif"))

To view details of layer I used code

#NTL1997F12

I got the following result

class      : RasterLayer 

dimensions : 3637, 3507, 12754959  (nrow, ncol, ncell)

resolution : 0.008333333, 0.008333333  (x, y)

extent     : 68.1875, 97.4125, 6.7625, 37.07083  (xmin, xmax, ymin, ymax)

crs        : +proj=longlat +datum=WGS84 +no_defs 

source     : 1997_F12_Indiamap.tif 

names      : X1997_F12_Indiamap 

values     : 0, 255  (min, max)

in the image maximum value show as 255 . to cross-check the maximum value, I imported the same image in QGIS, and looked for raster analysis statistics which shows the maximum value as 63.

can anyone guide me where I went wrong

Phil
  • 7,287
  • 3
  • 36
  • 66
Heena
  • 21
  • 2
  • It is a raster object with more than 12 million cells. GUI software like QGIS, ArcGIS etc. tend to only import a subset, if the data is above a certain size. Did you check whether that is the case? – Chr Jul 29 '21 at 15:34
  • @Chr Thank You for your response. I have use code to set minimum and maximum value of the raster file and my problem stand resolved. – Heena Jul 31 '21 at 09:39

0 Answers0