gPolyByIntersect: Return polygons intersecting with a container

Description Usage Arguments Details Examples

Description

This is the preferred function. It has been optimized for speed and flexibility. Allows choice of centroid or areal overlap (intersection). Amount of overlap (for non-centroid intersection methods) specified by threshold defaults to zero which returns an intersection for two polygons that share any one point (unfortunately) including a border.

Usage

1
gPolyByIntersect(container, reference, threshold = 0, centroid = F)

Arguments

container

The single polygon that will enclose the set of reference polygons

reference

The set of polygons that will be selected down to the containing polygon based on areal overlap

threshold

The percent of areal overlap required for inclusion (ignored if centroid = T)

centroid

Logical return reference polygons whose centroids are contained within the container

Details

Note: all inputs should be of class sp::SpatialPolygons|SpatialPolygonsDataFrame.

Will warn if CRS mismatch between reference / container.

Examples

1
2
3
4
bgoi.clip = gBoundingPolyClip(box_parkway, bg_no_data)
bgoi.cent = gPolyByIntersect(box_parkway, bgoi.clip, centroid = T)
bgoi.area.20 = gPolyByIntersect(box_parkway, bgoi.clip, threshold = 0.2) 
bgoi.intersect = gPolyByIntersect(box_parkway, bgoi.clip) 

townleym/mSpatial documentation built on May 31, 2019, 6:46 p.m.