Checking input data formats and values for the target reef area
are valid. This includes checking that all input data share the same CRS,
checking that all input raster extents intersect with the reef_polygon area,
and checking that all input raster data have some valid values intersecting
the reef polygon. This function is automatically called in extract_pixel_points,
but can also be run before extraction to ensure inputs will be compatible (
e.g. as a filter for invalid reefs).
Arguments
- reef_polygon
sf_object. sf object containing the target reef polygons for data coverage.
- habitat_raster
SpatRaster. Terra raster object containing categorical values for habitats covering the target reef area.
- add_var_raster
SpatRaster. Terra raster object containing an additional variable to extract for all selected habitat pixels covering the target reef area. Can be continuous or categorical, however the raster will be resampled and the method should be changed for categorical data.
- habitat_categories
vector. Vector containing target habitat categories. This is used to check that
habitat_rastercontains pixels withinreef_polygonthat have valid target category values.