luukvdmeer / sfnetworks

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

A few GEOS functions that could enhance sfnetworks #214

Open agila5 opened 2 years ago

agila5 commented 2 years ago

Is your feature request related to a problem? Please describe. Hi! I was skimming through the GEOS docs and I noticed a few functions that may be useful for this package. I will list them here. I'm not sure (if or) how these functions can be added (maybe extend the sf package or check the approach documented here).

btw: I have little to no experience in these cases, so feel free to ignore here if the following suggestions do not make sense.

Describe the solution you'd like

  1. GEOSNode(): For linear inputs, returns a new geometry in which no lines cross each other, and all touching occurs at end points. Also related to https://github.com/luukvdmeer/sfnetworks/issues/134
  2. GEOSLineMerge(): Sews together a set of fully noded LineStrings removing any cardinality 2 nodes in the linework. I think it might be related to the "to_spatial_smooth" morpher.
  3. GEOSGeom_extractUniquePoints(): Return all distinct vertices of input geometry as a MultiPoint. Note that only 2 dimensions of the vertices are considered when testing for equality. Might be related to the building of sfnetwork objects and some morphers;

Other tools that may be useful:

  1. GEOSDensify(): add new nodes at a fixed distance;

Describe alternatives you've considered Ignore everything here? 😅