Closed jmaspons closed 1 year ago
Yes indeed! I had this in mind recently. I was working directly from a local .pbf
, converting filtered bits to .osm
, and then reading with osmdata_xml
. That yielded data.frames with intact :
in names, but i ran into issues combining with other data generated in other ways which had converted :
-> .
. I wrote a hacky work-around, but a proper solution would be better. And by "proper" i mean here ensuring that all OSM keys with :
are ultimately retained and not converted to .
. That'd be really cool, thanks!
As per make.names, valid syntactic names only include letters, numbers and the dot or underline characters and starts with a letter. For exemple, many keys in OSM contain also
:
which get transformed to.
, thenname:ca
becomesname.ca
Non-valid names are not a big problem in R. Columns can be accessed anyway by
df$`key:xx`
ordf[, "key:xx"]
. Name changes can be aboided withdata.frame(..., check.names=FALSE)
. I will try to make a PR if you agree with the behavior change.