geCheck: geCheck

Description Usage Arguments Details Value See Also Examples

View source: R/geCheck.R

Description

Finds overlaps between polygons in the same shapefile.

Usage

1

Arguments

x

An object of class SpatialPolygons or SpatialPolygonsDataFrame.

Details

compares all elements of x and returns a a list containing:

Value

A list.

See Also

spCentroid ecDistance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{

require(raster)

# build polygons
df1 <- data.frame(x=c(1, 5, 10, 2, 1), y=c(10, 9, 8, 7, 10))
df2 <- data.frame(x=c(2, 6, 5, 4, 2), y=c(10, 9, 7, 4, 10))
p <- list(Polygons(list(Polygon(df1)), ID=1), 
Polygons(list(Polygon(df2)), ID=2))
p <- SpatialPolygons(p)

# check overlap
co <- geCheck(p)

# show distance matrix
plot(p)
plot(co$overlap.shp, col="red", add=TRUE)

}

fieldRS documentation built on July 8, 2020, 5:37 p.m.