show_content {rosmium} | R Documentation |
Show the content of an OSM file
Description
Displays the content of an OSM file either in .html
, .xml
or .opl
format.
Usage
show_content(
input_path,
output_format = c("html", "opl", "xml"),
object_type = c("all", "node", "way", "relation", "changeset"),
echo_cmd = FALSE,
spinner = TRUE,
preview = TRUE
)
Arguments
input_path |
A string. The path to the OSM file whose content should be shown. Please see file_formats for a list of supported file formats. |
output_format |
A string. The format in which the content should be
shown. Either |
object_type |
A character vector. The object types that should be
included in the output. Please note that using |
echo_cmd |
A logical. Whether to print the Osmium command generated by
the function call to the screen. Defaults to |
spinner |
A logical. Whether to show a reassuring spinner while the
Osmium call is being executed. Defaults to |
preview |
A logical. Whether to open the temporary file in which the content of the OSM file was saved. |
Value
The path to the temporary file in which the OSM file content was saved.
Examples
pbf_path <- system.file("extdata/cur.osm.pbf", package = "rosmium")
small_pbf <- tags_filter(
pbf_path,
"note",
tempfile(fileext = "osm.pbf"),
omit_referenced = TRUE
)
# both function calls below result in outputs with the same object types
show_content(small_pbf, object_type = "all")
show_content(
small_pbf,
object_type = c("node", "way", "relation", "changeset")
)
# only show nodes and ways
show_content(small_pbf, object_type = c("node", "way"))
# display all objects in xml format
show_content(small_pbf, output_format = "xml")