API
ReefGuideAPI._cache_location Method
_cache_location(config::Dict)::String
Retrieve cache location for geotiffs.
ReefGuideAPI._lon_lat_to_tile Method
_lon_lat_to_tile(zoom, lon, lat)
Identify the corresponding tile coordinates for a given lon/lat.
Returns
x and y tile coordinates
ReefGuideAPI._tile_bounds Method
_tile_bounds(z::T, x::T, y::T) where {T<:Int64}
Obtain lon/lat bounds of a requested tile.
Returns
West, East, North South (min lon, max lon, lat max, lat min)
ReefGuideAPI._tile_to_lon_lat Method
_tile_to_lon_lat(z::T, x::T, y::T) where {T<:Int64}
Obtain lon/lat of top-left corner of a requested tile.
Returns
lon, lat
ReefGuideAPI._write_cog Method
_write_cog(file_path::String, data::Raster, config::Dict)::Nothing
Write out a COG using common options.
Arguments
file_path
: Path to write data out todata
: Raster data to write out
ReefGuideAPI.adjusted_nearest Method
adjusted_nearest(rst::Raster, z::Int, x::Int, y::Int, tile_size::Tuple{Int,Int}, orig_rst_size::Tuple{Int,Int})::Matrix
Resample a raster using nearest neighbor interpolation when the tile includes area outside where data exists (e.g., viewing the globe where the data may appear in a small corner of the tile). This approach attempts to account for planetary curvature while still maintaining some performance.
Arguments
rst
: The input raster to be resampled.z
: Tile zoom level requested.x
: x coordinate for requested tile.y
: y coordinate for the requested tile.tile_size
: The desired dimensions of the tile (long, lat).
Returns
Matrix with the resampled data.
ReefGuideAPI.apply_criteria_lookup Method
apply_criteria_lookup(
reg_criteria::RegionalCriteria,
rtype::Symbol,
ruleset::Vector{CriteriaBounds{Function}}
)
Filter lookup table by applying user defined ruleset
criteria.
Arguments
reg_criteria
: RegionalCriteria containing valid_rtype lookup table for filtering.rtype
: Flats or slope category for assessment.ruleset
: User defined ruleset for upper and lower bounds.
Returns
Filtered lookup table containing points that meet all criteria in ruleset
.
ReefGuideAPI.apply_criteria_thresholds Method
apply_criteria_thresholds(criteria_stack::RasterStack, lookup::DataFrame, ruleset::Vector{CriteriaBounds{Function}})::Raster
apply_criteria_thresholds(criteria_stack::RasterStack, lookup::DataFrame, ruleset::Dict)::Raster
apply_criteria_thresholds(criteria_stack::RasterStack, lookup::DataFrame, ruleset::NamedTuple)::Raster
Apply thresholds for each criteria.
Arguments
criteria_stack
: RasterStack of criteria data for a given regionlookup
: Lookup dataframe for the regionruleset
: A set of CriteriaBounds, Dictionary or NamedTuple indicating a mapping of criteria names to their lower and upper thresholds.
Returns
BitMatrix indicating locations within desired thresholds
ReefGuideAPI.assess_reef_site Method
assess_reef_site(
rel_pix::DataFrame,
geom::GI.Wrappers.Polygon,
max_count::Float64,
target_crs::GeoFormatTypes.EPSG;
degree_step::Float64=15.0,
start_rot::Float64=0.0,
n_per_side::Int64=2,
suit_threshold::Float64=0.7
)::Tuple{Float64,Int64,GI.Wrappers.Polygon,Int64}
Assesses the rotations of a search box geom
for their suitability score (calculated as the proportion of pixels that meet all specified criteria thresholds). Search box rotation steps are returned so that the start_rot
angle is 0, rotations anti-clockwise are negative and rotations clockwise are positive.
Extended help
The scores produced are a proportion of the polygon that are covered by valid pixel points, relative to the maximum number of points (max_count
) (0-1). max_count
is approximate (determined by user x_dist
and y_dist
box dimensions) and doesn't account for buffering and rotation of the search box. In rare cases scores could be > 1, however returned values are capped at max 1.
Arguments
rel_pix
: The point data for relevant pixels that are within the search area around a pixel.geom
: Starting search box for assessment.max_count
: The maximum number of pixels that can intersect the search box (used to standardise scores between 0 and 1).target_crs
: Coordinate Reference System used for analysis vector and raster data.degree_step
: Step to vary the search box rotations.start_rot
: Starting angle rotation that aligns the box with the closest reef edge.n_per_side
: Number of rotations to perform around the starting search box angle.suit_threshold
: Suitability threshold, below which sites are excluded from result sets.
Returns
Highest score
Highest scoring rotation step
Highest scoring polygon
Quality control flag for site, indicating if
suit_threshold
was met in the highest scoring rotation.
ReefGuideAPI.assess_reef_site Method
assess_reef_site(
rst::Union{Raster,RasterStack},
geom::GI.Wrappers.Polygon,
ruleset::Dict{Symbol,Function};
degree_step::Float64=15.0,
start_rot::Float64=0.0,
n_per_side::Int64=1
)::Tuple{Float64,Int64,GI.Wrappers.Polygon}
Assess given reef site for it's suitability score at different specified rotations around the initial reef-edge rotation.
Arguments
rst
: Raster of suitability scores.geom
: Initial site polygon with no rotation applied.ruleset
: Criteria ruleset to apply torst
pixels when assessing which pixels are suitable.degree_step
: Degree value to vary each rotation by. Default = 15 degrees.start_rot
: Initial rotation used to align the site polygon with the nearest reef edge. Default = 0 degrees.n_per_side
: Number of times to rotate polygon on each side (clockwise and anticlockwise). Default = 2 rotations on each side.
Returns
Highest score identified with rotating polygons.
The index of the highest scoring rotation.
The polygon with the highest score out of the assessed rotated polygons.
ReefGuideAPI.assess_region Method
assess_region(reg_assess_data, reg, qp, rtype)
Perform raster suitability assessment based on user-defined criteria.
Arguments
reg_assess_data
: Dictionary containing the regional data paths, reef outlines and full region names.reg
: Name of the region being assessed (formatCairns-Cooktown
rather thanCairns/Cooktown Management Area
).qp
: Dict containing bounds for each variable being filtered.rtype
: Type of zone to assess (flats or slopes).
Returns
GeoTiff file of surrounding hectare suitability (1-100%) based on the criteria bounds input by a user.
ReefGuideAPI.assess_region Method
assess_region(config, qp::Dict, reg::String, rtype::String, reg_assess_data::OrderedDict)
Convenience method wrapping around the analysis conducted by assess_region()
. Checks for previous assessment of indicated region and returns filename of cache if found.
ReefGuideAPI.assess_sites Method
assess_sites(
reg_assess_data::OrderedDict,
reg::String,
rtype::String,
pixel_criteria::Dict,
site_criteria::Dict,
assess_locs::Raster
)
Arguments
reg_assess_data
: Regional assessment datareg
: Short region namertype
: Slopes or Flats assessment typepixel_criteria
: parameters to assess specific locations withsite_criteria
: parameters to assess sites based on their polygonal representationassess_locs
: Raster of suitability scores for each valid pixel
Returns
GeoDataFrame of all potential sites
ReefGuideAPI.buffer_simplify Method
buffer_simplify(
gdf::DataFrame;
number_verts::Int64=30,
buffer_dist_m::Int64=40
)::Vector{GeoInterface.Wrappers.WrapperGeometry}
Simplify and buffer the polygons in a GeoDataFrame to account for uncertainty and inaccuracies in the reef outlines.
Arguments
gdf
: GeoDataFrame containing the reef polygons ingdf.geometry
.number_verts
: Number of vertices to simplify the reefs to. Default is 30 vertices.buffer_dist_m
: Buffering distance in meters to account for innacuracies in reef outlines. Default distance is 20m.
Returns
Vector containing buffered and simplified reef polygons
ReefGuideAPI.cache_filename Method
cache_filename(qp::Dict, config::Dict, suffix::String, ext::String)
Generate a filename for a cache.
Arguments
qp
: Query parameters to hashconfig
: app configuration (to extract cache parent directory from)suffix
: a suffix to use in the filename (pass""
if none required)ext
: file extension to use
ReefGuideAPI.closest_reef_edge Method
closest_reef_edge(
pixel::GeometryBasics.Point{2, Float64},
reef_lines::Vector{T}
)::Vector{Tuple{Float64, Float64}} where {T}
Find the nearest line in reef_lines
to a point pixel
.
Arguments
pixel
: Target point geometry.reef_lines
: Vector containing lines for comparison.
Returns
Coordinates of the reef edge line that is closest to the target pixel
. Returned in Tuples.
ReefGuideAPI.create_bbox Method
create_bbox(xs::Tuple, ys::Tuple)::Vector{Tuple{Float64, Float64}}
Create bounding box from x and y coordinates
Returns
Bounding box coordinates in order of top left, top right, bottom right, bottom left, top left.
ReefGuideAPI.criteria_middleware Method
criteria_middleware(handle)
Creates middleware that parses a criteria query before reaching an endpoint
Example
https://somewhere:8000/suitability/assess/region-name/reeftype?criteria_names=Depth,Slope&lb=-9.0,0.0&ub=-2.0,40
ReefGuideAPI.degrees_to_meters Method
degrees_to_meters(x, lat)
Convert degrees to meters at target latitude.
ReefGuideAPI.filter_distances Method
filter_distances(
target_rast::Raster,
dist_buffer
)::Raster
Apply a mask to exclude pixels that are outside the indicated distance buffer(s).
target_rast
and the dist_buffer
should be in the same CRS (e.g., EPSG:7844 / GDA2020).
Arguments
target_rast
: Raster of suitable pixels (Bool) to filter pixels from.dist_buffer
: Buffer geometry to use as the mask.
Returns
- Masked boolean raster indicating pixels that are within the target distance.
ReefGuideAPI.filter_distances Method
filter_distances(
target_rast::Raster,
gdf::DataFrame,
dist_nm
)::Raster
Exclude pixels in target_rast
that are beyond dist_nm
(nautical miles) from a geometry in gdf
. target_rast
and gdf
should be in the same CRS (EPSG:7844 / GDA2020 for GBR-reef-guidance-assessment).
Arguments
target_rast
: Boolean raster of suitable pixels to filter.gdf
: DataFrame withgeometry
column that contains vector objects of interest.dist_nm
: Filtering distance from geometry object in nautical miles.
Returns
tmp_areas
: Raster of filtered pixels containing only pixels within target distance
from a geometry centroid.
ReefGuideAPI.filter_far_reefs Method
filter_far_reefs(gdf::DataFrame, pixel::GIWrap.Point, lat::Float64, dist::Union{Int64,Float64})::BitVector
Filter out reefs that are > dist
(meters) from the target pixel (currently dist
is hardcoded in initial_search_rotation()
).
ReefGuideAPI.filter_sites Method
filter_sites(res_df::DataFrame)::DataFrame
Filter out sites where the qc_flag indicates a suitability < surr_threshold
in searching. Where site polygons are overlapping, keep only the highest scoring site polygon.
Arguments
res_df
: Results DataFrame containing potential site polygons (output fromidentify_potential_sites()
oridentify_edge_aligned_sites()
).
Returns
DataFrame containing only the highest scoring sites where site polygons intersect, and containing only sites with scores greater than the surr_threshold
specified in identify_edge_aligned_sites()
(default=0.6).
ReefGuideAPI.find_horizontal Method
find_horizontal(geom::GI.Wrappers.Polygon)::Vector{Tuple{Float64,Float64}, Tuple{Float64,Float64}}
Find a horizontal line if one exists within a geometry.
Returns
Vector containing tuples of coordinates for a horizontal line found within geom.
ReefGuideAPI.from_zero Method
from_zero(v::Vector{Tuple{Float64,Float64}})::Vector{Tuple{Float64, Float64}}
Translates Vector of points v
to begin from (0, 0), retaining direction and length.
Argument
v
: Vector of point coordinates (Tuple{Float64, Float64}
).
ReefGuideAPI.generate_criteria_mask! Method
generate_criteria_mask!(fn::String, rst_stack::RasterStack, lookup::DataFrame, ruleset::Vector{CriteriaBounds{Function}})
Generate mask file for a given region and reef type (slopes or flats) according to thresholds applied to a set of criteria.
Notes
Zeros indicate locations to mask out.
Ones indicate locations to keep.
Arguments
fn
: File to write geotiff toreg_criteria
: RegionalCriteria to assessrtype
: reef type to assess (:slopes
or:flats
)crit_map
: List of criteria thresholds to apply (seeapply_criteria_thresholds()
)
Returns
Nothing
ReefGuideAPI.identify_edge_aligned_sites Method
identify_edge_aligned_sites(
env_lookup::DataFrame,
search_pixels::DataFrame,
res::Float64,
gdf::DataFrame,
x_dist::Union{Int64,Float64},
y_dist::Union{Int64,Float64},
target_crs::GeoFormatTypes.EPSG,
region::String;
degree_step::Float64=15.0,
n_rot_p_side::Int64=2,
suit_threshold::Float64=0.7
)::DataFrame
Identify the most suitable site polygons for each pixel in the search_pixels
DataFrame. x_dist
and y_dist
are x and y lengths of the search polygon in meters. A buffer of the raster files' resolution is applied to the search box. And angle from a pixel to a reef edge is identified and used for searching with custom rotation parameters. Method is currently opperating for CRS in degrees units.
Arguments
env_lookup
: DataFrame containing environmental variables for assessment.search_pixels
: DataFrame containing lon and lat columns for each pixel that is intended for analysis.res
: Resolution of the original raster pixels. Can by found viaabs(step(dims(raster, X)))
.reef_outlines
: GeoDataFrame of reef outlines used to align the search box edge.x_dist
: Length of horizontal side of search box (in meters).y_dist
: Length of vertical side of search box (in meters).target_crs
: CRS of the input Rasters. Using GeoFormatTypes.EPSG().region
: Region name, e.g. "Cairns-Cooktown" or "FarNorthern".degree_step
: Degree to perform rotations around identified edge angle.n_rot_p_side
: Number of rotations to perform clockwise and anticlockwise around the identified edge angle. Default 2 rotations.suit_threshold
: Theshold used to skip searching where the proportion of suitable pixels is too low.
Returns
DataFrame containing highest score, rotation and polygon for each assessment at pixels in indices.
ReefGuideAPI.identify_edge_aligned_sites Method
identify_edge_aligned_sites(
rst_stack::Raster,
search_pixels::DataFrame,
gdf::DataFrame,
x_dist::Union{Int64,Float64},
y_dist::Union{Int64,Float64},
target_crs::GeoFormatTypes.EPSG,
region::String,
reef_lines::Vector{Vector{GeometryBasics.Line{2,Float64}}};
degree_step::Float64=15.0,
n_rot_per_side::Int64=2
)::DataFrame
Identify the most suitable site polygons for each pixel in the search_pixels
DataFrame. x_dist
and y_dist
are x and y lengths of the search polygon. A buffer of rst_stack
resolution is applied to the search box. And angle from a pixel to a reef edge is identified and used for searching with custom rotation parameters.
Arguments
rst_stack
: Raster containing environmental variables for assessment.search_pixels
: DataFrame containing lon and lat values for each pixel intended forgdf
: GeoDataFrame containing the reef outlines used to align the search box edge.x_dist
: Length of horizontal side of search box.y_dist
: Length of vertical side of search box.target_crs
: CRS of the input Rasters. Using GeoFormatTypes.EPSG().region
: Management region name in GBRMPA format - e.g. "Mackay/Capricorn Management Area"reef_lines
: Vector containing reef outline segments for each reef ingdf.geometry
(Must be separate object togdf
rather than a column).degree_step
: Degree to perform rotations around identified edge angle.n_rot_per_side
: Number of rotations to perform clockwise and anticlockwise around the identified edge angle. Default 2 rotations.
Returns
DataFrame containing highest score, rotation and polygon for each assessment at pixels in indices.
ReefGuideAPI.initial_search_box Method
initial_search_box(
(lon::Float64, lat::Float64),
x_dist::Union{Int64, Float64},
y_dist::Union{Int64, Float64},
target_crs::GeoFormatTypes.EPSG,
res::Float64
)::GI.Wrappers.Polygon
Create an initial search box that is centered around the point (lon, lat)
in target_crs
, and is buffered by res
distance.
Arguments
(lon, lat)
: Longitude and latitude coordinates of the center target pixel.x_dist
: x (longitude) dimension length of initial search box.y_dist
: y (latitude) dimension length of initial search box.target_crs
: Target CRS of box to match input data types.res
: Buffer distance (resolution of input raster search data).
Returns
Initial search box geometry.
ReefGuideAPI.initial_search_rotation Method
initial_search_rotation(
pixel::GeometryBasics.Point{2, Float64},
geom_buff::GI.Wrappers.Polygon,
gdf::DataFrame,
reef_outlines::Vector{Vector{T}};
search_buffer::Union{Int64,Float64}=20000.0
)::Float64 where {T}
Identifies the closest edge to the target pixel
/geom_buff
. The angle required to rotate geom_buff
by to match this reef edge is calculated.
Extended help
The returned angle is the angle relative to the default geom_buff
horizontal orientation. Therefore, if returned angle = 45 degrees, rot_geom(geom_buff, 45)
will rotate geom_buff
by 45 degrees to match the identified reef edge.
Arguments
pixel
: Target point at the center of the search polygon.geom_buff
: Initial search box with zero rotation.reef_geoms
: Geometries representing reefsreef_outlines
: Line segments for the outlines of each reef ingdf
.
Returns
Rotation angle required to match reef edge when used in rotate_geom(geom_buff, rot_angle)
.
ReefGuideAPI.initialize_regional_data_cache Method
initialize_regional_data_cache(reef_data_path::String, reg_cache_fn::String)
Create initial regional data store with data from reef_data_path
, excluding geospatial data and save to reg_cache_fn
path.
ReefGuideAPI.line_angle Method
line_angle(a::T, b::T)::Float64 where {T <: Vector{Tuple{Float64,Float64}}}
Calculate the angle between two lines.
Arguments
a
: Line between point coordinates.b
: Line between point coordinates.
Returns
Angle between the two lines.
Examples
line_angle([(0.0,5.0), (0.0,0.0)], from_zero(edge_line))
line_angle([(0.0,5.0), (0.0,0.0)], [(1.0, 4.0), (7.0, 8.0)])
ReefGuideAPI.lookup_assess_region Method
lookup_assess_region(reg_assess_data, reg, qp, rtype; x_dist=100.0, y_dist=100.0)
Perform suitability assessment with the lookup table based on user-defined criteria. This is currently orders of magnitude slower than the raster-based approach, although it uses significantly less memory.
Arguments
reg_assess_data
: Dictionary containing the regional data paths, reef outlines and full region names.reg
: Name of the region being assessed (formatCairns-Cooktown
rather thanCairns/Cooktown Management Area
).qp
: Dict containing bounds for each variable being filtered.rtype
: Type of zone to assess (flats or slopes).x_dist
: width of search polygony_dist
: height of search polygon
Returns
Raster of surrounding hectare suitability (1-100%) based on the criteria bounds input by a user.
ReefGuideAPI.mask_region Method
mask_region(reg_assess_data, reg, qp, rtype)
Arguments
reg_assess_data
: Regional assessment datareg
: The region name to assessqp
: query parametersrtype
: region type (one of:slopes
or:flats
)
Returns
Raster of region with locations that meet criteria masked.
ReefGuideAPI.meters_to_degrees Method
meters_to_degrees(x, lat)
Convert meters to degrees at target latitude.
ReefGuideAPI.move_geom Method
move_geom(geom, new_centroid::Tuple)::GI.Wrappers.Polygon
Move a geom to a new centroid.
Arguments
geom
: geometry to movenew_centroid
: Centroid given in (lon, lat).
ReefGuideAPI.n_gdal_threads Method
n_gdal_threads(config::Dict)::String
Retrieve the configured number of threads to use when writing COGs with GDAL.
ReefGuideAPI.output_geojson Method
output_geojson(destination_path::String, df::DataFrame)::Nothing
Writes out GeoJSON file to a target directory. Output file will be located at location: destination_path
.
Arguments
destination_path
: File path to write geojson file to.df
: DataFrame intended for writing to geojson file.
ReefGuideAPI.parse_criteria_query Method
parse_criteria_query(qp)::Tuple
Parse criteria values from request query.
Queries should take the form of: Depth=-9.0:0.0&Slope=0.0:40.0&Rugosity=0.0:0.0
Arguments
qp
: Parsed query string from request.
Returns
Tuple of criteria names, lower bounds, upper bounds
ReefGuideAPI.polygon_to_lines Method
polygon_to_lines(
polygon::Union{Vector{T},T,GIWrap.MultiPolygon}
) where {T<:GIWrap.Polygon}
Extract the individual lines between vertices that make up the outline of a polygon.
Returns
Vector of GeometryBasics.LineString{2, Float64} with one line for each adjacent vertex pair in polygon
.
ReefGuideAPI.port_buffer_mask Method
port_buffer_mask(gdf::DataFrame, dist::Float64; unit::String="NM")
Create a masking buffer around indicated port locations.
Arguments
gdf
: GeoDataFrame of port locations (given as long/lat points)dist
: distance from port in degrees (deg), kilometers (km), or nautical miles (NM; default)unit
: unitdist
is in
ReefGuideAPI.proportion_suitable Method
proportion_suitable(
x::Union{BitMatrix,SparseMatrixCSC{Bool,Int64}}; square_offset::Tuple=(-4, 5)
)::SparseMatrixCSC{UInt8,Int64}
Calculate the the proportion of the subsection that is suitable for deployments. The subsection
is the surrounding a rough hectare area centred on each cell of a raster marked as being suitable according to user-selected criteria.
Cells on the edges of a raster object are assessed using a smaller surrounding area, rather than shifting the window inward. In usual applications, there will be no target pixel close to the edge due to the use of buffer areas.
Arguments
x
: Matrix of boolean pixels after filtering with user criteria.square_offset
: The number of pixels +/- around a center "target" pixel to assess as the moving window. Defaults to (-4, 5). Assuming a 10m² pixel, the defaultsquare_offset
resolves to a one hectare area.
Returns
Matrix of values 0 - 100 indicating the percentage of the area around the target pixel that meet suitability criteria.
ReefGuideAPI.remove_rugosity Method
remove_rugosity(reg, criteria, lbs, ubs)
Remove rugosity layer from consideration if region is not Townsville. Rugosity data currently only exists for the Townsville region.
ReefGuideAPI.rotate_geom Method
rotate_geom(
geom,
degrees::Float64,
target_crs::GeoFormatTypes.EPSG
)
Rotate target geom
by degrees
rotation in clockwise direction. target_crs
is applied to output geometry.
Returns
Rotated geometry.
ReefGuideAPI.rotate_polygon Method
rotate_polygon(poly_points, centroid, degrees)
Rotate target poly_points
by degrees
rotation about its center defined by centroid
.
ReefGuideAPI.rotate_polygon Method
rotate_polygon(geom, degrees)
Rotate target geom
by degrees
rotation about its center.
Returns
Rotated geometry.
ReefGuideAPI.search_lookup Method
search_lookup(raster::Raster, threshold::Union{Int64,Float64})::DataFrame
Build a look up table identifying all pixels in a raster that meet a suitability threshold.
Arguments
raster
: Raster of regional datathreshold
: Suitability threshold value (greater or equal than)
Returns
DataFrame containing indices, lon and lat for each pixel that is intended for further analysis.
ReefGuideAPI.setup_regional_data Method
setup_regional_data(config::Dict)
Load regional data to act as an in-memory cache.
Arguments
config
: Configuration settings, typically loaded from a TOML file.reef_data_path
: Path to pre-prepared reef data
Returns
OrderedDict of RegionalCriteria
for each region.
ReefGuideAPI.threshold_mask Method
threshold_mask(reg_criteria, rtype::Symbol, crit_map)::Raster
threshold_mask(reg_criteria, rtype::Symbol, crit_map, lons::Tuple, lats::Tuple)::Raster
Generate mask for a given region and reef type (slopes or flats) according to thresholds applied to a set of criteria.
Notes
Zeros indicate locations to mask out.
Ones indicate locations to keep.
Arguments
reg_criteria
: RegionalCriteria to assessrtype
: reef type to assess (:slopes
or:flats
)crit_map
: List of criteria thresholds to apply (seeapply_criteria_thresholds()
)lons
: Longitudinal extent (min and max, required when generating masks for tiles)lats
: Latitudinal extent (min and max, required when generating masks for tiles)
Returns
True/false mask indicating locations within desired thresholds.
ReefGuideAPI.tile_size Method
tile_size(config::Dict)::Tuple
Retrieve the configured size of map tiles in pixels (width and height / lon and lat).
ReefGuideAPI.valid_lonlat_inds Method
valid_lonlat_inds(data::DataFrame, criteria::Symbol, lb::T, ub::T) where {T}
Retrieve the indices of valid data for a region.
Arguments
data
:criteria
:lb
:ub
:
Returns
Tuple{Vector{Int64}, Vector{Int64}}, of lon and lat indices.
ReefGuideAPI.valid_pixel_positions Method
valid_pixel_positions(data::DataFrame, criteria::Symbol, lb::T, ub::T) where {T}
Obtain the pixel positions of valid data.
Intended for use in applications similar to ImageryLayer - client side pixel filter.
Arguments
data
:criteria
:lb
: lower boundub
: upper bound
ReefGuideAPI.warmup_cache Method
warmup_cache(config_path::String)
Invokes warm up of regional data cache to reduce later spin up times.
ReefGuideAPI.within_thresholds Method
within_thresholds(ctype::Val, data::Raster, lb::T, ub::T) where {T}
Apply in-bound constraints.
Notes
Why is this a simple one line function? Because we want to be able to cache results for each constraint type.