API OSM data source

Description

OSM API version 0.6 data source; see http://wiki.openstreetmap.org/wiki/API_v0.6.

Usage

1
2
osmsource_api(url = "http://api.openstreetmap.org/api/0.6/",
  encoding = "UTF-8")

Arguments

url

URL of the API

encoding

encoding specified as in .encoding parameter in getURL. Default is "UTF-8".

Details

#'

Supported request elements

Bounding box:

Use corner_bbox or center_bbox to retrieve:

  • all nodes that are inside a given bounding box and any relations that reference them;

  • all ways that reference at least one node that is inside a given bounding box, any relations that reference them [the ways], and any nodes outside the bounding box that the ways may reference;

  • all relations that reference one of the nodes or ways included due to the above rules (does not apply recursively);

Basic request elements:

Use node, way, relation to retrieve an element by its ID.

Use full = TRUE as additional argument to the get_osm function. This means that all members of the specified elements are retrieved as well:

  • For a way, it will return the way specified plus all nodes referenced by the way.

  • For a relation, it will return: (1) the relation itself; (2) all nodes, ways, and relations that are members of the relation; and (3) all nodes used by ways from the previous step.

References

http://wiki.openstreetmap.org/wiki/API_v0.6

See Also

get_osm, bbox, osm_descriptors

Other osmsource: complete_file, osmsource_file; osmsource_osmosis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
    api <- osmsource_api()

    box <- corner_bbox(11.579341, 48.15102, 11.582852, 48.1530)
    gschw <- get_osm(box, source = api)

    kaufstr <- get_osm(way(3810479))
    kaufstr_full <- get_osm(way(3810479), full = TRUE)
  
## End(Not run)