Closed dncgst closed 11 months ago
Do you have a reproducible example? If you can provide code starting with reading in an open access dataset, or a dataset in stplanr, plus your expectation of what the result should find, that will help.
Here's my starting point, does this work as you expected?
library(stplanr)
?line_bearing
bearings_sf_1_9 <- line_bearing(flowlines_sf[2:5, ])
bearings_sf_1_9 # lines of 0 length have NaN bearing
line_bearing(flowlines_sf[2:5, ], bidirectional = TRUE)
See here for full documentation: https://docs.ropensci.org/stplanr/reference/line_bearing.html
sf::as_Spatial()
creates an sp class object. The error is emitted because line2points()
is an s3 generic. line_bearing()
is not designed to be used with sp objects. This can probably be closed as designed.
Agreed, and yes, support for sp
was phased out quite a while ago. Closing :tada:
Dear all, I get this error when using
stplanr::line_bearing
with a spatial line object:Error in UseMethod("line2points") : no applicable method for 'line2points' applied to an object of class "c('SpatialLinesDataFrame', 'SpatialLines', 'Spatial')"
I have a simple feature collection of LINESTRINGs (lines of 2 points each) and dimension XY, no CRS.
blank.ID geometry