Mercurial > gemma
comparison pkg/imports/wp.go @ 2087:5d3d2e823314
Waterway profiles: Do a little buffeing around the point to be more tolerant when finding the right line string.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 01 Feb 2019 10:56:29 +0100 |
parents | 6096ec4951f8 |
children | 3f32b18bbd4c |
comparison
equal
deleted
inserted
replaced
2086:6096ec4951f8 | 2087:5d3d2e823314 |
---|---|
90 ST_Transform(ST_GeomFromWKB($1, $2::int), %d) | 90 ST_Transform(ST_GeomFromWKB($1, $2::int), %d) |
91 )` | 91 )` |
92 | 92 |
93 insertWaterwayProfileSQL = ` | 93 insertWaterwayProfileSQL = ` |
94 WITH point AS ( | 94 WITH point AS ( |
95 SELECT ST_Transform(geom::geometry, $14::int) geom | 95 SELECT ST_Buffer(ST_Transform(geom::geometry, $14::int), 0.001) geom |
96 FROM waterway.distance_marks_virtual | 96 FROM waterway.distance_marks_virtual |
97 WHERE location_code = | 97 WHERE location_code = |
98 ($1::char(2), $2::char(3), $3::char(5), $4::char(5), $5::int) | 98 ($1::char(2), $2::char(3), $3::char(5), $4::char(5), $5::int) |
99 ) | 99 ) |
100 INSERT INTO waterway.waterway_profiles ( | 100 INSERT INTO waterway.waterway_profiles ( |
101 location, | 101 location, |
102 geom, | 102 geom, |
103 validity, | 103 validity, |
111 ) VALUES ( | 111 ) VALUES ( |
112 ($1, $2, $3, $4, $5), | 112 ($1, $2, $3, $4, $5), |
113 ( SELECT ST_Transform(geom, 4326)::geography | 113 ( SELECT ST_Transform(geom, 4326)::geography |
114 FROM wp_geoms | 114 FROM wp_geoms |
115 WHERE geom && ( SELECT geom from point ) AND | 115 WHERE geom && ( SELECT geom from point ) AND |
116 ST_Intersects(geom, ( SELECT geom FROM point )) | 116 ST_Intersects(geom, ( SELECT geom FROM point )) |
117 LIMIT 1 | |
117 ), | 118 ), |
118 $6, | 119 $6, |
119 $7, | 120 $7, |
120 $8, | 121 $8, |
121 $9, | 122 $9, |