Skip to content

Commit

Permalink
Start multi dim
Browse files Browse the repository at this point in the history
  • Loading branch information
nf-s committed May 9, 2024
1 parent 3a39d35 commit 0ab7ee7
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/Models/Catalog/Esri/ArcGisImageServerCatalogItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ import createStratumInstance from "../../Definition/createStratumInstance";
import { RectangleCoordinates } from "../../FunctionParameters/RectangleParameter";
import getToken from "../../getToken";
import proxyCatalogItemUrl from "../proxyCatalogItemUrl";
import { ImageServer, Legends } from "./ArcGisInterfaces";
import {
ImageServer,
ImageServerMultidimensionInfo,
Legends
} from "./ArcGisInterfaces";
import { getRectangleFromLayer } from "./ArcGisMapServerCatalogItem";

class ImageServerStratum extends LoadableStratum(
Expand Down Expand Up @@ -107,6 +111,16 @@ class ImageServerStratum extends LoadableStratum(

const stratum = new ImageServerStratum(item, serviceMetadata, token);

// let multidimensionalInfoUri = getBaseURI(item).segment("multidimensionalInfo");

// multidimensionalInfoUri.addQuery(item.flattenedParameters);

// if (isDefined(item.token)) {
// multidimensionalInfoUri = multidimensionalInfoUri.addQuery("token", item.token);
// }

// const multidimensionalInfo: ImageServerMultidimensionInfo | undefined = await getJson(item, multidimensionalInfoUri);

// Add any Proj4 definitions if necessary
if (item.terria.configParameters.proj4ServiceBaseUrl) {
await Reproject.checkProjection(
Expand Down Expand Up @@ -197,6 +211,10 @@ class ImageServerStratum extends LoadableStratum(
if (this.usePreCachedTiles && this.imageServer.tileInfo?.lods)
return this.imageServer.tileInfo.lods[0].level;
}

get hasMultidimensions() {
return this.imageServer.hasMultidimensions;
}
}

StratumOrder.addLoadStratum(ImageServerStratum.stratumName);
Expand Down
30 changes: 30 additions & 0 deletions lib/Models/Catalog/Esri/ArcGisInterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { bool } from "prop-types";
import { JsonObject } from "../../../Core/Json";

interface DocumentInfo {
Expand Down Expand Up @@ -142,3 +143,32 @@ export interface ImageServerIdentifyResult {
};
catalogItemVisibilities?: number[];
}

export interface ImageServerMultidimensionInfo {
multidimensionalInfo: {
variables: [
{
name: string;
description: string;
unit: string;
dimensions: [
{
name: string;
description: string;
unit: string;
field: string;
/** the extent of dimension values, the element type depends on the dimension's field type, can be time, or double */
extent: [number, number];
/** indicates whether one dimension value has both lower and upper bounds. */
hasRanges: boolean;
/** If hasRanges=false, each element is one single value; if hasRanges=true, each element is an array of lower/upper bounds */
values: number[] | [number, number][];
hasRegularIntervals?: boolean;
interval?: number;
intervalUnit?: string;
}
];
}
];
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,11 @@ export default class ArcGisImageServerCatalogItemTraits extends mixTraits(
type: "boolean"
})
usePreCachedTiles?: boolean;

@primitiveTrait({
name: "Has Multi-dimensions",
description: "If true, then multidimensionalInfo will be fetched.",
type: "boolean"
})
hasMultidimensions?: boolean;
}

0 comments on commit 0ab7ee7

Please sign in to comment.