Mercurial > gemma
comparison pkg/imports/sr.go @ 5585:7e8830c808ba surveysperbottleneckid
Fixed SR import for use of Bottleneck_Id instead of bottlenecks objnam.
author | Sascha Wilde <wilde@sha-bang.de> |
---|---|
date | Fri, 01 Apr 2022 18:51:23 +0200 |
parents | aaa9e658cabd |
children | bbc257dd9abf |
comparison
equal
deleted
inserted
replaced
5584:7ed9e32706d0 | 5585:7e8830c808ba |
---|---|
143 date_info, | 143 date_info, |
144 depth_reference, | 144 depth_reference, |
145 area, | 145 area, |
146 surtyp, | 146 surtyp, |
147 zpg_exception | 147 zpg_exception |
148 ) SELECT | 148 ) VALUES ( |
149 bottleneck_id, | 149 $1, |
150 $2::date, | 150 $2::date, |
151 $3, | 151 $3, |
152 (SELECT | 152 (SELECT |
153 CASE WHEN $5::bytea IS NULL THEN | 153 CASE WHEN $5::bytea IS NULL THEN |
154 ST_Transform(ST_ConcaveHull(ST_Force2D(ST_GeomFromWKB($4, $6::integer)), 0.7), 4326)::geography | 154 ST_Transform(ST_ConcaveHull(ST_Force2D(ST_GeomFromWKB($4, $6::integer)), 0.7), 4326)::geography |
155 ELSE | 155 ELSE |
156 ST_MakeValid(ST_Transform(ST_GeomFromWKB($5, $6::integer), 4326))::geography | 156 ST_MakeValid(ST_Transform(ST_GeomFromWKB($5, $6::integer), 4326))::geography |
157 END), | 157 END), |
158 $7, | 158 $7, |
159 $8 | 159 $8 |
160 FROM waterway.bottlenecks | 160 ) |
161 WHERE objnam = $1 AND validity @> CAST($2 AS timestamptz) | |
162 RETURNING | 161 RETURNING |
163 id, | 162 id, |
164 ST_X(ST_Centroid(area::geometry)), | 163 ST_X(ST_Centroid(area::geometry)), |
165 ST_Y(ST_Centroid(area::geometry)), | 164 ST_Y(ST_Centroid(area::geometry)), |
166 best_utm(area), | 165 best_utm(area), |
224 grwl.depth_reference | 223 grwl.depth_reference |
225 FROM waterway.gauges_reference_water_levels grwl | 224 FROM waterway.gauges_reference_water_levels grwl |
226 JOIN waterway.bottlenecks bns | 225 JOIN waterway.bottlenecks bns |
227 ON grwl.location = bns.gauge_location | 226 ON grwl.location = bns.gauge_location |
228 AND grwl.validity @> CAST($2 AS timestamptz) | 227 AND grwl.validity @> CAST($2 AS timestamptz) |
229 WHERE bns.objnam = $1 | 228 WHERE bns.bottleneck_id = $1 |
230 AND bns.validity @> CAST($2 AS timestamptz) | 229 AND bns.validity @> CAST($2 AS timestamptz) |
231 AND grwl.depth_reference like 'LDC%' | 230 AND grwl.depth_reference like 'LDC%' |
232 ` | 231 ` |
233 | 232 |
234 selectZPGExceptionAllowedSQL = ` | 233 selectZPGExceptionAllowedSQL = ` |