# HG changeset patch # User Sascha L. Teichmann # Date 1583491691 -3600 # Node ID 4a816ecf70deaee6de63f16acb13c8f730299072 # Parent 6a48e5c6fe2f2f146b49aab3ce1997f7dea190c0 Added support for WMS-Time in configuring the GeoServer. diff -r 6a48e5c6fe2f -r 4a816ecf70de pkg/geoserver/boot.go --- a/pkg/geoserver/boot.go Fri Mar 06 11:06:27 2020 +0100 +++ b/pkg/geoserver/boot.go Fri Mar 06 11:48:11 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 6a48e5c6fe2f -r 4a816ecf70de pkg/models/intservices.go --- a/pkg/models/intservices.go Fri Mar 06 11:06:27 2020 +0100 +++ b/pkg/models/intservices.go Fri Mar 06 11:48:11 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 6a48e5c6fe2f -r 4a816ecf70de schema/gemma.sql --- a/schema/gemma.sql Fri Mar 06 11:06:27 2020 +0100 +++ b/schema/gemma.sql Fri Mar 06 11:48:11 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 6a48e5c6fe2f -r 4a816ecf70de schema/updates/1410/01.wmst_attributes.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/updates/1410/01.wmst_attributes.sql Fri Mar 06 11:48:11 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 6a48e5c6fe2f -r 4a816ecf70de schema/version.sql --- a/schema/version.sql Fri Mar 06 11:06:27 2020 +0100 +++ b/schema/version.sql Fri Mar 06 11:48:11 2020 +0100 @@ -1,1 +1,1 @@ -INSERT INTO gemma_schema_version(version) VALUES (1409); +INSERT INTO gemma_schema_version(version) VALUES (1410);