R: Convert OSM-XML to an osmar object

as_osmar {osmar} | R Documentation

## Convert OSM-XML to an osmar object

### Description

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

### Usage

      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

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

[Package osmar version 1.1-7 Index]