Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jul 15, 2023
1 parent 15ab280 commit a8d50e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions R/geom.R
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,15 @@ setMethod("combineGeoms", signature(x="SpatVector", y="SpatVector"),
if (erase) {
i <- p$id1
yi <- ye[p$id1,]
yi$idx <- p$id2
yi$idy <- NULL
} else {
i <- ye$idy[p$id1]
i <- match(i, y$idy)
yi <- y[i,]
yi$idx <- 0
yi$idx[i] <- p$id2[i]
}
yi$idx <- 0
yi$idx[i] <- p$id2
yi$idy <- NULL
x <- aggregate(rbind(x, yi), "idx", dissolve=dissolve, counts=FALSE)
y <- y[-i,]
Expand Down Expand Up @@ -619,7 +621,6 @@ setMethod("combineGeoms", signature(x="SpatVector", y="SpatVector"),
)



setMethod("split", signature(x="SpatVector", f="ANY"),
function(x, f) {
if (length(f) > 1) {
Expand Down
2 changes: 1 addition & 1 deletion man/combineGeoms.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To append SpatVectors use `rbind` and see methods like \code{intersect} and \cod
\item{boundary}{logical. If \code{TRUE}, a geometry is combined with the geometry it has most shared border with}
\item{distance}{logical. If \code{TRUE}, a geometry is combined with the geometry it is nearest to}
\item{append}{logical. Should remaining geometries be appended to the output? Not relevant if \code{distance=TRUE}}
\item{minover}{numeric}{The fraction of the geometry in code{y} that overlaps with a geometry in \code{x}. Below this threshold, geometries are not considered overlapping}
\item{minover}{numeric. The fraction of the geometry in \code{y} that overlaps with a geometry in \code{x}. Below this threshold, geometries are not considered overlapping}
\item{maxdist}{numeric. Geometries further away from each other than this distance (in meters) will not be combined}
\item{dissolve}{logical. Should internal boundaries be dissolved?}
\item{erase}{logical. If \code{TRUE} no new overlapping areas are created}
Expand Down

0 comments on commit a8d50e9

Please sign in to comment.