[R-sig-Geo] Error in eCclipbool - Incorrect number of arguments (9), expecting 8 for 'Cclipbool

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Tue Apr 14 18:53:33 CEST 2020


On Tue, 14 Apr 2020, Joe Lewis wrote:

> Hi,
>
> I'm trying to create an owin object from a SpatialPolygons, but I'm getting
> the following error:
>
> Error in .Call(eCclipbool, A, B, pftA, pftB, ct, x0, y0, eps, closed,  :
> Incorrect number of arguments (9), expecting 8 for 'Cclipbool'
>
> I'm using as.owin.SpatialPolygons from the Maptools package.
>
> Reproducible example:
>
> x <- raster::getData(name = "GADM", country = "GBR", level = 3)
>
> x <- x[x$NAME_3 == "Falkirk",]
>
> osgb <- "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000
> +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs"
>
> x <- sp::spTransform(x, osgb)
>
> x <- rgeos::gSimplify(x, tol = 4, topologyPreserve = TRUE)
>
> # this works fine.
> x1 <-  maptools::as.owin.SpatialPolygons(as(raster::extent(x),
> "SpatialPolygons"))
>
> # this causes the above error
> x2 <-  maptools::as.owin.SpatialPolygons(x, "SpatialPolygons")

Using your example with both FALSE and TRUE settings of 
spatstat::spatstat.options("checkpolygons"), I cannot reprodoce any error.

This with spatstat_1.63-3, spatstat.data_1.4-3, polyclip_1.10-0 on R 4.0.0 
beta. You are using development versions of these packages. Note that 
gSimplify() may not be deterministic, and that changes in PROJ/GDAL render 
your use of spTransform() degraded. You need to read through 
https://www.r-spatial.org/r/2020/03/17/wkt.html.

Hope this helps,

Roger



>
> ---
>
> Session Info:
>
> R version 3.4.1 (2017-06-30)
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] Rcpp_1.0.3            lattice_0.20-35       codetools_0.2-15
> deldir_0.1-25         grid_3.4.1
> [6] nlme_3.1-131          tensor_1.5            raster_2.8-19
> spatstat_1.63-3.032   sp_1.3-1
> [11] rpart_4.1-12          goftest_1.2-2         Matrix_1.2-10
> spatstat.utils_1.17-0 rgdal_1.4-3
> [16] tools_3.4.1           foreign_0.8-69        polyclip_1.10-0.001
> spatstat.data_1.4-3   abind_1.4-5
> [21] compiler_3.4.1        maptools_0.9-9        mgcv_1.8-17
> rgeos_0.4-3
>
> Any help would be appreciated.
>
> Thank you.
>
> Kind regards,
> Joseph Lewis
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en



More information about the R-sig-Geo mailing list