You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example should remove all doubt on how to reproject tiled Daymet data. The example downloads a single tile around Cape Cod, a distinct geographic feature. I plot the data in the corrected projection, as well as reprojected to EPSG 4326.
In short, the correct CRS projection of the tiled data is:
+proj=lcc +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs
unlike what is reported in the tile meta-data!
library(daymetr)
library(raster)
library(sp)
library(rnaturalearth)
# download data
download_daymet_tiles(tiles=11755, param="prcp", start=1980, end=1980)
# read rasterr<-raster::raster(file.path(tempdir(),"prcp_1980_11755.nc"))
# set the correct projectionraster::projection(r) <-"+proj=lcc +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs"# reproject to lat longr_ll<-raster::projectRaster(r, crs="+init=epsg:4326")
# grab usa outlines from rnaturalearthusa_ll<- ne_countries(scale=50, country="United States of America", returnclass="sp")
usa<- spTransform(usa_ll, CRSobj= CRS("+proj=lcc +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs"))
# plot simple overview graphs
par(mfrow= c(2,1))
plot(r, main="LLC projection")
lines(usa)
plot(r_ll, main="lat lon projection")
lines(usa_ll)
The text was updated successfully, but these errors were encountered:
When querying data using NCSS subsets (with coordinates, not tiled data) you might find that bounding boxes do not correspond to your query. You pass lat / lon coordinates which aren't orthogonal in the LCC "space". Hence, your bounding box of your query will change.
This example should remove all doubt on how to reproject tiled Daymet data. The example downloads a single tile around Cape Cod, a distinct geographic feature. I plot the data in the corrected projection, as well as reprojected to EPSG 4326.
In short, the correct CRS projection of the tiled data is:
+proj=lcc +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs
unlike what is reported in the tile meta-data!
The text was updated successfully, but these errors were encountered: