hugomflavio / actel

Standardised analysis of acoustic telemetry data from fish moving through receiver arrays
https://hugomflavio.github.io/actel-website
26 stars 5 forks source link

Issue with plotRaster (and plotTracks) #100

Closed Jet2191 closed 1 month ago

Jet2191 commented 2 months ago

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. image Track V29 July How can I fix this? Kind regards, Jet

Jet2191 commented 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' image

hugomflavio commented 2 months ago

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.

hugomflavio commented 1 month ago

Inactive, closing.