osmsource_osmosis: Osmosis OSM data source

Description Usage Arguments Details Supported request elements References See Also Examples

View source: R/source-osmosis.R

Description

Planet dumps as OSM data source through the osmosis command line Java application.

Usage

1
  osmsource_osmosis(file, osmosis = "osmosis")

Arguments

file

The file name (and path) of the planet dump

osmosis

The path to the osmosis application

Details

Osmosis is a command line Java application for processing OSM data. It allows, among other things, to extract data inside a bounding box or polygon from so called planet dumps. The usage of this source requires an installed osmosis; see http://wiki.openstreetmap.org/wiki/Osmosis.

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);

References

http://wiki.openstreetmap.org/wiki/Osmosis

See Also

get_osm, bbox, osm_descriptors

Other osmsource: osmsource_api, osmsource_file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
    ## Download and extract a planet file:
    download.file("http://osmar.r-forge.r-project.org/",
                  "muenchen.osm.gz")
    system("gzip -d muenchen.osm.gz")

    ## Define osmosis source; note that we assume that
    ## osmosis is in our path environment variable (if
    ## not, set osmosis argument to the executable):
    src <- osmsource_osmosis(file = "muenchen.osm")

    ## Get the center of Munich:
    muc_bbox <- center_bbox(11.575278, 48.137222,
                            3000, 3000)
    muc <- get_osm(muc_bbox, src)
    muc
  
## End(Not run)

osmar documentation built on May 1, 2019, 7:33 p.m.