Closed ambuehll closed 1 year ago
Hi @ambuehll, thanks for the report and the reproducible example. I am not sure what is causing your issue but it works fine on my computer:
library(sp)
CBDcoo <- c( -9.150055, 38.725095)
CBDcoo <- SpatialPoints(matrix( CBDcoo,ncol = 2),proj4string = CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.3, PROJ 8.2.0; sf_use_s2() is TRUE
CBDcoo <- st_as_sf(CBDcoo)
center_poly <- stplanr::geo_buffer(CBDcoo,dist=7500)
plot(center_poly)
Created on 2022-08-30 with reprex v2.0.2
It seems you're using slightly out-dated versions of PROJ etc. I cannot be sure that is the cause but could you try running the code on an environment with more-up-to-date system dependencies?
Thanks for the quick answer. I tried it out with another windows server (even though with an older PROJ version) and it worked again! Not sure where the problem lies. If I find more, I'll re-post.
Intermediate versions of PROJ seem to be the culprit. If this is the default version installed with the most recent version of sf
that is not good and very glad you alerted me to it. In this case, not much I can do atm but wish you good luck!
Hi there
first of all, thanks for the great package. I had used it for a long time. Somehow my old script broke recently.
What I wanted: a buffer of width 7500m around a single point. this used to be quite straight-forward. I changed the sp to a SF, but still doesn't help. Now I get:
Error in rep(dist, length.out = length(x)) : attempt to replicate an object of type 'closure'
Here is an MWE:
Any help would be appreciated.
R 4.1.2 stplanr 1.0.1 Windows
Thanks, Lukas