Mercurial > gemma
comparison schema/gemma.sql @ 919:271561dce2e6
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.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 04 Oct 2018 16:32:47 +0200 |
parents | 5b90217aa1bb |
children | 9e210b00ace9 48f70782400d |
comparison
equal
deleted
inserted
replaced
917:5b90217aa1bb | 919:271561dce2e6 |
---|---|
417 ) | 417 ) |
418 | 418 |
419 CREATE TABLE sounding_results_contour_lines ( | 419 CREATE TABLE sounding_results_contour_lines ( |
420 sounding_result_id int NOT NULL REFERENCES sounding_results, | 420 sounding_result_id int NOT NULL REFERENCES sounding_results, |
421 height numeric NOT NULL, | 421 height numeric NOT NULL, |
422 lines geography(multilinestringz, 4326) NOT NULL, | 422 lines geography(multilinestring, 4326) NOT NULL, |
423 UNIQUE (sounding_result_id, height) | 423 UNIQUE (sounding_result_id, height) |
424 ) | 424 ) |
425 -- A view to help geoserver serve contour lines. | 425 -- A view to help geoserver serve contour lines. |
426 -- At least geoserver-2.13.2 does not serve type geography correctly | 426 -- At least geoserver-2.13.2 does not serve type geography correctly |
427 CREATE VIEW waterway.sounding_results_contour_lines_geoserver AS | 427 CREATE VIEW waterway.sounding_results_contour_lines_geoserver AS |
428 SELECT bottleneck_id, | 428 SELECT bottleneck_id, |
429 date_info, | 429 date_info, |
430 height, | 430 height, |
431 CAST(lines AS geometry(multilinestringz, 4326)) AS lines | 431 CAST(lines AS geometry(multilinestring, 4326)) AS lines |
432 FROM waterway.sounding_results_contour_lines cl | 432 FROM waterway.sounding_results_contour_lines cl |
433 JOIN waterway.sounding_results sr | 433 JOIN waterway.sounding_results sr |
434 ON sr.id = cl.sounding_result_id | 434 ON sr.id = cl.sounding_result_id |
435 | 435 |
436 -- | 436 -- |