luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
347 stars 20 forks source link

Option to create linestrings for edges during construction #47

Closed luukvdmeer closed 4 years ago

luukvdmeer commented 4 years ago

Is your feature request related to a problem? Please describe. Right now, if you provide an sf objects as nodes, but a regular data frame with a to and from column as edges, the sfnetwork construction function simply creates the network with those two objects, and does not create linestrings for the edges. This is probably good for some use-cases, but in other use-cases, it might be nicer if the construction function would already create the spatially explicit edges, instead of the user having to do this himself in either pre or post processing.

Describe the solution you'd like An option edges_as_lines in the sfnetwork() construction function. If TRUE, the returned network will always be spatially explicit, no matter if you provided the edges as sf object or not. If FALSE, the edges will always be spatially implicit.

luukvdmeer commented 4 years ago

This is implemented in the new version