filterSF: filterSF

Description Usage Arguments Value Author(s) Examples

View source: R/getOSM.R

Description

Filter the Simple Feature output from sfOSM.

Usage

1
2
filterSF(sf, tf = NULL, id = NULL, version = NULL, nodes = NULL,
  timestamp = NULL, plot = FALSE, trimtags = TRUE, pal, ...)

Arguments

sf

Input Simple Feature

tf

Filter by tag key/values

id

Filtery by id

version

Filtery by version

nodes

Filtery by nodes (Only for ways)

timestamp

Filtery by timestamp. The column will be detected, if it is configured as POSIXct.

plot

Plot the result? Default is FALSE.

trimtags

Trim teh tag names? Default is TRUE

pal

A color palette

...

Passed on to grep

Value

The filtered Simple Feature

Author(s)

Sebastian Gatscha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
dblist <- list(dbname="test", dbuser="postgres", dbhost="localhost",
               dbport="5432", dbpwd="hallo")

## Working with OSM Ways
ways <- sfOSM(dblist, elem="ways")
r <- filterSF(ways, id=4383033, plot=T);
r <- filterSF(ways, nodes="5339632222,5343805366,5343805367,5343805368,5343805369,5339632232",
              plot=T, fixed=T);
r <- filterSF(ways, tf="primary", version = 11, plot=T);
r <- filterSF(ways, tf=c("footway", "path"), version = c(11,12), plot=T);
r <- filterSF(ways, id=184691002, plot=T);
r <- filterSF(ways, tf="surface\"=>\"asphalt", plot=T);
r <- filterSF(ways, tf=c("footway", "path"), plot=T, pal=c("blue","red"));
r <- filterSF(ways, tf=c("secondary", "residential","footway", "path"),
              plot=T, pal=rainbow(5));

## Working with OSM Nodes
nodes <- sfOSM(dblist, elem="nodes")
r <- filterSF(nodes, tf="highway", plot=T);
r <- filterSF(nodes, tf="crossing", version=11, plot=T);
r <- filterSF(nodes, version=9,  plot=T);
r <- filterSF(nodes, id=26936524,  plot=T);

YsoSirius/getOSM documentation built on May 28, 2019, 8:59 p.m.