I would like to use osmdata and get the other_tags as explicit columns.
Example code:
library(osmextract)
library(osmdata)
itsleeds = oe_get("ITS Leeds")
oe_get_keys(itsleeds)
I am interested in extracting the other_tags col from itsleeds data.
Thank you.
We can use tidyverse methods to split and reshape the 'other_tags' column into two columns -
select
the column of interest, withseparate_rows
expand the data by splitting at the,
, useseparate
to create two columns 'key', 'value' from the 'other_tags', by splitting at the=>
and finally remove the double quotes withstr_remove_all
in those columns-output