Skip to content

Commit

Permalink
Merge pull request #27 from Deltares/DWO-694-Report-TimeSeriesTypeInG…
Browse files Browse the repository at this point in the history
…etCapabilities

timeseries type added to get capabilities keywords list.
  • Loading branch information
ekkelenkamp authored Jun 12, 2024
2 parents d886f99 + 6a291d3 commit b3bedad
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/response/getCapabilitiesResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ export interface Layer {
fadeAmount?: number;
particleColor?: string;
speedFactor?: number;
speedExponent?: number;
coloredParticles?: boolean;
};
/**
* workflow with its properties.
*/
workflow?: {
workflowId?: string;
properties?: WorkflowProperties[];
};
}
export interface Keyword {
parameterId?: string;
Expand All @@ -74,6 +82,10 @@ export interface Keyword {
ensembleId?: string;
ensembleMemberId?: string;
forecastTime?: string;
/**
* Timeseries Type. SCALAR: Single value, SCALAR_MAP: Map of values (e.g. spectrum), COVERAGE: Grid of values, RATING_CURVE: Rating curve, TEXT: Text
*/
type?: "SCALAR" | "SCALAR_MAP" | "COVERAGE" | "RATING_CURVE" | "TEXT";
}
export interface Ensemble {
ensembleId: string;
Expand All @@ -93,6 +105,13 @@ export interface Style {
name?: string;
title: string;
}
export interface WorkflowProperties {
type: "string" | "float" | "bool" | "double" | "int" | "dateTime";
key: string;
value?: string;
date?: string;
time?: string;
}
export interface LayerGroup {
name: string;
title: string;
Expand Down
1 change: 1 addition & 0 deletions src/response/getLegendGraphicResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface ColourMapEntry {
label?: string;
lowerValue: number;
color: string;
colorSmoothing?: boolean;
}
3 changes: 2 additions & 1 deletion test/unit/mock/getCapabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"locationId" : "giss_e2_h_grid",
"moduleInstanceId" : "ImportForecastGissE2HHistoricalNatGrid",
"timeSeriesType" : "EXTERNAL_FORECASTING",
"forecastTime" : "1850-01-16T12:00:00Z"
"forecastTime" : "1850-01-16T12:00:00Z",
"type": "COVERAGE"
} ],
"timesDefault" : "1850-12-16T12:00:00Z",
"times" : [ "1850-01-16T12:00:00Z", "1850-02-15T00:00:00Z", "1850-03-16T12:00:00Z", "1850-04-16T00:00:00Z", "1850-05-16T12:00:00Z", "1850-06-16T00:00:00Z", "1850-07-16T12:00:00Z", "1850-08-16T12:00:00Z", "1850-09-16T00:00:00Z", "1850-10-16T12:00:00Z", "1850-11-16T00:00:00Z", "1850-12-16T12:00:00Z" ],
Expand Down
3 changes: 3 additions & 0 deletions test/unit/wmsProvider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ describe("WMS Provider Tests", function () {
expect(res.layers[0]?.timesDefault).toBe("1850-12-16T12:00:00Z");
expect(res.layers[0]?.groupName).toBe("Goddard NASA Monthly Historical Grids");
expect(res.layers[0]?.name).toBe("giss_e2_h_grid_monthly_historical_nat");
if (res.layers[0].keywordList && res.layers[0].keywordList.length > 0) {
expect(res.layers[0].keywordList[0]["type"]).toBe("COVERAGE");
}
});

it("GetCapabilitiesWithToken", async function () {
Expand Down

0 comments on commit b3bedad

Please sign in to comment.