Read survey transects with their geometry
sight_read_transects.RdReads the survey layout from /aerial-surveys/designs-as-points-and-lines:
the designs, the points, and the lines assembled from them.
Usage
sight_read_transects(
species = NULL,
survey_type = NULL,
analysis_unit = NULL,
management_unit = NULL,
bio_year = NULL,
dry_run = FALSE,
...
)
sight_read_transects_id(
species_id = NULL,
survey_type_id = NULL,
analysis_unit_id = NULL,
management_unit_id = NULL,
bio_year = NULL,
dry_run = FALSE,
...
)Arguments
- species, survey_type
Names, resolved to ids.
- analysis_unit, management_unit
Names, resolved to ids. Optional.
- bio_year
Biological year.
- dry_run
Return the prepared request instead of performing it.
- ...
Additional filters.
- species_id, survey_type_id, analysis_unit_id, management_unit_id
Ids, for the
_idform.
Value
A named list of three tibbles:
designs— the survey design rowspoints— every point, withnumber,latitude,longitudelines— one row per line, withleft_width,right_width,stratum_id,is_surveyed, and apointslist-column
Elements the response omits come back as empty tibbles rather than
NULL, so a caller can index them without checking first.
Details
"Transect" covers both halves of what this returns. Distance sampling
distinguishes line transects from point transects, and count-api
stores both: points for point and plot designs, lines for the
strips an aircraft flies.
A line is its points
location.lines holds only id, name, left_width, right_width
and batch. The geometry lives on location.points, two or more rows
sharing a line_id and ordered by number, each carrying a PostGIS
geography(Point) that the API decodes into latitude/longitude.
So a line's shape, and its length, are derived rather than stored.
spdgt.distance.admin::dist_transects_from_lines() turns the lines
element of this response into the transect frame its estimation
engine expects, computing length from the point coordinates.
Examples
if (FALSE) { # \dontrun{
layout <- sight_read_transects_id(
species_id = 1L,
survey_type_id = 3L,
analysis_unit_id = 274L,
bio_year = 2024L
)
nrow(layout$lines)
} # }