R Under development (unstable) (2023-05-24 r84463 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > options("rgdal_show_exportToProj4_warnings"="none") > library(sp) The legacy packages maptools, rgdal, and rgeos, underpinning this package will retire shortly. Please refer to R-spatial evolution reports on https://r-spatial.org/r/2023/05/15/evolution4.html for details. This package is now running under evolution status 0 > > if (require(rgeos, quietly = TRUE)) { + g = SpatialGrid(GridTopology(c(0,0), c(1,1), c(3,3))) + p = as(g, "SpatialPolygons") + over(g,g) + over(p,p) + over(p,p, minDimension = 0) # orders; different names + over(p,g) + over(g,p) + + over(p,p,returnList=TRUE) + over(p,p,returnList=TRUE, minDimension=0) + over(p,p,returnList=TRUE, minDimension=1) + over(p,p,returnList=TRUE, minDimension=2) + over(p,p[1:6],minDimension=2) + + x2 = x1 = cbind(c(0,1,1,0,0), c(0,0,1,1,0)) + x1[,1] = x1[,1]+0.5 + x1[,2] = x1[,2]+0.25 + sp = SpatialPolygons(list( + Polygons(list(Polygon(x1)), "x1"), + Polygons(list(Polygon(x2)), "x2"))) + pt = SpatialPoints(cbind(0.5,0.5)) # on border of x1 + row.names(pt) = "pt1" + over(pt,sp) + over(pt,sp,returnList=TRUE) + + rgeos::overGeomGeom(pt,sp) + rgeos::overGeomGeom(pt,sp,returnList=TRUE) + + plot(sp) + plot(pt,add=TRUE,col='red',pch=16) + # x1 x2 + # "F0FF" "0FFF" + # it would be nice to have these sorted "2, 1" instead of "1, 2" - use + rgeos::overGeomGeom(pt,sp,returnList=TRUE, minDimension = 0) + + rgeos::overGeomGeom(pt,pt,minDimension=2) + rgeos::overGeomGeom(pt,pt,minDimension=1) + rgeos::overGeomGeom(pt,pt,minDimension=0) + } rgeos version: 0.6-3, (SVN revision 696) GEOS runtime version: 3.11.2-CAPI-1.17.2 Please note that rgeos will be retired during October 2023, plan transition to sf or terra functions using GEOS at your earliest convenience. See https://r-spatial.org/r/2023/05/15/evolution4.html for details. GEOS using OverlayNG Linking to sp version: 1.6-0 Polygon checking: TRUE pt1 1 > > proc.time() user system elapsed 0.48 0.06 0.53