osm_tags_df {osmclass}R Documentation

Extract Tags as Columns from an OSM PBF Layer

Description

Extract Tags as Columns from an OSM PBF Layer

Usage

osm_tags_df(data, tags, na.prop = 0)

Arguments

data

an imported layer from an OSM PBF file. Usually has a few important tags already expanded as columns, and an 'other_tags' column which compounds less frequent tags as character strings.

tags

character. A vector of tags to extract as columns.

na.prop

double. Proportion of features having a tag in order to keep the column.

Value

a data.table with the supplied tags as columns, and the same number of rows as the input frame.

See Also

osmclass-package

Examples

# See Examples at ?osmclass for full examples

# Extracting tags of interest (some of which are inside 'other_tags')
tags <- c("osm_id", "highway", "man_made", "name", "alt_name",
          "description", "wikidata", "amenity", "tourism")
head(osm_tags_df(djibouti_points, tags))

# Only keeping tags with at least 5\% non-missing
head(osm_tags_df(djibouti_points, tags, na.prop = 0.05))


[Package osmclass version 0.1.3 Index]