原谅我太天真了。我无法重新投影 SGDF。
我有一个 xyz (x=longitude, y=latitude, z=value) 3 列数据集。经度和纬度值是 EPSG:3035 格式的坐标。我将数据框转换为空间分辨率为 5 公里 * 5 公里的网格,投影在 EPSG:3035 中。我希望将网格重新投影到 EPSG:4326,空间分辨率为 0.05*0.05。但是我收到以下警告消息:
Warning messages:
1: In spTransform(radon, CRS("+init=epsg:4326")) : Grid warping not available, coercing to points
2: In spTransform(as(x, "SpatialPixelsDataFrame"), CRSobj, ...) : Grid warping not available, coercing to points
谁能告诉我,我如何重新投影网格。下面是一个可重现的小例子:
library(sp)
library(rgdal)
library(raster)
x=c(5013500, 5018500, 4883500, 4888500, 4893500, 4898500, 4908500,4948500, 4953500, 4958500, 4963500, 4973500, 4978500, 4988500, 5008500, 5013500, 5028500, 4878500, 4883500, 4888500, 4893500,4898500, 4903500,4928500, 4963500, 4968500, 4973500, 4978500, 4983500, 4988500)
y=c(5395500, 5395500, 5390500, 5390500, 5390500, 5390500, 5390500,5390500, 5390500, 5390500, 5390500, 5390500, 5390500, 5390500, 5390500,5390500, 5390500, 5385500, 5385500, 5385500, 5385500, 5385500, 5385500,5385500, 5385500, 5385500, 5385500, 5385500, 5385500, 5385500)
z=c(1.74, 1.74, 1.82, 1.82, 1.82, 1.81, 1.81, 1.78, 1.77, 1.77, 1.76,1.76, 1.75, 1.74, 1.73, 1.73, 1.72, 1.82, 1.82, 1.81, 1.81, 1.80, 1.80, 1.78, 1.75, 1.75, 1.74, 1.74, 1.73, 1.73)
df1=data.frame(x,y,z)
coordinates(df1) <- c("x", "y")
proj4string(df1)=CRS("+init=epsg:3035")
gridded(df1)=TRUE
fullgrid(df1)=TRUE
getGridTopology(df1)
x y
cellcentre.offset 4878500 5385500
cellsize 5000 5000
cells.dim 31 3
newgrid = spTransform(df1, CRS("+init=epsg:4326"))
好吧,感谢 Paul,我能够使用gdalwarp重新投影网格。但是,空间分辨率仍然不同:
Coordinates:
min max
x -31.34409 50.36650
y 34.07928 71.87206
Is projected: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]
Grid attributes:
cellcentre.offset cellsize cells.dim
x -31.31151 0.06515996 1254
y 34.11186 0.06515996 580
Data attributes:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-0.11290 0.00000 0.00000 0.06136 0.00000 1.90300
有什么想法吗??