# HG changeset patch # User Tom Gottfried # Date 1538663567 -7200 # Node ID 271561dce2e6d6efc8c084c191c84828d5b14216 # Parent 5b90217aa1bbc4b8661a06112f0a1ace220aba5c Store contour lines in 2D We have the height as an attribute value and use the lines only for display on a map. There's no need to store height with every vertex additionally. diff -r 5b90217aa1bb -r 271561dce2e6 cmd/octree2contour/store.go --- a/cmd/octree2contour/store.go Thu Oct 04 12:45:25 2018 +0200 +++ b/cmd/octree2contour/store.go Thu Oct 04 16:32:47 2018 +0200 @@ -26,15 +26,17 @@ sr.id, $1, ST_Transform( - ST_Translate( - ST_Force3D( - ST_CollectionExtract( - ST_Force2D( - ST_Intersection( - ST_Transform(sr.area::geometry, $3::integer), - ST_SetSRID( - ST_GeomFromWKB($2), $3::integer))), 2)), 0.0, 0.0, $1::numeric), - 4326)::geography + ST_CollectionExtract( + ST_Force2D( + ST_Intersection( + ST_Transform(sr.area::geometry, $3::integer), + ST_GeomFromWKB($2, $3::integer) + ) + ), + 2 + ), + 4326 + ) FROM waterway.sounding_results sr WHERE bottleneck_id = $4 AND date_info = $5 ` diff -r 5b90217aa1bb -r 271561dce2e6 schema/gemma.sql --- a/schema/gemma.sql Thu Oct 04 12:45:25 2018 +0200 +++ b/schema/gemma.sql Thu Oct 04 16:32:47 2018 +0200 @@ -419,7 +419,7 @@ CREATE TABLE sounding_results_contour_lines ( sounding_result_id int NOT NULL REFERENCES sounding_results, height numeric NOT NULL, - lines geography(multilinestringz, 4326) NOT NULL, + lines geography(multilinestring, 4326) NOT NULL, UNIQUE (sounding_result_id, height) ) -- A view to help geoserver serve contour lines. @@ -428,7 +428,7 @@ SELECT bottleneck_id, date_info, height, - CAST(lines AS geometry(multilinestringz, 4326)) AS lines + CAST(lines AS geometry(multilinestring, 4326)) AS lines FROM waterway.sounding_results_contour_lines cl JOIN waterway.sounding_results sr ON sr.id = cl.sounding_result_id