An internal utility function to find the grid line intersections of a line segment

find_intersections(
  geolocation,
  x_grid,
  y_grid,
  latitude,
  longitude,
  first_point = FALSE
)

Arguments

geolocation

Two-row latitude/longitude table defining the line segment to trace.

x_grid

Grid of cell-corner longitudes.

y_grid

Grid of cell-corner latitudes.

latitude

Cell-centre latitude grid.

longitude

Cell-centre longitude grid.

first_point

Logical; if `TRUE`, include the starting point of the transect in the returned intersection set.