Skip to contents

The download_gbr_spatial() function returns one of four spatial datasets:

Code
library(dhw)
library(tidyverse)

GBR_base <- download_gbr_spatial(return = "base")
GBR_reefs <- download_gbr_spatial(return = "combined")
GBR_hull <- download_gbr_spatial(return = "hull")
GBR_outline <- download_gbr_spatial(return = "outline")

GBR_base

return = "base" returns the raw data downloaded from

https://nextcloud.eatlas.org.au/s/xQ8neGxxCbgWGSd/download/TS_AIMS_NESP_Torres_Strait_Features_V1b_with_GBR_Features.zip"

The dataset spans 8390 unique LABEL_ID including all GBR features (FEAT_NAME includes Bank, Reef, Terrestrial Reef, Rock, Other, Mainland, Cay, Island, Sand)

Code
GBR_base
Simple feature collection with 28836 features and 35 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: 138.0012 ymin: -29.17855 xmax: 153.5516 ymax: -8.679173
Geodetic CRS:  GDA94
First 10 features:
   TARGET_FID     DATASET               LOC_NAME_S      GBR_NAME CHART_NAME
1           1 TS Features  U/N Sand Bank (09-347a) U/N Sand Bank       <NA>
2           2 TS Features   U/N Sand Bank (09-347) U/N Sand Bank       <NA>
3           3 TS Features  U/N Sand Bank (09-355z) U/N Sand Bank       <NA>
4           4 TS Features U/N Sand Bank (09-355a0) U/N Sand Bank       <NA>
5           5 TS Features U/N Sand Bank (09-355a1) U/N Sand Bank       <NA>
6           6 TS Features  U/N Sand Bank (09-355v) U/N Sand Bank       <NA>
7           7 TS Features  U/N Sand Bank (09-355x) U/N Sand Bank       <NA>
8           8 TS Features  U/N Sand Bank (09-355y) U/N Sand Bank       <NA>
9           9 TS Features  U/N Sand Bank (09-355w) U/N Sand Bank       <NA>
10         10 TS Features   U/N Sand Bank (09-373) U/N Sand Bank       <NA>
   TRAD_NAME UN_FEATURE LABEL_ID SORT_GBR_I FEAT_NAME LEVEL_1   LEVEL_2
1       <NA>       TRUE  09-347a       9347      Bank    Bank Sand Bank
2       <NA>       TRUE   09-347       9347      Bank    Bank Sand Bank
3       <NA>       TRUE  09-355z       9355      Bank    Bank Sand Bank
4       <NA>       TRUE 09-355a0       9355      Bank    Bank Sand Bank
5       <NA>       TRUE 09-355a1       9355      Bank    Bank Sand Bank
6       <NA>       TRUE  09-355v       9355      Bank    Bank Sand Bank
7       <NA>       TRUE  09-355x       9355      Bank    Bank Sand Bank
8       <NA>       TRUE  09-355y       9355      Bank    Bank Sand Bank
9       <NA>       TRUE  09-355w       9355      Bank    Bank Sand Bank
10      <NA>       TRUE   09-373       9373      Bank    Bank Sand Bank
     LEVEL_3 CLASS_CONF CLASS_SRC POLY_ORIG IMG_SRC SUB_NO           CODE
1  Sand Bank       High   Landsat       New Landsat    101 09-347-110-101
2  Sand Bank       High   Landsat       New Landsat    100 09-347-110-100
3  Sand Bank       High   Landsat       New Landsat    126 09-355-110-126
4  Sand Bank       High   Landsat       New Landsat    127 09-355-110-127
5  Sand Bank       High   Landsat       New Landsat    128 09-355-110-128
6  Sand Bank       High   Landsat       New Landsat    122 09-355-110-122
7  Sand Bank       High   Landsat       New Landsat    124 09-355-110-124
8  Sand Bank       High   Landsat       New Landsat    125 09-355-110-125
9  Sand Bank       High   Landsat       New Landsat    123 09-355-110-123
10 Sand Bank       High   Landsat       New Landsat    100 09-373-110-100
   FEATURE_C      QLD_NAME X_LABEL GBR_ID LOC_NAME_L  X_COORD   Y_COORD
1        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.0781 -9.270715
2        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.0429 -9.293290
3        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.1020 -9.388480
4        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.0973 -9.388562
5        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.0940 -9.390258
6        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.1209 -9.386653
7        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.0837 -9.393855
8        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.1636 -9.405083
9        110 U/N Sand Bank    <NA>   <NA>       <NA> 143.0506 -9.404345
10       110 U/N Sand Bank    <NA>   <NA>       <NA> 142.9252 -9.756551
   SHAPE_AREA  SHAPE_LEN Checked RegionID LatitudeID GroupID PriorityLb
