Skip to content

Commit

Permalink
fix source table names in cw analysis and drop only when done with them
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Jul 29, 2024
1 parent fbff15c commit 5bfd025
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions extras/channel_width/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ all: $(GENERATED_FILES)
$(PSQL) -f sql/fiss_stream_sample_sites_events.sql
# Now load the measured channel widths where we have them, averaging measurements on the same stream
$(PSQL) -f sql/channel_width_measured.sql
# drop the source tables
$(PSQL) -c "drop table fwapg.fiss_stream_sample_sites_sp"
$(PSQL) -c "drop table fwapg.pscis_assessment_svw"
touch $@

# --------
Expand Down Expand Up @@ -100,3 +97,6 @@ clean:
for table in $(GENERATED_TABLES); do \
$(PSQL) -c "DROP TABLE IF EXISTS "$$table ;\
done
# drop the source tables
$(PSQL) -c "drop table fwapg.fiss_stream_sample_sites_sp"
$(PSQL) -c "drop table fwapg.pscis_assessment_svw"
4 changes: 2 additions & 2 deletions extras/channel_width/sql/channel_width_analysis.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SELECT
p.channel_width,
(st_dump(p.geom)).geom as geom
FROM fwapg.fiss_stream_sample_sites_events_sp e
INNER JOIN whse_fish.fiss_stream_sample_sites_sp p
INNER JOIN fwapg.fiss_stream_sample_sites_sp p
ON e.stream_sample_site_id = p.stream_sample_site_id
WHERE p.channel_width IS NOT NULL
UNION ALL
Expand All @@ -67,7 +67,7 @@ SELECT
a.downstream_channel_width as channel_width,
(st_dump(e.geom)).geom as geom
FROM fwapg.pscis_crossings e
LEFT OUTER JOIN whse_fish.pscis_assessment_svw a
LEFT OUTER JOIN fwapg.pscis_assessment_svw a
ON e.stream_crossing_id = a.stream_crossing_id
WHERE a.downstream_channel_width IS NOT NULL
UNION ALL
Expand Down

0 comments on commit 5bfd025

Please sign in to comment.