Skip to content

Polygons as lines #228

Answered by agila5
luukvdmeer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Luuk! I'm not 100% sure (since OSM data may be pretty weird and inconsistent), but I think that the data obtained with osmextract do not require the same preprocessing steps like the ones obtained using osmdata. Hence, osm_poly2line is (usually) not required (since, by default, most "closed ways" are saved as lines instead of polygons). I try to summarise an example with the following (quite long) reprex, hope it's clear:

Load packages

library(sf)
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1
library(osmdata)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright
library(osmextract)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.open…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by luukvdmeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants