Closed Jet2191 closed 2 months ago
I thought maybe it would work to load the water in shapeToRaster() with type = 'water'. Then I do not get water around the edges (see image), but when I try to runRSP() on a transitionLayer of this shape I get the error; 'Error in validObject(.Object) : invalid class “SpatialLines” object: bbox should never contain infinite values In addition: Warning messages: 1: In shortest_paths(graph = graph, from = from, to = to, mode = mode, : At vendor/cigraph/src/paths/dijkstra.c:534 : Couldn't reach some vertices. 2: In min(x) : no non-missing arguments to min; returning Inf 3: In max(x) : no non-missing arguments to max; returning -Inf 4: In min(x) : no non-missing arguments to min; returning Inf 5: In max(x) : no non-missing arguments to max; returning -Inf Timing stopped at: 42.6 34.14 94.11'
Hi Jet,
Would it be an option to correct the original shapefile so it cuts cleanly into a square on geographic coordinates?
The tilting is indeed what led to the first issue. You could also prevent that by modifying the shapefile slightly and cutting the rivers off with a bit of land on the upstream side. That way the model will have no choice but to flow down.
The RSP error seems likely related to the shapefile issues too, though I am not quite sure what that error means. That part of the question is most likely better off posted at the RSP repository.
But my first bet would be to trim/edit the shapefile a bit so it fits nicely to begin with. Let me know if you need help with that.
Inactive, closing.
Hi, On your website you write 'Some water may show up around the edges of the original shapefile due to the range adjustments made by shapeToRaster.' This is happening for me (maybe also because my shape file is a little bit tilted? Anyway because of the water around the edges the tracks are plotted around the edges of the map instead of through the actual rivers. How can I fix this? Kind regards, Jet