Skip to content

Improved site and region assessment processes #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 10, 2025

Conversation

ConnectedSystems
Copy link
Collaborator

@ConnectedSystems ConnectedSystems commented Jun 5, 2025

Avoids relying on any rasters for assessment (although it uses the raster of "valid" pixels to simplify writing results out).

Leverages STR trees (Sort-Tile-Recursive trees) for quick and efficient spatial indexing to reduce search costs compared to indexing rasters or searching dataframes directly.

Also uses Extendable Sparse Matrices to store raster data if the raster size is estimated to be >= 700MB (limit is arbitrary and should be tuned/tunable).

Spatial areas that resolve to be < 700MB use regular matrices and result in faster COG write times (~30% from previous timings).
Sparse matrices reduce memory use by orders of magnitude, but incur additional overhead when writing data out to file.

There's also currently a hardcoded filename suffix ($(region_name)_valid_slopes.tif) - I didn't know where I should put it.
This file is used as a template so that the same extents, spatial coordinates, and CRS are used when creating COGs.

These changes are untested - I don't have the energy tonight to work out how to run ReefGuide methods locally and there's no working example in the readme any more 😢

Note: Most recent processed data includes lons/lats column in the lookup table so do not need to be recreated on data load.
If added a simple check to generate these columns if needed for now.

For efficient spatial querying
File is needed to use as a template when writing out COGs.

TODO: Fix up hard coded filename suffix.
Based on an arbitrary threshold of estimated raster size, use a regular in-memory matrix (< 700MB) or a Extendable Sparse Matrix (to reduce memory use, at the cost of higher COG write times).
Rather than relying on index-based search of rasters or coordinate-based filtering, apply Sort-Tile-Recursive Trees (based on R-tree indexing) for quick and efficient filtering.
PeterBaker0 and others added 3 commits June 6, 2025 16:41
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
We've already stored the dim values anyway
Appease the great linter!
Copy link
Collaborator

@PeterBaker0 PeterBaker0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested - working with very very nice performance improvements, especially for the suitability assessment.

Had some missing variables/errors but have fixed them, tested E2E for regional and suitability with new data. Will need to do a data update on EFS.

@ConnectedSystems ConnectedSystems merged commit a11ae41 into main Jun 10, 2025
1 check passed
@ConnectedSystems ConnectedSystems deleted the feat/assessment-improvements branch June 10, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants