Skip to content
Prev 27824 / 29559 Next

PROJ6 rgdal::project/sp::spTransform - issue of points that cannot be inverted

I don't know why Roger wants to deprecate rgdal::project, but for
various reasons I implemented a similar function in sf:

library(sf)
# Linking to GEOS 3.8.0, GDAL 3.0.2, PROJ 6.2.1
ll <- cbind(rep(180, 3), c(-89, -90, -89))
xy = sf_project("+proj=longlat", "+proj=moll", ll)
sf_project("+proj=moll", "+proj=longlat", xy)
#      [,1] [,2]
# [1,]  180  -89
# [2,]  Inf  Inf
# [3,]  180  -89
# Warning message:
# In CPL_proj_direct(as.character(c(from[1], to[1])), as.matrix(pts)) :
#   one or more projected point(s) not finite

As it stands now, I want to keep this function in sf, and would be happy
to add an argument to suppress the warning msg.
On 12/6/19 3:25 PM, Daniel Kelley wrote: