Skip to content
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

AWS 2-8: Global Watershed Delineation Back-end #3662

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

rajadain
Copy link
Member

@rajadain rajadain commented Nov 20, 2024

Overview

Adds development data for TDX Basins, used for global watershed delineation. This subset is 200 miles around Philadelphia.

image

This also adds URLs, Views, Tasks, and Calcs to allow for delineation. The actual algorithm uses the nested set index developed in https://github.com/WikiWatershed/global-hydrography/?tab=readme-ov-file#modified-nested-set-index.

Even though this is highly performant, enough to be a synchronous response, we still use the async job workflow for two reasons:

  1. To maintain conformity with the rest of the API
  2. To log requests in the back-end, so that we have a record of them

Closes #3658

Demo

When the watershed resulting from the default point is loaded in QGIS, it looks like this:

image

Testing Instructions

  • Check out this branch
  • Bring up the VMS
    vagrant up
  • Load the development subset of TDX Basins data:
    vagrant ssh app -c 'cd /vagrant && ./scripts/aws/setupdb.sh -B'
    • Ensure it succeeds in a reasonable time
  • Go to http://localhost:8000/ and log in (create an account if you don't have one)
  • Go to http://localhost:8000/api/docs/
  • Exercise the global-watersheds API endpoint, using the default values
  • Query the returned job id
    • Ensure it has a successful result

The full dataset is too big for local development. This
subset is of a 200 mile radius circle centered on Philadelphia.
The actual SQL query is very fast, but we still wrap it
in a Celery job so that it is logged and recorded, and
is consistent with the other APIs.

In case no matching basins are found, the returning
feature would have a None geometry.

For details on this algorithm, please see:
https://github.com/WikiWatershed/global-hydrography/?tab=readme-ov-file#modified-nested-set-index
Base automatically changed from tt/3660/fix-rwd-in-conus to develop November 22, 2024 15:44
An error occurred while trying to automatically change base from tt/3660/fix-rwd-in-conus to develop November 22, 2024 15:44
@rajadain rajadain added the AWS Funding Source: AWS label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AWS Funding Source: AWS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS 2-8: Implement Global Watershed Delineation Back-end
2 participants