as_osmar: Convert OSM-XML to an osmar object

Description Usage Arguments Value Examples

View source: R/as-osmar.R

Description

Convert a given OSM-XML object (as parsed by xmlParse) to an osmar object.

Usage

1
as_osmar(xml)

Arguments

xml

An OSM-XML object

Value

A list (with class attribute osmar) with three elements:

nodes

A list with two data frames containing the attributes and tags of the nodes.

ways

A list with three data frames containing the attributes, tags, and references of the ways.

relations

A list with three data frames containing the attributes, tags, and references of the relations.

Examples

1
2
3
file <- system.file("extdata", "kaufstr.xml", package = "osmar")
  raw <- readLines(file)
  kaufstr <- as_osmar(xmlParse(raw))

Example output

Loading required package: XML
Loading required package: RCurl
Loading required package: bitops
Loading required package: geosphere

Attaching package: 'osmar'

The following object is masked from 'package:utils':

    find

osmar documentation built on May 2, 2019, 6:15 p.m.

Related to as_osmar in osmar...