This interface defines the minimum properties that a compatible resource must have, in case you'd like to create your own CogResource alternative.

interface Resource {
    clamp: [number, number];
    maxZoom: number;
    noData: number;
    rectangle: Rectangle;
    tileSize: number;
    getPixelData(tileRect: Rectangle): Promise<TypedArray>;
    getRectangleDataAvailable(tileRect: Rectangle): boolean;
}

Implemented by

Properties

clamp: [number, number]

Clamp elevation values to within [low, high] bounds

maxZoom: number

Maximum zoom level of requestable tiles

noData: number

Value in TIFF pixel to be reinterpreted as 0 elevation

rectangle: Rectangle

Bounding edges of file data, in Geographic radians

tileSize: number

Grid edge lengths to resample GeoTIFFImage.readRasters(); Must be 2^k + 1

Methods

  • The main interface for actually requesting data from the resource. Uses a Cesium.Rectangle since tile coordinates {x, y, z} are not consistant across CRS

    Parameters

    • tileRect: Rectangle

      Cesium.Rectangle for tile that is requesting Terrain geometry

    Returns Promise<TypedArray>

    TypedArray containing pixel data.

  • Used to check if a resource intersects with a given tile Rectangle

    Parameters

    • tileRect: Rectangle

      Cesium.Rectangle that corresponds with a tile requesting geometry

    Returns boolean

    true if tileRect intersects with the data, false if not