as_oshex: Coerce an OSM/OSH XML to an oshex object

Description Usage Arguments Details Examples

Description

Initiates an oshex objet from an OSM/OSH XMLInternalDocument object as given by xmlParse.

Usage

1
as_oshex(osm, parse.tags = FALSE)

Arguments

osm

An OSM/OSH XMLInternalDocument object as given by xmlParse.

parse.tags

A boolean to determine if tags should be parsed. Defaults to FALSE. See 'Details' below.

Details

By default, as_oshex does not store information from tags, node references (for wayList), and member objects (for relationList). Yet filtering can be applied to general attributes, such as: user, object id, timestamp (temporal), and location (with some limited functionalities). The user can decide to parse tags, node references, and member objects by setting parse.tags = TRUE.

This functionality allows users reducing the running time of as_oshex by extracting and storing required data only. Other functions that use tags, such as: some of the uses of osh_filter, will extract and store the information in case it is missing.

Examples

1
2
3
4
5
6
## Not run: 
fname <- "./path_to_some_osh_file.osm"
xml <- XML::xmlParse(fname, encoding = "UTF-8")
osh   <- as_oshex(osm = xml, parse.tags = TRUE) # extract and store tags information

## End(Not run)

dof1985/OSHEX documentation built on May 28, 2019, 3:36 p.m.