# HG changeset patch # User Thomas Junk # Date 1571233236 -7200 # Node ID c4adbebaf1a6151d3d44018061473c886c59e879 # Parent cad2b264542e51ea211afdb137597fadc8b65a07# Parent 65a67b3492fd7f856fac2d2399e62af2ecc93cd9 merge diff -r cad2b264542e -r c4adbebaf1a6 client/src/components/identify/formatter.js --- a/client/src/components/identify/formatter.js Wed Oct 16 15:40:27 2019 +0200 +++ b/client/src/components/identify/formatter.js Wed Oct 16 15:40:36 2019 +0200 @@ -1,5 +1,6 @@ import Feature from "ol/Feature"; import app from "@/main"; +import filters from "@/lib/filters"; const formatter = { all(p) { @@ -13,7 +14,7 @@ p.key === "gm_measuredate") && p.val !== null ) { - p.val = new Date(p.val).toLocaleString(); + p.val = filters.dateTime(p.val); } // remove certain props @@ -113,6 +114,16 @@ return p; } + }, + sounding_results_areas_geoserver: { + label: app.$gettext("Sounding results"), + props: p => { + let propsToRemove = ["height"]; + if (propsToRemove.indexOf(p.key) !== -1) return null; + if (p.key === "surtyp") p.key = app.$gettext("Survey type"); + if (p.key === "bottleneck_id") p.key = app.$gettext("Bottleneck"); + return p; + } } }; diff -r cad2b264542e -r c4adbebaf1a6 client/src/store/map.js --- a/client/src/store/map.js Wed Oct 16 15:40:27 2019 +0200 +++ b/client/src/store/map.js Wed Oct 16 15:40:36 2019 +0200 @@ -523,6 +523,32 @@ commit("addIdentifiedFeatures", features); }); } + var srSource = map.getLayer("BOTTLENECKISOLINE").getSource(); + var srUrl = srSource.getGetFeatureInfoUrl( + event.coordinate, + currentResolution /* resolution */, + "EPSG:3857", + // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d + { INFO_FORMAT: "application/json" } + ); + + if (srUrl) { + HTTP.get(srUrl + "&BUFFER=5", { + headers: { + "X-Gemma-Auth": localStorage.getItem("token") + } + }).then(response => { + let features = response.data.features.map(f => { + let feat = new Feature({ + geometry: new Point(f.geometry.coordinates) + }); + feat.setId(f.id); + feat.setProperties(f.properties); + return feat; + }); + commit("addIdentifiedFeatures", features); + }); + } }); }, refreshLayers({ state }) { diff -r cad2b264542e -r c4adbebaf1a6 pkg/controllers/diff.go --- a/pkg/controllers/diff.go Wed Oct 16 15:40:27 2019 +0200 +++ b/pkg/controllers/diff.go Wed Oct 16 15:40:36 2019 +0200 @@ -85,10 +85,13 @@ ST_Transform( ST_Multi( ST_CollectionExtract( - ST_SimplifyPreserveTopology( - ST_Multi(ST_Collectionextract( - ST_MakeValid(ST_GeomFromWKB($4, $3::integer)), 3)), - $5 + ST_MakeValid( + ST_Multi( + ST_Collectionextract( + ST_SimplifyPreserveTopology(ST_GeomFromWKB($4, $3::integer), $5), + 3 + ) + ) ), 3 ) diff -r cad2b264542e -r c4adbebaf1a6 pkg/imports/sr.go --- a/pkg/imports/sr.go Wed Oct 16 15:40:27 2019 +0200 +++ b/pkg/imports/sr.go Wed Oct 16 15:40:36 2019 +0200 @@ -175,10 +175,13 @@ ST_Transform( ST_Multi( ST_CollectionExtract( - ST_SimplifyPreserveTopology( - ST_Multi(ST_Collectionextract( - ST_MakeValid(ST_GeomFromWKB($4, $3::integer)), 3)), - $5 + ST_MakeValid( + ST_Multi( + ST_Collectionextract( + ST_SimplifyPreserveTopology(ST_GeomFromWKB($4, $3::integer), $5), + 3 + ) + ) ), 3 ) diff -r cad2b264542e -r c4adbebaf1a6 pkg/octree/classbreaks.go --- a/pkg/octree/classbreaks.go Wed Oct 16 15:40:27 2019 +0200 +++ b/pkg/octree/classbreaks.go Wed Oct 16 15:40:36 2019 +0200 @@ -103,14 +103,6 @@ min, max = max, min } - if len(cbs) < 2 { - return cbs - } - - if min >= cbs[0] && max <= cbs[len(cbs)-1] { - return cbs - } - n := make([]float64, len(cbs)) copy(n, cbs) sort.Float64s(n) diff -r cad2b264542e -r c4adbebaf1a6 schema/default_sysconfig.sql --- a/schema/default_sysconfig.sql Wed Oct 16 15:40:27 2019 +0200 +++ b/schema/default_sysconfig.sql Wed Oct 16 15:40:36 2019 +0200 @@ -190,7 +190,8 @@ SELECT bottleneck_id, date_info, height, - areas + areas, + surtyp FROM waterway.sounding_results_iso_areas ia JOIN waterway.sounding_results sr ON sr.id = ia.sounding_result_id $$), diff -r cad2b264542e -r c4adbebaf1a6 schema/updates/1305/01.update_sr_geoserv.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/updates/1305/01.update_sr_geoserv.sql Wed Oct 16 15:40:36 2019 +0200 @@ -0,0 +1,9 @@ +UPDATE sys_admin.published_services SET view_def = $$ + SELECT bottleneck_id, + date_info, + height, + areas, + surtyp + FROM waterway.sounding_results_iso_areas ia + JOIN waterway.sounding_results sr ON sr.id = ia.sounding_result_id + $$ WHERE name = 'sounding_results_areas_geoserver'; \ No newline at end of file diff -r cad2b264542e -r c4adbebaf1a6 schema/version.sql --- a/schema/version.sql Wed Oct 16 15:40:27 2019 +0200 +++ b/schema/version.sql Wed Oct 16 15:40:36 2019 +0200 @@ -1,1 +1,1 @@ -INSERT INTO gemma_schema_version(version) VALUES (1304); +INSERT INTO gemma_schema_version(version) VALUES (1305); diff -r cad2b264542e -r c4adbebaf1a6 style-templates/sounding_differences.sld-template --- a/style-templates/sounding_differences.sld-template Wed Oct 16 15:40:27 2019 +0200 +++ b/style-templates/sounding_differences.sld-template Wed Oct 16 15:40:36 2019 +0200 @@ -121,24 +121,15 @@ 0.000000 height - 1.0000001 - 1.5000001.5 - 1.7000001.7 - 1.9000001.9 - 2.1000002.1 - 2.3000002.3 - 2.5000002.5 - 2.7000002.7 - 2.9000002.9 - 3.1000003.1 - 3.3000003.3 - 3.5000003.5 - 4.0000004 - 4.5000004.5 - 5.0000005 - 5.5000005.5 - 6.0000006 - 7.0000007 + {{ range . -}} + {{ if .HasHigh -}} + + {{- printf "%f" .High -}} + + {{- printf "%g" .High -}} + + {{ end -}} + {{ end }} @@ -168,24 +159,15 @@ 0.000000 height - 1.0000001 - 1.5000001.5 - 1.7000001.7 - 1.9000001.9 - 2.1000002.1 - 2.3000002.3 - 2.5000002.5 - 2.7000002.7 - 2.9000002.9 - 3.1000003.1 - 3.3000003.3 - 3.5000003.5 - 4.0000004 - 4.5000004.5 - 5.0000005 - 5.5000005.5 - 6.0000006 - 7.0000007 + {{ range . -}} + {{ if .HasHigh -}} + + {{- printf "%f" .High -}} + + {{- printf "%g" .High -}} + + {{ end -}} + {{ end }} diff -r cad2b264542e -r c4adbebaf1a6 style-templates/sounding_results_areas_geoserver.sld-template --- a/style-templates/sounding_results_areas_geoserver.sld-template Wed Oct 16 15:40:27 2019 +0200 +++ b/style-templates/sounding_results_areas_geoserver.sld-template Wed Oct 16 15:40:36 2019 +0200 @@ -121,24 +121,15 @@ 0.000000 height - 1.0000001 - 1.5000001.5 - 1.7000001.7 - 1.9000001.9 - 2.1000002.1 - 2.3000002.3 - 2.5000002.5 - 2.7000002.7 - 2.9000002.9 - 3.1000003.1 - 3.3000003.3 - 3.5000003.5 - 4.0000004 - 4.5000004.5 - 5.0000005 - 5.5000005.5 - 6.0000006 - 7.0000007 + {{ range . -}} + {{ if .HasHigh -}} + + {{- printf "%f" .High -}} + + {{- printf "%g" .High -}} + + {{ end -}} + {{ end }} @@ -168,24 +159,15 @@ 0.000000 height - 1.0000001 - 1.5000001.5 - 1.7000001.7 - 1.9000001.9 - 2.1000002.1 - 2.3000002.3 - 2.5000002.5 - 2.7000002.7 - 2.9000002.9 - 3.1000003.1 - 3.3000003.3 - 3.5000003.5 - 4.0000004 - 4.5000004.5 - 5.0000005 - 5.5000005.5 - 6.0000006 - 7.0000007 + {{ range . -}} + {{ if .HasHigh -}} + + {{- printf "%f" .High -}} + + {{- printf "%g" .High -}} + + {{ end -}} + {{ end }}