为R

问题描述

我尝试将此df (c.data)转换为RasterBrick并将crs设置为EPSG:3035;带有代码的Lambert Equal Area Europe。该代码创建了栅格,但未设置CRS

c.data
# A tibble: 361,478 x 6
         x       y   pop women mean_age hh_size
     <int>   <int> <int> <int>    <int>   <int>
 1 4334500 2684500    NA    NA       NA      NA
 2 4335500 2684500    NA    NA       NA      NA
 3 4336500 2684500    NA    NA       NA      NA
 4 4337500 2684500    NA    NA       NA      NA
 5 4338500 2684500    NA    NA       NA      NA
 6 4339500 2684500    NA    NA       NA      NA
 7 4334500 2685500    NA    NA       NA      NA
 8 4335500 2685500    NA    NA       NA      NA
 9 4336500 2685500    NA    NA       NA      NA
10 4337500 2685500    NA    NA       NA      NA
# ... with 361,468 more rows
c.data_ras <- rasterFromXYZ(c.data,crs = st_crs(3035)$proj4string)
    c.data_ras
class      : RasterBrick 
dimensions : 868,642,557256,4  (nrow,ncol,ncell,nlayers)
resolution : 1000,1000  (x,y)
extent     : 4031000,4673000,2684000,3552000  (xmin,xmax,ymin,ymax)
crs        : NA 
source     : memory
names      : pop,women,mean_age,hh_size 
min values :   1,1,1 
max values :   6,5,5 

相反,我收到此警告

警告消息:

In .newCRS(value) :
+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs is not a valid PROJ.4 CRS string

请,我该怎么办?

谢谢

感谢@lime和@sequoia,我尝试了两个建议,但我仍然遇到相同的错误

c.data_ras <- rasterFromXYZ(c.data,crs = st_crs("+init=epsg:3035")$proj4string)

Warning message:
    In .newCRS(value) :
      +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs is not a valid PROJ.4 CRS string

c.data_ras <- rasterFromXYZ(c.data,crs = st_crs("EPSG:3035")$proj4string)
Warning message:
In .newCRS(value) :
  +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs is not a valid PROJ.4 CRS string

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...