comparison cmd/octree2contour/store.go @ 742:fb9faf2c4f60

Clip contour lines against bounding area of sounding result.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 24 Sep 2018 13:14:49 +0200
parents 34ea9d5df653
children 271561dce2e6
comparison
equal deleted inserted replaced
741:8bb2e48e2dfd 742:fb9faf2c4f60
21 ` 21 `
22 insertSQL = ` 22 insertSQL = `
23 INSERT INTO waterway.sounding_results_contour_lines 23 INSERT INTO waterway.sounding_results_contour_lines
24 (sounding_result_id, height, lines) 24 (sounding_result_id, height, lines)
25 SELECT 25 SELECT
26 id, 26 sr.id,
27 $1, 27 $1,
28 ST_Transform(ST_SetSRID(ST_GeomFromWKB($2), $3), 4326)::geography 28 ST_Transform(
29 FROM waterway.sounding_results 29 ST_Translate(
30 ST_Force3D(
31 ST_CollectionExtract(
32 ST_Force2D(
33 ST_Intersection(
34 ST_Transform(sr.area::geometry, $3::integer),
35 ST_SetSRID(
36 ST_GeomFromWKB($2), $3::integer))), 2)), 0.0, 0.0, $1::numeric),
37 4326)::geography
38 FROM waterway.sounding_results sr
30 WHERE bottleneck_id = $4 AND date_info = $5 39 WHERE bottleneck_id = $4 AND date_info = $5
31 ` 40 `
32 ) 41 )
33 42
34 func store( 43 func store(