0

I have never used satellite data and I'm using NASA's information of PM2.5 "Global Annual PM2.5 Grids from MODIS, MISR and SeaWiFS Aerosol Optical Depth (AOD), 1998-2019, V4.GL.03", I got it from here. It is a 1 km resolution of PM2.5.

I want to get information of PM2.5 only for a certain area: xlim = c(-115.21,-115.763246), ylim = c(32.38, 32.702345) and for xlim = c(-116.903885, -117.142257),ylim = c(32.35, 32.591890).

When I download the data I get a folder with 6 files. I'm trying to work with the .tif.ovr file.

I understand that I need to read the raster

n14 <- "~/nasa2014.tif.ovr"
r <- raster(n14) 

but I don't understand how to access the data. I saw this post but it didn't work.

My file looks like this:

class      : RasterLayer 
dimensions : 6250, 18000, 112500000  (nrow, ncol, ncell)
resolution : 1, 1  (x, y)
extent     : 0, 18000, 0, 6250  (xmin, xmax, ymin, ymax)
crs        : NA 
source     : nasa2014.tif.ovr 
names      : nasa2014.tif 
2
  • 1
    is there a nasa2014.tif file among your files? If so, try to import that file instead of the nasa2014.tif.ovr. Also, it's better to use the terra package instead of the raster, like so: r <- rast(nasa2014.tif).
    – Nikos
    Sep 3, 2023 at 18:35
  • yes, you were right, I have a .tif that when I read it with terra I get .class : SpatRaster dimensions : 12500, 36000, 1 (nrow, ncol, nlyr) resolution : 0.01, 0.01 (x, y) extent : -180, 180, -55, 70 (xmin, xmax, ymin, ymax) coord. ref. : lon/lat WGS 84 (EPSG:4326) source : sdei-global-annual-gwr-pm2-5-modis-misr-seawifs-aod-v4-gl-03-2014.tif name : sdei-global-annual-gwr-pm2-5-m~misr-seawifs-aod-v4-gl-03-2014 min value :0.6 max value : 189.1
    – Lilia
    Sep 3, 2023 at 18:44

1 Answer 1

0

The .ovr file contains "overview" images - lower-resolution versions of the main data file to make mapping at low resolutions quicker, for software that understands it.

If you try creating a terra raster from the overviews file, it will tell you it doesn't have a known extent, and map it to coordinates 1:n, 1:m.

> ovr = rast("./popdens.tif.ovr")
Warning message:
[rast] unknown extent 
> ext(ovr)
SpatExtent : 0, 268, 0, 217 (xmin, xmax, ymin, ymax)

Compare with reading the tif file itself:

> tif = rast("./popdens.tif")
> ext(tif)
SpatExtent : 152881.239999998, 166256.239999998, 378970.300700001, 389795.300700001 (xmin, xmax, ymin, ymax)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.