Is your feature request related to a problem? Please describe.
I think that the current implementation of plot.sfnetwork is slightly inefficient when the input x contains spatially explicit edges (or draw_lines = TRUE). The problem is that, in those cases, dots$x mixes POINT and LINESTRING objects, which implies that do.call(plot, dots) actually calls sf:::plot.sfc_GEOMETRY. The function sf:::plot.sfc_GEOMETRY is less efficient than just calling sf:::plot.sfc_POINT and sf:::plot.sfc_LINESTRING separately since sf:::plot.sfc_GEOMETRYplots one node at a time whereas sf:::plot.sfc_POINTplots all points together.
Describe the solution you'd like
Two separate calls to do.call to plot one set of features at a time. If you agree, I will prepare a PR.
Describe alternatives you've considered
We can manually extract and plot nodes/lines, but that's quite boring.
Is your feature request related to a problem? Please describe. I think that the current implementation of
plot.sfnetwork
is slightly inefficient when the inputx
contains spatially explicit edges (ordraw_lines = TRUE
). The problem is that, in those cases,dots$x
mixesPOINT
andLINESTRING
objects, which implies thatdo.call(plot, dots)
actually callssf:::plot.sfc_GEOMETRY
. The functionsf:::plot.sfc_GEOMETRY
is less efficient than just callingsf:::plot.sfc_POINT
andsf:::plot.sfc_LINESTRING
separately sincesf:::plot.sfc_GEOMETRY
plots one node at a time whereassf:::plot.sfc_POINT
plots all points together.Describe the solution you'd like Two separate calls to
do.call
to plot one set of features at a time. If you agree, I will prepare a PR.Describe alternatives you've considered We can manually extract and plot nodes/lines, but that's quite boring.