简体   繁体   中英

raster values are all NAs

I've got a raster of leaf area index (MODIS product) with the sinusoidal coordinate system. I open it using raster() function and it shows values are between 0 and 254 which is exactly what I could see when I opened it in ArcMap. Plotting the raster also displays it correctly. But when I call values() of that it turns all the cells as NAs. I also tried head(), tail(), getValues() and all I've got is NAs. Here are my codes:

A2000057<- raster ('MODIS/LAI/clip/A2000057.Lai_500m.tif')

A2000057

class       : RasterLayer 
dimensions  : 3038, 6292, 19115096  (nrow, ncol, ncell)
resolution  : 463.3127, 463.3127  (x, y)
extent      : 12449213, 15364376, -4359773, -2952229  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs 
data source : C:GIS work/MODIS/LAI/clip/A2000057.Lai_500m.tif 
names       : A2000057.Lai_500m 
values      : 0, 254  (min, max)

values(A2000057)

   [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
  [35] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
  [69] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
.
.
.
.
 [953] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [987] NA NA NA NA NA NA NA NA NA NA NA NA NA NA

 [ reached getOption("max.print") -- omitted 19114096 entries ]

head(value)

[1] NA NA NA NA NA NA

tail(value)

[1] NA NA NA NA NA NA

NAvalue(A2000057)

[1] -Inf

From what you show there is nothing that suggests that all your values are NA . And, given that the object can be used make a correct plot, this is obviously not the case. What you are showing is that first and last cell values are NA. That is common (NA values at the poles). What is your real question?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM