Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/geosync/rest_api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,22 @@
[:name store]
[:nativeName store]
[:title store]
;; Declaring the band is what makes ncWMS GetTimeSeries usable: it reads the
;; band list to return a whole time series at a point in one request rather
;; than one request per timestep. Without it the operation fails with an
;; empty property list. GeoServer never fills the bands in itself here
;; because the store is created with configure=none.
;;
;; Single band, because every forecast raster PyreCast publishes is
;; single-band, and that is what the plain GeoTIFF path derives on its own.
;; A multi-band mosaic would need the real band list read off the reader.
[:dimensions
[:coverageDimension
[:name "GRAY_INDEX"]
[:description "GridSampleDimension[-Infinity,Infinity]"]
[:range
[:min "-inf"]
[:max "inf"]]]]
[:metadata
[:entry {:key "time"}
[:dimensionInfo
Expand Down
18 changes: 16 additions & 2 deletions test/geosync/core_test.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(ns geosync.core-test
(:require [clojure.test :refer [deftest is testing]]
[geosync.core :as core]))
(:require
[clojure.test :refer [deftest is testing]]
[geosync.core :as core]
[geosync.rest-api :as rest]))

(defn geosync-conf
([]
Expand Down Expand Up @@ -61,3 +63,15 @@
(testing "returns one spec if styles already exists and overwrite-styles is false"
(is (= (count (core/file-paths->style-specs (geosync-conf {:overwrite-styles true}) #{"my-workspace:test-style"} ["test/data/test-style.css"]))
1))))

(deftest create-coverage-image-mosaic-declares-its-band-test
(let [[method uri body] (rest/create-coverage-image-mosaic "my-workspace" "ws")]
(testing "posts to the store's coverages endpoint"
(is (= "POST" method))
(is (= "/workspaces/my-workspace/coveragestores/ws/coverages" uri)))
(testing "declares a band, without which ncWMS GetTimeSeries fails"
(is (re-find #"<dimensions>" body))
(is (re-find #"<name>GRAY_INDEX</name>" body)))
(testing "still enables the time dimension"
(is (re-find #"<entry key=\"time\">" body))
(is (re-find #"<units>ISO8601</units>" body)))))