generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR applies various fixes that were underlying the issues discussed in ticket #594. Basically, there were some shortcomings in the RnR processing SQL files that were either leaving sites out or wrongly categorizing them. These issues have been fixed.
- Loading branch information
1 parent
4fc0d5c
commit 2b033b8
Showing
3 changed files
with
78 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
...z_functions/viz_db_postprocess_sql/summaries/rfc_based_5day_max_streamflow/rfc_points.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
DROP TABLE IF EXISTS publish.rfc_based_5day_max_streamflow_rfc_points; | ||
SELECT DISTINCT ON (ahps.nws_lid) | ||
ahps.nws_lid, | ||
usgs_sitecode, | ||
nws_name, | ||
|
||
SELECT DISTINCT ON (main.nws_station_id) | ||
main.nws_station_id as nws_lid, | ||
main.gage_id as usgs_sitecode, | ||
station.name as nws_name, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
ST_TRANSFORM(ST_SetSRID(ST_MakePoint(longitude, latitude),4326),3857) as geom | ||
ST_TRANSFORM(station.geo_point, 3857) as geom | ||
INTO publish.rfc_based_5day_max_streamflow_rfc_points | ||
FROM ingest.ahps_metadata ahps | ||
INNER JOIN publish.rfc_based_5day_max_streamflow rfc ON ahps.nws_lid = rfc.nws_station_id | ||
FROM rnr.domain_crosswalk as main | ||
LEFT JOIN external.nws_station as station on station.nws_station_id = main.nws_station_id | ||
WHERE main.nws_station_id IS NOT NULL; |