1  0.78616854 10.4794306   FALSE       13          9     347      FALSE
2  2.95336187 17.8452808   FALSE       13          9     347       TRUE
3  0.17314345  2.0730203   FALSE       13          9     355      FALSE
4  0.05753826  1.0656155   FALSE       13          9     355      FALSE
5  0.03254316  0.7397521   FALSE       13          9     355      FALSE
6  3.57375838 16.4615152   FALSE       13          9     355      FALSE
7  0.88188514  7.8675980   FALSE       13          9     355      FALSE
8  0.32171390  2.9717605   FALSE       13          9     355      FALSE
9  1.52979291 14.3151950   FALSE       13          9     355      FALSE
10 1.65930929  9.6393642   FALSE       14          9     373       TRUE
            Country   UNIQUE_ID                       geometry
1  Papua-New Guinea 09347110101 POLYGON ((143.0851 -9.26657...
2  Papua-New Guinea 09347110100 POLYGON ((143.0549 -9.29339...
3  Papua-New Guinea 09355110126 POLYGON ((143.1056 -9.3908,...
4  Papua-New Guinea 09355110127 POLYGON ((143.0985 -9.39007...
5  Papua-New Guinea 09355110128 POLYGON ((143.0939 -9.39146...
6  Papua-New Guinea 09355110122 POLYGON ((143.1298 -9.36866...
7  Papua-New Guinea 09355110124 POLYGON ((143.0905 -9.38934...
8  Papua-New Guinea 09355110125 POLYGON ((143.1675 -9.40401...
9  Papua-New Guinea 09355110123 POLYGON ((143.0739 -9.39021...
10        Australia 09373110100 POLYGON ((142.9353 -9.77388...
Code
#unique(GBR_base$LABEL_ID) |> length()
#unique(GBR_base$FEAT_NAME)

GBR_reefs

return = "combined" groups reefs by LABEL_ID, dissolves to one geometry per ID (summarise(st_union)), calculates polygon area (st_area()) for each LABEL_ID, and returns 4612 unique LABEL_ID as either polygons or multipolygons.

Code
GBR_reefs
Simple feature collection with 13830 features and 3 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: 141.1284 ymin: -24.52351 xmax: 152.8105 ymax: -8.965184
Geodetic CRS:  GDA94
First 10 features:
   LABEL_ID      GBR_NAME        area                       geometry
1    09-002      U/N Reef 46289499.69 MULTIPOLYGON (((141.1854 -9...
2    09-004 Turu Cay Reef  2605496.86 MULTIPOLYGON (((141.438 -9....
3    09-005      U/N Reef    15042.84 MULTIPOLYGON (((141.4505 -9...
4    09-009 U/N Sand Bank  7721071.39 MULTIPOLYGON (((141.5132 -9...
5    09-010 U/N Sand Bank  7128522.56 MULTIPOLYGON (((141.5269 -9...
6    09-011 U/N Sand Bank  1264991.96 MULTIPOLYGON (((141.5454 -9...
7    09-012 U/N Sand Bank  1685312.84 MULTIPOLYGON (((141.5493 -9...
8    09-013 U/N Sand Bank   525648.55 MULTIPOLYGON (((141.54 -9.4...
9    09-014      U/N Reef  3077860.80 MULTIPOLYGON (((141.5869 -9...
10   09-015 U/N Foreshore 27187403.84 MULTIPOLYGON (((141.5396 -9...
Code
#unique(GBR_reefs$LABEL_ID) |> length()
#unique(GBR_base$FEAT_NAME)

In the full GBR dataset, “LABEL_ID” is split into multiple subgroups. For example, LABEL_ID 09-355 includes 26 sublevels (a,b,c,d, through to a1, a0). This includes Wapa Reef by LOC_NAME_S but also U/N Sand Bank. With return="combined" all sublevels of LABEL_ID are combined to a single multipolygon which adopts the LOC_NAME_S (see below for Wapa Reef example).

Non-GBR content (including Mornington, Forsyth & South Wellesley Islands in the Gulf of Carpenteria, and all shoals Y_COORD < -25) and are additionally removed.

Code
library(tidyverse)
library(sf)
library(ggplot2)

GBR_base_09355 <- GBR_base |>
  dplyr::filter(stringr::str_detect(LABEL_ID, "^09-355"))

GBR_reef_09355 <- GBR_reefs |>
  dplyr::filter(stringr::str_detect(LABEL_ID, "^09-355"))


library(patchwork)

a <- ggplot() + theme_bw() + geom_sf(data=GBR_base_09355, aes(fill=LOC_NAME_S)) + ggtitle("return=base") + 
  ggplot2::theme(
  legend.position = "left",
  legend.text  = ggplot2::element_text(size = ggplot2::rel(0.6)),
  legend.title = ggplot2::element_text(size = ggplot2::rel(0.6)),
  legend.key.size = grid::unit(0.25, "lines")
)

b <- ggplot() + theme_bw() + geom_sf(data=GBR_reef_09355, aes(fill=LABEL_ID)) + ggtitle("return=combined")

a|b

GBR_hull

return = "hull" returns a single polygon, which is a single convex hull around all FEAT_NAME = “Reef”, “Terrestrial Reef”, “Island”, “Rock”, “Bank” with an additional 1km buffer. As the original file included a lake in outback Queensland the subset of FEAT_NAME that overlap with the LOC_NAME_S == "Mainland (99-000)") and non-GBR content (including Mornington, Forsyth & South Wellesley Islands in the Gulf of Carpenteria, and Y_COORD < -25) and are removed prior to creating the convex hull.

Code
GBR_hull
Simple feature collection with 3 features and 0 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: 141.0958 ymin: -24.57201 xmax: 152.8265 ymax: -8.926405
Geodetic CRS:  GDA94
                        geometry
1 POLYGON ((152.2627 -24.4350...
2 POLYGON ((152.2627 -24.4350...
3 POLYGON ((152.2627 -24.4350...
Code
#unique(GBR_reefs$LABEL_ID) |> length()
#unique(GBR_base$FEAT_NAME)
Code
ggplot() + theme_bw() + geom_sf(data=GBR_hull, fill="aquamarine4", alpha=0.2)

GBR_outline

GBR_outline returns the Austrlian mainland via the largest area from the original GBR_base:

Code
GBR_outline
Simple feature collection with 2 features and 35 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: 138.0012 ymin: -29.17855 xmax: 153.5516 ymax: -10.68757
Geodetic CRS:  GDA94
  TARGET_FID      DATASET        LOC_NAME_S GBR_NAME CHART_NAME TRAD_NAME
1       8687 GBR Features Mainland (99-000) Mainland       <NA>      <NA>
2       8687 GBR Features Mainland (99-000) Mainland       <NA>      <NA>
  UN_FEATURE LABEL_ID SORT_GBR_I FEAT_NAME  LEVEL_1 LEVEL_2 LEVEL_3 CLASS_CONF
1      FALSE   99-000      99000  Mainland Mainland    <NA>    <NA>       <NA>
2      FALSE   99-000      99000  Mainland Mainland    <NA>    <NA>       <NA>
  CLASS_SRC    POLY_ORIG IMG_SRC SUB_NO           CODE FEATURE_C QLD_NAME
1      <NA> GBR_Features    <NA>    100 99-000-100-100       100 Mainland
2      <NA> GBR_Features    <NA>    100 99-000-100-100       100 Mainland
   X_LABEL GBR_ID        LOC_NAME_L  X_COORD  Y_COORD SHAPE_AREA SHAPE_LEN
1 10-1000S  99000 Mainland (99-000) 144.5323 -22.5755    1699587  14492.94
2 10-1000S  99000 Mainland (99-000) 144.5323 -22.5755    1699587  14492.94
  Checked RegionID LatitudeID GroupID PriorityLb   Country   UNIQUE_ID
1      NA        0         99       0       TRUE Australia 99000100100
2      NA        0         99       0       TRUE Australia 99000100100
                        geometry
1 POLYGON ((142.535 -10.69223...
2 POLYGON ((142.535 -10.69223...
Code
ggplot() + theme_bw() + geom_sf(data=GBR_outline, fill="aquamarine2", alpha=0.2)

Spatial verifications

Check which LABEL_ID reefs in GBR_reefs overlap with GBR_reefs:

Code
GBR_reefs_chk <- GBR_reefs |>
  sf::st_make_valid() |>
  sf::st_transform(sf::st_crs(GBR_hull)) |>
  dplyr::mutate(
    within_hull = sf::st_within(geometry, sf::st_geometry(GBR_hull), sparse = FALSE)[, 1],
    intersects_hull = sf::st_intersects(geometry, sf::st_geometry(GBR_hull), sparse = FALSE)[, 1]
  )

GBR_reefs_chk |>
  sf::st_drop_geometry() |>
  dplyr::count(within_hull, intersects_hull)
  within_hull intersects_hull     n
1        TRUE            TRUE 13830

=