Return all keys stored in "other_tags" column
This function is used to return the names of all keys that are stored in "other_tags" column since they were not explicitly included in the file. See Details.
oe_get_keys(zone, layer = "lines") ## Default S3 method: oe_get_keys(zone, layer = "lines") ## S3 method for class 'character' oe_get_keys(zone, layer = "lines") ## S3 method for class 'sf' oe_get_keys(zone, layer = "lines")
zone |
An |
layer |
Which |
OSM data are typically documented using several
tags
. A tag
is a pair of
two items, namely a key
and a value
. As we documented in
oe_vectortranslate()
, the conversion between .osm.pbf
and .gpkg
formats is governed by a CONFIG file that indicates which tags are
explicitly added to the .gpkg
file. All the other keys stored in the
.osm.pbf
file are automatically appended using an "other_tags" field,
with a syntax compatible with the PostgreSQL HSTORE type. This function is
used to display the names of all keys stored in the "other_tags"
column.
You can also use the hstore_get_value()
function from GDAL to extract one
particular tag from an existing .gpkg
file. Check the introductory
vignette and see examples.
The definition of a generic S3 implementation started in osmextract/issues/138.
A character vector indicating the name of all keys stored in "other_tags" field.
oe_vectortranslate()
and
osmextract/issues/107.
itsleeds_gpkg_path = oe_get("ITS Leeds", download_only = TRUE) oe_get_keys(itsleeds_gpkg_path) itsleeds = oe_get("ITS Leeds") oe_get_keys(itsleeds) # Add an extra key to an existing .gpkg file without vectortranslate names(oe_read( itsleeds_gpkg_path, query = "SELECT *, hstore_get_value(other_tags, 'oneway') AS oneway FROM lines" ))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.