{"id":16457336,"url":"https://github.com/connectedsystems/gbr-featureanalysis","last_synced_at":"2025-10-27T08:31:27.088Z","repository":{"id":231027338,"uuid":"780703258","full_name":"ConnectedSystems/GBR-FeatureAnalysis","owner":"ConnectedSystems","description":"Analyses on GBR Regions and Reefs to assess/align data","archived":true,"fork":false,"pushed_at":"2024-04-02T03:01:19.000Z","size":21329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-10T01:30:54.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConnectedSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-02T02:06:32.000Z","updated_at":"2024-04-03T03:10:57.000Z","dependencies_parsed_at":"2024-04-02T04:36:06.895Z","dependency_job_id":null,"html_url":"https://github.com/ConnectedSystems/GBR-FeatureAnalysis","commit_stats":null,"previous_names":["connectedsystems/gbr-featureanalysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectedSystems%2FGBR-FeatureAnalysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectedSystems%2FGBR-FeatureAnalysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectedSystems%2FGBR-FeatureAnalysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectedSystems%2FGBR-FeatureAnalysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConnectedSystems","download_url":"https://codeload.github.com/ConnectedSystems/GBR-FeatureAnalysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238463786,"owners_count":19476774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T10:30:24.135Z","updated_at":"2025-10-27T08:31:22.030Z","avatar_url":"https://github.com/ConnectedSystems.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GBR-FeatureAnalysis\n\nAttempt to create a standardized geopackage file including data from:\n\n- `reefmod_gbr.gpkg` created from a combination of a shapefile found on Teams which provides\n  the reef polygons and ReefMod id list CSV (see entry below).\n  - This should be updated with a known canonical copy of the GBRMPA Reef Feature dataset\n- A. Cresswell's Lookup table `GBR_reefs_lookup_table_Anna_update_2024-03-06.[csv/xlsx]`\n  This is referred to as the AC lookup table.\n- `id_list_2023_03_30.csv` from ReefMod Engine 2024-01-08 (v1.0.28)\n- GBRMPA Reef Feature dataset:\n  - https://data.gov.au/dataset/ds-dga-51199513-98fa-46e6-b766-8e1e1c896869/details\n  - The metadata for the data.gov.au entry states it has been \"Updated 16/08/2023\"\n\nThere are several mismatches between the ReefMod reef list, AC lookup table and the GBRMPA\nreef feature list (see details further below).\n\nThe entry for the GBRMPA Reef feature list (see link above) states that it has been updated\nin 2023-08-16. Therefore, I assume those IDs are the most correct ones and default to those.\n\n## Project Layout\n\nAssumes `src` is the project root. Each file in `src` is expected to be run in order.\n\n```code\nGBR-FeatureAnalysis/\n├─ src/          # Analysis\n├─ data/         # data used to create canonical dataset\n├─ output/       # results\n├─ .gitignore\n├─ Project.toml  # Julia project spec\n├─ LICENSE.md\n├─ README.md  # this file\n```\n\n## Setup\n\nUsual Julia setup.\n\n```bash\n$ julia --project=.\n```\n\n```julia\n# Instantiate project and switch to src directory\n]instantiate\n;cd src\n\n# Run first script\ninclude(\"1_create_canonical.jl\")\n```\n\n## Discrepancies\n\nNote that ReefMod Engine uses an older version of GBRMPA IDs (see notes in\n`id_list_2023_03_30.csv` and below). I do not know which version is used more generally\nacross RRAP but I have made the decision to default to the updated GBRMPA IDs where there\nare any discrepancies.\n\n```code\n    # Used in RME   Revised\n    # 10-441        11-325\n    # 11-288        11-244e\n    # 11-303        11-244f\n    # 11-310        11-244g\n    # 11-311        11-244h\n```\n\nWhen comparing how many matching IDs are found in each dataset, they never align properly.\n\n```julia\n# Expected 100% match is 3806 (the number of reefs represented in ReefMod)\n\n# AC Lookup compared to GBR feature list\ncount(ac_lookup.UNIQUE_ID .∈ [gbr_features.UNIQUE_ID])\n# 3794\n\n# RME reef list compared to GBR feature list\ncount(rme_features.UNIQUE_ID .∈ [gbr_features.UNIQUE_ID])\n# 3801 (could be explained by the above revised IDs)\n\n# AC lookup compared to RME reef list\ncount(ac_lookup.UNIQUE_ID .∈ [rme_features.UNIQUE_ID])\n# 3799\n```\n\n## Resolving discrepancies\n\nTo resolve the above, I have:\n\n1. Match reefs by their UNIQUE IDs between RME and GBRMPA datasets\n2. Find the discrepancies between the two\n3. Confirm the discrepancies between RME and GBRMPA datasets are the same as the ones\n   reported above\n4. Replace the older IDs with the new ones.\n5. Copy the spatial geometries from the GBRMPA feature set\n6. Reorder the dataframe based on the order given by AC lookup table (which should be\n   identical to the RME features)\n7. The AC lookup table and RME datasets ostensibly match by row order, so I copy columns\n   of interest on that basis.\n\n**In conversation with YM. Bozec, A. Cresswell, and M. Puotinen, there are several other\nissues not yet accounted for (to be detailed once all info has been collated).**\n\n## Relevant details\n\nThe geopackage compiled at the end should then have the correct reef names, IDs, and\nlocations/geometries.\n\n```julia\n# Find UNIQUE IDs in RME dataset that do not appear in GBRMPA dataset\njulia\u003e mismatched_unique = findall(.!(rme_features.UNIQUE_ID .∈ [gbr_features.UNIQUE_ID]))\n# 5-element Vector{Int64}:\n#  103\n#  451\n#  466\n#  473\n#  474\n\n # IDs of the mismatched reefs\njulia\u003e rme_features.UNIQUE_ID[mismatched_unique]\n# 5-element Vector{String}:\n#  \"10441100104\"\n#  \"11288100104\"\n#  \"11303100104\"\n#  \"11310100104\"\n#  \"11311100104\"\n\n# These missing ones are the same as noted above by their LTMP IDs\n# So we replace these with the revised IDs\njulia\u003e rme_features[mismatched_unique, :LABEL_ID]\n# 5-element Vector{String}:\n# \"10-441\"\n# \"11-288\"\n# \"11-303\"\n# \"11-310\"\n# \"11-311\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnectedsystems%2Fgbr-featureanalysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnectedsystems%2Fgbr-featureanalysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnectedsystems%2Fgbr-featureanalysis/lists"}