smnorris / fwapg

PostgreSQL tools for working with British Columbia's Freshwater Atlas
https://smnorris.github.io/fwapg
MIT License
9 stars 5 forks source link

FWA_WatershedAtMeasure fails on Spillimacheen River #31

Open smnorris opened 3 years ago

smnorris commented 3 years ago
SELECT * FROM FWA_WatershedAtMeasure(356570193, 4999.9999);
ERROR:  more than one row returned by a subquery used as an expression
CONTEXT:  PL/pgSQL function fwa_watershedatmeasure(integer,double precision) line 26 at RETURN QUERY
smnorris commented 3 years ago

Likely due to the complexity of the watershed polygon on the north bank of the river at this location - and note that the local code of this watershed is invalid. Because it may just be a data issue, I've worked around (in bcbasins) by shifting the location of interest upstream slightly to avoid the problematic watershed polygon.