inla.simplify.curve: Recursive curve simplification.

Description Usage Arguments Details Value Author(s) Examples

View source: R/mesh.R

Description

Attempts to simplify a polygonal curve by joining nearly colinear segments.

Usage

1

Arguments

loc

Coordinate matrix.

idx

Index vector into loc specifying a polygonal curve.

eps

Straightness tolerance.

Details

Uses a variation of the binary splitting Ramer-Douglas-Peucker algorithm, with a width eps ellipse instead of a rectangle, motivated by prediction ellipse for Brownian bridge.

Value

An index vector into loc specifying the simplified polygonal curve.

Author(s)

Finn Lindgren finn.lindgren@gmail.com

Examples

1
2
3
4
5
6
theta = seq(0, 2*pi, length=1000)
loc = cbind(cos(theta), sin(theta))
idx = inla.simplify.curve(loc=loc, idx=1:nrow(loc), eps=0.01)
print(c(nrow(loc), length(idx)))
plot(loc, type="l")
lines(loc[idx,], col="red")

inbo/INLA documentation built on Dec. 6, 2019, 9:51 a.m.