【发布时间】:2018-09-07 07:03:36
【问题描述】:
我创建了具有 CRS = UTM 的多边形(请参阅here),我需要将其转换为纬度/经度。我的一些多边形穿过日期变更线,这会导致转换创建一个穿过整个地球的多边形。
library(sp)
library(rgeos)
points <- data.frame(x = c(-179.5, 0), y = c(-50, -30))
coordinates(points) <- ~x+y
proj4string(points) <- '+init=epsg:4326'
points_sp <- spTransform(points, CRS('+init=epsg:32621')) # wrong zone, but ignored for example
# expand point to circle
circles <- gBuffer(points_sp, width = 1e+5)
# transform back to WGS84
circles_latlon <- spTransform(circles, CRS(proj4string(points)))
par(mfrow = c(1, 2))
plot(circles, axes = TRUE, main = 'UTM')
plot(circles_latlon, axes = TRUE, main = 'WGS84')
是否有分割多边形的解决方案?或者解决日期问题的替代解决方案?
【问题讨论】:
标签: r coordinate-transformation sp