JAXA Earth API for JavaScript
    Preparing search index...

    Class ImageGenerator

    Creates an image using WMS (Web Map Service) style parameters. Use this when integrating with a map API such as ImageCanvas of OpenLayers.

    Index

    Constructors

    • Parameters

      • __namedParameters: {
            collectionUrl: string;
            date?: Date;
            band?: string;
            resampling?: Resampling;
            colorMapObject?: ColorMapObject;
        }
        • collectionUrl: string

          The URL of the dataset's collection.json.

        • Optionaldate?: Date

          The date and time of the data to retrieve. If omitted, it behaves as if the current date and time new Date() was specified.

        • Optionalband?: string

          The band of the dataset to use. If omitted, the first band included in the dataset (the first one in the order defined in collection.json) is used.

        • Optionalresampling?: Resampling

          The resampling method to use. If omitted, it behaves as if nearest neighbor (je.Resampling.NEAREST) was specified.

        • OptionalcolorMapObject?: ColorMapObject

          The color map conditions for visualization. If omitted, it behaves as if {min: 0, max: 255, colors: ["000000", "ffffff"]} was specified. For color images or classification-type data (data where photometricInterpretation == 1 is not true), it is ignored and the colors originally specified in each data take precedence. To avoid issues when sending and receiving rendering conditions between threads, such as with web workers, ColorMapObject is used instead of ColorMap.

      Returns ImageGenerator

    Methods

    • Initializes the instance. Execution is required.

      Returns Promise<void>

    • Retrieves the image as an HTMLCanvasElement.

      Parameters

      • width: number

        The width of the image (number of pixels).

      • height: number

        The height of the image (number of pixels).

      • extent: Bbox

        The Bbox indicating the geographic range to display. When the projection projection is EPSG:4326, it is specified in latitude and longitude, but when it is EPSG:3857, it is specified in units of meters. Note that this depends on the rules of the WMS parameters.

      • projection: Projection

        The projection to use.

      • callback: (progress: number, canvas: HTMLCanvasElement, dataObject: DataObject) => void

        A callback function that is executed each time data is loaded. You can retrieve the progress rate (0 to 100) and the image during loading.

      • abortSignal: AbortSignal

      Returns Promise<HTMLCanvasElement>

      Available only on the browser's main thread.

    • Retrieves the image as an OffscreenCanvas.

      Parameters

      • width: number

        The width of the image (number of pixels).

      • height: number

        The height of the image (number of pixels).

      • extent: Bbox

        The Bbox indicating the geographic range to display. When the projection projection is EPSG:4326, it is specified in latitude and longitude, but when it is EPSG:3857, it is specified in units of meters. Note that this depends on the rules of the WMS parameters.

      • projection: Projection

        The projection to use.

      • callback: (
            progress: number,
            offscreenCanvas: OffscreenCanvas,
            dataObject: DataObject,
        ) => void

        A callback function that is executed each time data is loaded. You can retrieve the progress rate (0 to 100) and the image during loading.

      • abortSignal: AbortSignal

      Returns Promise<OffscreenCanvas>

      Available only on the browser's main thread or in a web worker.

    • Retrieves the image as a Uint8Array of a PNG image.

      Parameters

      • width: number

        The width of the image (number of pixels).

      • height: number

        The height of the image (number of pixels).

      • extent: Bbox

        The Bbox indicating the geographic range to display. When the projection projection is EPSG:4326, it is specified in latitude and longitude, but when it is EPSG:3857, it is specified in units of meters. Note that this depends on the rules of the WMS parameters.

      • projection: Projection

        The projection to use.

      • callback: (progress: number, pngUint8Array: Uint8Array, dataObject: DataObject) => void

        A callback function that is executed each time data is loaded. You can retrieve the progress rate (0 to 100) and the image during loading.

      • abortSignal: AbortSignal

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Use this when changing the color map partway through.

      Parameters

      Returns void

    • Retrieves the already loaded DataObject again from the cache. No further communication is performed.

      Returns DataObject