oscarperpinan / meteoForecast

A package to access outputs from Numerical Weather Prediction models both in raster format and as a time series for a location
GNU General Public License v3.0
51 stars 25 forks source link

Resolution=36 projection is wrong #18

Closed ricardo88faria closed 8 years ago

ricardo88faria commented 8 years ago

Hi,

I have a raster, obtained from a netcdf which is in (Lambert Conic Conformal projection):

library(meteoForecast)
wrf_temporary <- getRaster("temp", day = Sys.Date(), frames = 'complete', resolution = 36, service = "meteogalicia")
wrf_temporary

extent      : -18, 4230, -18, 3726  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lcc +lat_1=43 +lat_2=43 +lat_0=34.82300186157227 +lon_0=-14.10000038146973 +x_0=536402.34 +y_0=-18558.61 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=km +no_defs 

mfExtent('meteogalicia', resolution = 36)

class       : Extent 
xmin        : -49.18259 
xmax        : 18.789 
ymin        : 24.03791 
ymax        : 56.06608 

Now I want to transform that wrf_temporary raster to "+proj=longlat +datum=WGS84" (lat long degree), but the result is wrong. Try:

image(wrf_temporary, layers = 1)
plot(getMap(resolution = "high"), add = T)

Being discussed in: stackoverflow

Thanks in advance, Ricardo Faria

barryrowlingson commented 8 years ago

The netcdf file for resolution=36 has some different projection parameters. See the linked SO question for my answer!

oscarperpinan commented 8 years ago

Thanks!