# HG changeset patch # User Tom Gottfried # Date 1583517060 -3600 # Node ID 52c88c7c00eca7c5b84511150193345557c7610c # Parent 5aaeb1ba7e216816be6a770b83e25d8c4d1deb5f# Parent 9e210879bd884d56c7857d0ec966033a4aabb999 Merge default into wmst-config branch diff -r 9e210879bd88 -r 52c88c7c00ec pkg/geoserver/boot.go --- a/pkg/geoserver/boot.go Fri Mar 06 18:41:30 2020 +0100 +++ b/pkg/geoserver/boot.go Fri Mar 06 18:51:00 2020 +0100 @@ -327,23 +327,23 @@ entries = append(entries, entry) } - /* XXX: Experimental - if table == "sounding_differences" { + if attr := tables[i].WMSTAttribute; attr != nil { di := map[string]interface{}{ "enabled": true, - "attribute": "minuend", - "endAttribute": "subtrahend", + "attribute": *attr, "presentation": "CONTINUOUS_INTERVAL", "units": "ISO8601", "nearestMatchEnabled": false, } + if endAttr := tables[i].WMSTEndAttribute; endAttr != nil { + di["endAttribute"] = *endAttr + } entry := map[string]interface{}{ "@key": "time", "dimensionInfo": di, } entries = append(entries, entry) } - */ if len(entries) > 0 { ft["metadata"] = map[string]interface{}{ diff -r 9e210879bd88 -r 52c88c7c00ec pkg/models/intservices.go --- a/pkg/models/intservices.go Fri Mar 06 18:41:30 2020 +0100 +++ b/pkg/models/intservices.go Fri Mar 06 18:51:00 2020 +0100 @@ -29,14 +29,16 @@ type ( IntEntry struct { - Schema string `json:"schema"` - Name string `json:"name"` - SQL *string `json:"sql"` - KeyColumn *string `json:"keycolumn"` - SRS *string `json:"srs"` - Style bool `json:"style"` - WMS bool `json:"wms"` - WFS bool `json:"wfs"` + Schema string `json:"schema"` + Name string `json:"name"` + SQL *string `json:"sql"` + KeyColumn *string `json:"keycolumn"` + SRS *string `json:"srs"` + Style bool `json:"style"` + WMS bool `json:"wms"` + WFS bool `json:"wfs"` + WMSTAttribute *string `json:"wmst-attribute"` + WMSTEndAttribute *string `json:"wmst-end-attribute"` } LayerGroup struct { @@ -53,9 +55,17 @@ const ( selectServicesSQL = ` -SELECT schema, name, - view_def, key_column, auth_name || ':' || auth_srid, - style IS NOT NULL, as_wms, as_wfs +SELECT + schema, + name, + view_def, + key_column, + auth_name || ':' || auth_srid, + style IS NOT NULL, + as_wms, + as_wfs, + wmst_attribute, + wmst_end_attribute FROM sys_admin.published_services LEFT JOIN spatial_ref_sys USING (srid) WHERE schema = $1 @@ -181,6 +191,7 @@ &entry.Schema, &entry.Name, &entry.SQL, &entry.KeyColumn, &entry.SRS, &entry.Style, &entry.WMS, &entry.WFS, + &entry.WMSTAttribute, &entry.WMSTEndAttribute, ); err != nil { return err } diff -r 9e210879bd88 -r 52c88c7c00ec schema/gemma.sql --- a/schema/gemma.sql Fri Mar 06 18:41:30 2020 +0100 +++ b/schema/gemma.sql Fri Mar 06 18:51:00 2020 +0100 @@ -409,6 +409,8 @@ style bytea, as_wms boolean NOT NULL DEFAULT TRUE, as_wfs boolean NOT NULL DEFAULT TRUE, + wmst_attribute varchar DEFAULT NULL, + wmst_end_attribute varchar DEFAULT NULL, -- Either give a valid relation or a SQL statement: CHECK (to_regclass(schema || '.' || name) IS NOT NULL OR view_def IS NOT NULL) diff -r 9e210879bd88 -r 52c88c7c00ec schema/updates/1420/01.wmst_attributes.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/updates/1420/01.wmst_attributes.sql Fri Mar 06 18:51:00 2020 +0100 @@ -0,0 +1,2 @@ +ALTER TABLE sys_admin.published_services ADD COLUMN wmst_attribute varchar DEFAULT NULL; +ALTER TABLE sys_admin.published_services ADD COLUMN wmst_end_attribute varchar DEFAULT NULL; diff -r 9e210879bd88 -r 52c88c7c00ec schema/version.sql --- a/schema/version.sql Fri Mar 06 18:41:30 2020 +0100 +++ b/schema/version.sql Fri Mar 06 18:51:00 2020 +0100 @@ -1,1 +1,1 @@ -INSERT INTO gemma_schema_version(version) VALUES (1410); +INSERT INTO gemma_schema_version(version) VALUES (1420);