poly.outer: Create a masking polygon to block out graphics outside a...

Description Usage Arguments Value Author(s) See Also Examples

Description

Takes a polygon object and creates a new polygon whose outline is rectangular, but has a hole shaped like the input polygon cut into it. This is useful for plotting surfaces defined over a study area, but masking the values outside of the area. It is designed to work with pixel images, so that the mask covers up all parts of the image not in the input polygon.

Usage

1
poly.outer(exo.object,input.poly,extend=0)

Arguments

exo.object

The object extending beyond input.poly that is to be masked. This is required to ensure that the external rectangle of the mask will be large enough.

input.poly

The polygon used to make the hole in the mask.

extend

A buffer used to extend the mask if it is required to be larger than exo.object

Value

A polygon object whose outline is rectangular, but having holes cut into it in the shape of input.poly

Author(s)

Chris Brunsdon

See Also

add.masking, kde.points.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Data for New Haven to use in example
data(newhaven)
# Do the KDE
breach.dens = kde.points(breach,lims=tracts)
# Plot the result
level.plot(breach.dens)
# Block out the part outside the study area
masker = poly.outer(breach.dens,tracts,extend=100); add.masking(masker)
# Plot census tract boundaries
plot(tracts,add=TRUE)

Example output

Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
Loading required package: RColorBrewer
Loading required package: MASS
Loading required package: rgeos
rgeos version: 0.3-23, (SVN revision 546)
 GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
 Linking to sp version: 1.2-3 
 Polygon checking: TRUE 

NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

GISTools documentation built on May 6, 2019, 1:09 a.m.