Learn R Programming

TrajDataMining (version 0.1.6)

douglasPeucker: Douglas Peucker

Description

Douglas-Peucker which reduces trajectories by preserving spatial precisions

Usage

douglasPeucker(A1, dist)

# S4 method for Track,numeric douglasPeucker(A1, dist)

Arguments

A1

Represents a single trajectory followed by a person, animal or object

dist

Distance time series

Value

reduces trajectories by preserving spatial precisions

Examples

Run this code
# NOT RUN {
library(ggplot2)

dist <- max(A1@connections$distance)

douglasp <- douglasPeucker(A1,dist)

df <- data.frame(x=douglasp@sp@coords[,1],y=douglasp@sp@coords[,2])
ggplot(df,aes(x=df$x,y=df$y))+geom_path(aes(group = 1))
# }

Run the code above in your browser using DataLab