Displays the content of an OSM file either in .html
, .xml
or .opl
format.
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
"html"
,"opl"
or"xml"
. Please note that the"html"
option, although the most human readable format, results in large files that may be very slow to open and inspect, depending on the size of the input file.- object_type
A character vector. The object types that should be included in the output. Please note that using
"all"
is a simple way of passing all other available types ("node"
,"way"
,"relation"
and"changeset"
).- echo_cmd
A logical. Whether to print the Osmium command generated by the function call to the screen. Defaults to
FALSE
.- spinner
A logical. Whether to show a reassuring spinner while the Osmium call is being executed. Defaults to
TRUE
.- preview
A logical. Whether to open the temporary file in which the content of the OSM file 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")
#> [1] "/tmp/RtmpMNfsH0/osm_content2054a922640.html"
show_content(
small_pbf,
object_type = c("node", "way", "relation", "changeset")
)
#> [1] "/tmp/RtmpMNfsH0/osm_content205453fe5b2f.html"
# only show nodes and ways
show_content(small_pbf, object_type = c("node", "way"))
#> [1] "/tmp/RtmpMNfsH0/osm_content205446337b5e.html"
# display all objects in xml format
show_content(small_pbf, output_format = "xml")
#> [1] "/tmp/RtmpMNfsH0/osm_content20545a826a6c.xml"