-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add suitability raster assessment and site polygon assessment functionality #32
Conversation
src/ReefGuideAPI.jl
Outdated
reg_cache_dir = config["server_config"]["REGIONAL_CACHE_DIR"] | ||
reg_cache_fn = joinpath(reg_cache_dir, "regional_cache.dat") | ||
if isfile(reg_cache_fn) | ||
@debug "Loading regional data cache from disk" | ||
@eval const REGIONAL_DATA = deserialize($(reg_cache_fn)) | ||
|
||
reef_outline_path = joinpath(reef_data_path, "rrap_canonical_outlines.gpkg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue I have here is that we'd have to rename the canonical reefs file every time there's an update, won't we?
Why not just use the original filename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original file name has the date/time of creation in it so I thought it was easier to rename it when it is uploaded to the input data teams folder. Or should i use find_latest_file() to find it and use the original name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would remove the need for us to manually do things, so I think use find_latest_file()
(in fact, we should rename that to find_latest_outlines()
or something more descriptive). It's an API-level utility too, so makes more sense to me for the function to live in the API rather than processing scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good! A bunch of small comments to be fixed up
# Need reef outlines | ||
gdf = reg_assess_data["reef_outlines"] | ||
reef_outlines = buffer_simplify(gdf) | ||
reef_outlines = polygon_to_lines.(reef_outlines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the reef outlines used for anything else?
Could this be done once when loading data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would make the simplification and buffering more hardcoded, but that's probably going too in depth for stakeholders anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, more hardcoded?
Moving this buffer_simplify
/ polygon_to_lines
elsewhere so it only happens once is the same level of "hardcodedness" in my view.
Otherwise I've misunderstood your concern...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments that I just picked up
Some strange conflict I wasn't seeing before with the various `contains` methods
fcb8912
to
ab7d28f
Compare
And add rtype and debug statement to assess_sites()
@arlowhite ready for a final review I think 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, though there's one x/y lon/lat mismatch that may be a bug, see comment "Bug??"
I think this is all good to go @arlowhite |
Also preallocate
Add
assess_region()
andsite_assess_region()
functions to dynamically process raster and polygon suitability results with user inputs.