我有一张作为“geotiff”格式的海冰地图。最终目标是提取特定纬度/经度坐标处的海冰浓度。
可以在以下链接中找到该“geotiff”: http://www.iup.uni-bremen.de:8084/amsr2data/asi_daygrid_swath/n6250/2015/jan/asi-AMSR2-n6250-20150101-v5.tif 我的目标是使用raster()加载geotiff,然后将其叠加到我的位置上,然后使用extract()函数从特定位置获取栅格文件中的值。
然而,我的纬度/经度点积累在地图的中心。我错在哪里?非常感谢任何帮助或意见!
可以在以下链接中找到该“geotiff”: http://www.iup.uni-bremen.de:8084/amsr2data/asi_daygrid_swath/n6250/2015/jan/asi-AMSR2-n6250-20150101-v5.tif 我的目标是使用raster()加载geotiff,然后将其叠加到我的位置上,然后使用extract()函数从特定位置获取栅格文件中的值。
然而,我的纬度/经度点积累在地图的中心。我错在哪里?非常感谢任何帮助或意见!
library(raster)
library(sp)
r1 = raster("test.tif")
##check plot
plot(r1)
## check projection
projection(r1)
mydf <- structure(list(longitude = rep(22,7), latitude = seq(60,90,5)),.Names = c("longitude","latitude"), class = "data.frame", row.names = c(NA, -7L))
### Get long and lat from data.frame.
xy <- mydf[,c(1,2)]
spdf <- SpatialPointsDataFrame(coords = xy, data = mydf,
proj4string = CRS("+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"))
points(spdf, col="red", lwd=2)
##extract RGB values as reference for sea-ice concentration
seaice_conc = extract(r1, spdf)