# informations relatives aux jeunes stades/adultes en mer dans la section D du rapport ASMFC sur l'alose américaine (voir PJ - page 33 du rapport ou 52 du PDF).
# Cette partie est divisée en plusieurs rubriques, qui regroupe les informations sur les préférédums environnementaux (i.e. une section dédiées aux températures, l'autre à la salinité, ect.).
# La partie concernant les profondeurs figure p35.
# Tu as un tableau récapitulatif qui reprend l'ensemble des facteurs influençant la distribution en mer, avec les ranges spécifiques à la p38 du rapport (ou 57 du PDF).
# Greene, Karen E., Jennifer L. Zimmerman, R. Wilson Laney, et Jessie C. Thomas-Blate. « Atlantic coast
# diadromous fish habitat: a review of utilization, threats, recommendations for conservation, and research
# needs ». Atlantic States Marine Fisheries Commission Habitat Management Series 464 (2009): 276.
# northeastamerica.inshore_offshore_connections ioc
# inner join northeastamerica.v_river_basin_to_gr3d vrbtgd on
# ioc.inshore_basin_id = vrbtgd.basin_id;"
# )
#
#
#
# save(sea_outlets,
# conversionTable,
# distanceSeaOutlet_wintering,
# combinationsSeaOutlet_wintering,
# inshore_offshore_connections,
# file = "outlet.RData")
load("outlet.RData")
```
The distances are calculated as the shortest path avoiding land.
# Distance between inshore and wintering offshore basins
The distances are calculated as the shortest path avoiding land. In that case the distance computed by the lc.dict take into account the weights used to define the preferenda. To have the actual distance is obtainad with path.
```{r}
computeDistancebetweenTwoPoint = function(data, trans, res = 'dist') {
# inner_join(distanceToWinteringOffshore, by =c('seaoutlet_id', 'basin_name' ))
```
Distances between sea outlets (which are connected to river basin) and the 3 wintering offshore basins are then calculated.
Distances between sea outlets (which are connected to river basin) and the 3 wintering offshore basins are then calculated considering a depth preferendum between `r -bath_inf` and `r -bath_sup` m.
```{r distanceToWintering, include=TRUE, fig.cap='Distance(in km) to the wintering offshore basins.'}
filter(rank == 1), by = c("seaoutlet_id", "basin_name"))
group_by(seaoutlet2_id) %>%
arrange(distance) %>%
mutate(rank = order(distance)) %>%
filter(rank == 1), by = c("seaoutlet_id", "basin_name"))
```
By selecting the shortest distance, it is possible to verify the consistency of GR3D connections with this criterion. Presently there are some discrepancies near Cape Fear !
By selecting the shortest distance, GR3D connections is consistent with this criterion.
```{r winterinbBasinconsistency, include=TRUE, tab.cap="Consistency between GR3D wintering basin and selection of wintering basin based on minimal distance."}