is_linepoint: Identify lines that are points

Description Usage Arguments Details Examples

View source: R/linefuns.R

Description

OD matrices often contain 'intrazonal' flows, where the origin is the same point as the destination. This function can help identify such intrazonal OD pairs, using 2 criteria: the total number of vertices (2 or fewer) and whether the origin and destination are the same.

Usage

1

Arguments

l

A SpatialLinesDataFrame

Details

Returns a boolean vector. TRUE means that the associated line is in fact a point (has no distance). This can be useful for removing data that will not be plotted.

Examples

1
2
3
4
5
6
data(flowlines)
islp <- is_linepoint(flowlines)
nrow(flowlines)
sum(islp)
# Remove invisible 'linepoints'
nrow(flowlines[!islp,])

stplanr documentation built on March 18, 2018, 2:29 p.m.