inbo / fish-tracking

🐟 Collection of scripts for processing and analysing fish tracking data
3 stars 0 forks source link

Calculating distances between receivers - package 'marmap' #47

Closed PieterjanVerhelst closed 7 years ago

PieterjanVerhelst commented 8 years ago

Lenore Bajona and Jonathan Pye from OTN let us know that there exists an R package, which is able to calculate the distance between receivers, even in rivers. The package itself is called 'marmap' (https://cran.r-project.org/web/packages/marmap/marmap.pdf). It will calculate the least cost path length between a series of points. By using bathymetric data as a cost algorithm, you can force the paths to avoid land masses, and even maintain minimum depths if you know what appropriate depth ranges might be. On the OTN gitlab, there is an an example R script that is part of a package, which was used in a tutorial last year to show how to use marmap and NOAA bathymetry to exclude land masses, or choose an envelope of depth as our allowable path range. https://gitlab.oceantrack.org/otn-statistical-modelling-group/r_oceandata_examples/blob/master/marmap_example.R I will check this as soon as possible, also how detailed the bathymetric data has to be and what is available.

IPauwels commented 8 years ago

I quickly checked it, because I am looking for a way to calculate the distance between sampling locations in rivers (same principle as distance between receivers along the river thalweg). I did not find a good way to do this for the Flemish rivers with this package. It seems to me that the bathymetric map is not detailed enough to represent the Flemish rivers. Beside, I did not find how depth data between receiver locations could be selected automatically. Now you have to manually indicate the positions of the receivers on the bathymetric map. Perhaps I overlooked it, so let me know if you do find this in the package PJ. Does someone of you knows another package in R that allows calculating distances between points along a path? Would be really helpful!!

stijnvanhoey commented 7 years ago

For the record, this issue - concerning shortest path - has been tackled by an earlier commit. The function used in the marmap-package to derive the distances (gdistance::costDistance) is the same as the function get.distance.matrix in the distance analysis function.

Closing this commit.