嗨,我一直在尝试将光栅图像从 Equirectangular 重新投影到 EPSG:4326 (Latlon),问题是每次我在 R 上运行我的代码时,我都会在新图像上得到错误的坐标;我不知道代码中的错误在哪里,我也用 Qgis 做了同样的过程,我得到了同样的结果,这很奇怪,我有机会在 ENVI 中做同样的重投影过程,结果成功了,求助!!!
a <- raster("C:/Users/<username>/Documents/imageexample.tif")
> a
class : RasterLayer
dimensions : 1800, 1800, 3240000 (nrow, ncol, ncell)
resolution : 1100, 1100 (x, y)
extent : -988900, 991100, 1677577, 3657577 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=eqc +lat_ts=0 +lat_0=24 +lon_0=-112 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : C:/Users/<username>/Documents/imageexample.tif
names : imageexample
g1 <- projectRaster(a, crs="+init=epsg:4326")
> g1
class : RasterLayer
dimensions : 1810, 1810, 3276100 (nrow, ncol, ncell)
resolution : 0.00988, 0.00988 (x, y)
extent : -120.9328, -103.05, 39.02317, 56.90597 (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
data source : in memory
names : imageexample.tif
values : -5.000117, 39.87529 (min, max)
正确的坐标应该是这样的:
class : RasterLayer
dimensions : 1793, 1803, 3232779 (nrow, ncol, ncell)
resolution : 0.0108098, 0.009931556 (x, y)
extent : -121.735, -102.245, 15.08612, 32.8934 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : C:/Users/<username>/Documents/CORRECTimageexample.tif
names : CORRECTimageexample
谢谢!!!