Define transect design
TransectDesign(
StratumPolygon,
TransectParameterDefinition = c("FunctionParameter", "FunctionInput"),
TransectParameterDefinitionMethod = c("Parameter", "ParameterTable"),
StratumNames = character(),
TransectType = c("Parallel", "ZigZagRectangularEnclosure", "ZigZagEqualSpacing"),
Bearing = c("Along", "Across", "AlongReversed", "AcrossReversed"),
BearingAngle = numeric(),
Retour = FALSE,
SurveyTime = numeric(),
SurveyDistance = numeric(),
SurveySpeed = numeric(),
Seed = numeric(),
ParameterTable = data.table::data.table(),
TransectParameter,
EqualEffort = TRUE,
OrderAllToursFirst = FALSE,
Margin = 0.1
)
The StratumPolygon
process data.
Character: A string naming the method to use for defining the TransectParameter, one of FunctionParameter
to define the TransectParameter on the fly in this function, or FunctionInput
to import TransectParameter process data generated using the function DefineTransectParameter
.
Character: A string naming the TransectParameter definition method to use, one of the two options "Parameter", for specifying common parameter for all strata given by StratumNames
, or "ParameterTable", for specifying individual parameters for each stratum in the table ParameterTable
. See DefineTransectParameter
for details.
Character: The names of the strata to include in the transect design. Defaults to all strata.
Character: The name of the type of survey design to create, one of "Parallel", "ZigZagEqualSpacing" and "ZigZagRectangularEnclosure" (see details).
Character: A string indicating the survey bearing (direction) of each . See Details for options.
Numeric: In the case that Bearing = "Angle"
, BearingAngle
gives the angle of the survey bearing (direction) counter clockwise from north in degrees.
Logical: If TRUE the transect design will be doubled by a retour.
Numeric: The time to spend in the stratum including transport between segments, given in hours. Specifying the SurveyTime
requires the SurveySpeed
to be given as well. Note that the resulting accumulated time may not be exactly equal to SurveyTime
.
Numeric: The distance to travel in the stratum including transport between segments, given in nautical miles. The SurveyDistance
has precedence over SurveyTime
. Note that the resulting accumulated distance may not be exactly equal to SurveyDistance
.
Numeric: The speed of the vessel, needed if effort is specified by SurveyTime
.
Numeric: The seed to use when drawing the random starting point.
A table specifying the parameters for each stratum to create transect design for. See the Details for a list of required columns.
The TransectParameter
process data.
Character: A string naming the method to use. See Details for options.
Logical: If TRUE order all tours first and all retours last, which can be useful for multiple Strata in the same survey direction (e.g. a row of strata along a coast line).
Numeric: The margin to use when iterating to fit the transect design to the desired survey distance (including transport between segments). The function iterates until the survey distance is within Margin
of the desired survey distance, and jumps out of the iteration after 100 tries or if not converging.
An object of StoX data type TransectDesignData
.
The TransectDesign
function generates a transect design in a Cartesian coordinate system, and transforms the positions to the geographical coordinate system (longitude, latitude) using the azimuthal equal distance projection, which ensures that distances are preserved in the transformation.
If the ParameterTable
is given the table must contain the following columns:
The name of the stratum, which will be matched against the names of the strata in the StratumPolygon
See the argument TransectType
See the argument Bearing
If given, this overrides Bearing
. See the argument BearingAngle
See the argument Retour
See the argument SurveyTime
Overrides the SurveyTime
. See the argument SurveyDistance
See the argument SurveySpeed
See the argument Seed
The following types are implemented through TransectType
:
Parallel transects
Equal space zigzag sampler, Strindberg and Buckland (2004). End transects are generated different from Strindberg and Buckland (2004), by mirroring the last transect around the line perpendicular to the survey direction passing through the last intersection point between the stratum border and the parallel lines used to generate the transects.
Rectangular enclosure zigzag sampler, Harbitz (2019)
Strindberg, S., & Buckland, S. T. (2004). Zigzag survey designs in line transect sampling. Journal of Agricultural, Biological, and Environmental Statistics, 9, 443-461.
Harbitz, A. (2019). A zigzag survey design for continuous transect sampling with guaranteed equal coverage probability. Fisheries Research, 213, 151-159.
library(ggplot2)
stratumFile <- system.file(
"testresources",
"strata_sandeel_2020_firstCoverage.wkt", package = "RstoxBase"
)
stratumPolygon <- DefineStratumPolygon(
DefinitionMethod = "ResourceFile",
FileName = stratumFile
)
# Harbitz zigzag survey design along each stratum:
transectDesignZZ_Along <- TransectDesign(
TransectParameterDefinition = "FunctionParameter",
TransectParameterDefinitionMethod = "Parameter",
TransectType = "ZigZagRectangularEnclosure",
StratumPolygon = stratumPolygon,
SurveyTime = 200,
SurveySpeed = 10,
Seed = 1,
Bearing = "Along"
)
#> StoX: TransectDesign for Stratum AlbjoernLing...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Engelsk_Klondyke_2020...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Inner_Shoal_East_2016...
#> StoX: TransectDesign for Stratum Inner_Shoal_North_2020...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Inner_Shoal_West_2018...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Nordgyden...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Ostbanken_2020...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Outer_Shoal_2020_1...
#> StoX: TransectDesign for Stratum VestbankenSouthEast...
#> StoX: TransectDesign for Stratum VestbankenSouthWest...
#> StoX: TransectDesign for Stratum Vestbanken_North_2020...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Vikingbanken...
#> StoX: numIter: 1
#> StoX: numIter: 2
# Plot the stratumPolygon with the segments
ggplot() +
geom_sf(data = stratumPolygon, aes(fill = StratumName), color = 'blue') +
geom_segment(
data = transectDesignZZ_Along,
aes(x = LongitudeStart, y = LatitudeStart, xend = LongitudeEnd, yend = LatitudeEnd)
)
# Harbitz zigzag survey design across each stratum:
transectDesignZZ_Across <- TransectDesign(
TransectParameterDefinition = "FunctionParameter",
TransectParameterDefinitionMethod = "Parameter",
TransectType = "ZigZagRectangularEnclosure",
StratumPolygon = stratumPolygon,
SurveyTime = 200,
SurveySpeed = 10,
Seed = 1,
Bearing = "Across"
)
#> StoX: TransectDesign for Stratum AlbjoernLing...
#> StoX: TransectDesign for Stratum Engelsk_Klondyke_2020...
#> StoX: TransectDesign for Stratum Inner_Shoal_East_2016...
#> StoX: TransectDesign for Stratum Inner_Shoal_North_2020...
#> StoX: TransectDesign for Stratum Inner_Shoal_West_2018...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Nordgyden...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: numIter: 3
#> StoX: TransectDesign for Stratum Ostbanken_2020...
#> StoX: TransectDesign for Stratum Outer_Shoal_2020_1...
#> StoX: TransectDesign for Stratum VestbankenSouthEast...
#> StoX: TransectDesign for Stratum VestbankenSouthWest...
#> StoX: TransectDesign for Stratum Vestbanken_North_2020...
#> StoX: TransectDesign for Stratum Vikingbanken...
# Plot the stratumPolygon with the segments
ggplot() +
geom_sf(data = stratumPolygon, aes(fill = StratumName), color = 'blue') +
geom_segment(
data = transectDesignZZ_Across,
aes(x = LongitudeStart, y = LatitudeStart, xend = LongitudeEnd, yend = LatitudeEnd)
)
# Parallel survey design across each stratum:
transectDesignParallel_Across <- TransectDesign(
TransectParameterDefinition = "FunctionParameter",
TransectParameterDefinitionMethod = "Parameter",
TransectType = "Parallel",
StratumPolygon = stratumPolygon,
SurveyTime = 200,
SurveySpeed = 10,
Seed = 1,
Bearing = "Along"
)
#> StoX: TransectDesign for Stratum AlbjoernLing...
#> StoX: TransectDesign for Stratum Engelsk_Klondyke_2020...
#> StoX: TransectDesign for Stratum Inner_Shoal_East_2016...
#> StoX: TransectDesign for Stratum Inner_Shoal_North_2020...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Inner_Shoal_West_2018...
#> StoX: TransectDesign for Stratum Nordgyden...
#> StoX: numIter: 1
#> StoX: numIter: 2
#> StoX: TransectDesign for Stratum Ostbanken_2020...
#> StoX: TransectDesign for Stratum Outer_Shoal_2020_1...
#> StoX: TransectDesign for Stratum VestbankenSouthEast...
#> StoX: TransectDesign for Stratum VestbankenSouthWest...
#> StoX: TransectDesign for Stratum Vestbanken_North_2020...
#> StoX: TransectDesign for Stratum Vikingbanken...
# Plot the stratumPolygon with the segments
ggplot() +
geom_sf(data = stratumPolygon, aes(fill = StratumName), color = 'blue') +
geom_segment(
data = transectDesignParallel_Across,
aes(x = LongitudeStart, y = LatitudeStart, xend = LongitudeEnd, yend = LatitudeEnd)
)