Closed echelleburns closed 6 months ago
Commit 3f97000d1527eaba73d5b0963807fa31d5148e55 should have resolved most of these errors, but there is still a problem with get_knolls
because the knolls dataset extends beyond -180 to 180 extent which sf::st_break_antimeridian
doesn't like. My solution for this will be to crop it to a -180 to 180 extent, but currently having issues getting a valid output due to the polygons not splitting properly at the antimeridian. Working code for this is in data-raw/knolls_base_area_crop.R
.
Also, I get_enviro_regions
for Kiribati in tests
is consuming all the memory then failing: will need to check that.
Commit 5a4518f8390884ae3fd0dd7ee62ea7931d706a4f has solved problems with the knolls by cropping as I suggested. But still have errors in Kiribati bathymetry in raster planning units
Ok, I've resolved all the errors and issues for Kiribati. @echelleburns can you check that Kiribati features are all coming up ok for you? There is a Kiribati section of code in the test_code.R
file in root. You just need to run devtools::load_all()
before it.
Works well for me, and all tests passed! Well done!
Fatal errors for the following functions occur when using a
planning_grid
that crosses the antimeridian, like Kiribati.get_knolls
data_to_planning_grid
get_geomorphology
get_bathymetry
get_coral_habitat
get_features
Below is an example:
The resulting messages, warnings, and errors include:
The
planning_grid
itself seems sound:terra::plot(planning_grid)
And this same error does not occur with the following functions:
get_bathymetry
get_enviro_regions
get_seamount_peaks
get_seamounts_buffered
For example:
bathymetry <- get_bathymetry(planning_grid = planning_grid, antimeridian = TRUE)
Has the expected result (a SpatRaster of depths), but the resulting file looks like it only has data on one part of the area of interest.
terra::plot(bathymetry