land_points {Tivy} | R Documentation |
Points on land
Description
Classifies a set of geographic coordinates (longitude and latitude) as "land" or "sea" according to their relative position to a coastline. A point is considered to be on land if its longitude is greater than that of its nearest point on the coastline.
Usage
land_points(
x_point,
y_point,
coastline = NULL,
parallel = FALSE,
cores = 4,
distance_type = "haversine",
window = 0.5,
unit = "nm"
)
Arguments
x_point |
Numeric vector of longitudes (in decimal degrees). |
y_point |
Numeric vector of latitudes (in decimal degrees). |
coastline |
Data frame with coastline coordinates. Must have columns named |
parallel |
Logical. If |
cores |
Number of cores to use for parallel processing. |
distance_type |
Type of geodesic distance to use in the calculation. |
window |
Geographic window in degrees to reduce the number of coastline points to consider. |
unit |
Unit of measurement for distance: "km" or "nm". |
Value
Text vector of the same length as x_point
, indicating whether each point
is on "land" or "sea". NA values are maintained as NA.
Examples
## Not run:
data_hauls <- process_hauls(data_hauls = calas_bitacora)
result <- land_points(
x_point = data_hauls$lon_final,
y_point = data_hauls$lat_final
)
table(result)
## End(Not run)