WikiWatershed / model-my-watershed

The web application front end for Model My Watershed.
https://modelmywatershed.org
Apache License 2.0
57 stars 31 forks source link

AWS 2-8: Implement Global Watershed Delineation Back-end #3658

Open rajadain opened 1 week ago

rajadain commented 1 week ago

Add Django URLs, Views, Tasks, Serialization, Validation, for Global Watershed Delineation.

Use this query, which on average runs in ~350ms:

WITH target AS (SELECT *
FROM tdxbasins
WHERE ST_Intersects(
    geom,
    ST_SetSRID(ST_Point(-75.76742706298828, 39.67185812402583), 4326)
))

SELECT ST_Union(geom)
FROM tdxbasins
WHERE root_id = (SELECT root_id FROM target)
  AND discover_time <= (SELECT discover_time FROM target)
  AND finish_time >= (SELECT finish_time FROM target);