ropensci / osmdata

R package for downloading OpenStreetMap data
https://docs.ropensci.org/osmdata
317 stars 45 forks source link

[BUG] area=no tag is ignored #343

Closed joostschouppe closed 4 months ago

joostschouppe commented 4 months ago

If a closed way object has a tag that implies it could be an area or not, then it should not be downloaded as a polygon if it has an area=no tag. E.g. https://www.openstreetmap.org/way/41270942 is downloaded as a polygon. there's only 25k objects with this tag, so maybe this is low priority.

mpadge commented 4 months ago

This one is unlikely to find resolution, for complex reasons explained in this vignette. Any closed way is, according to the definition of Simple Features, a polygon. So that way you linked to above must be represented in Simple Features as a polygon. Conversion to a way is relatively straightforward.

Most importantly, conversion to Simple Features always runs the risk of losing or distorting or misinterpreting information, and it is also not a generally reversible process (so OSM -> sf can not be reversed to original data sf -> OSM). This is why this package has osmdata_sc(), which preserves every single bit of OSM information in a format that is entirely compatible with OSM structures, and via entirely reversible translations. OSM -> sc -> OSM is no problem. Given that, I'll close this for now, but feel free to ask more questions.