JAXA Earth API for JavaScript
    Preparing search index...

    Class Image

    Image can be obtained from ImageCollection by specifying a date and a band name. It cannot be created directly from the constructor.

    By specifying the latitude-longitude range, the image size, and the resampling method to Image#getDataObject, you can retrieve a DataObject.

    import * as je from "./jaxa.earth.esm.js";

    // Specify the collection.json that identifies the dataset you want to use.
    const collectionUrl = "https://s3.ap-northeast-1.wasabisys.com/je-pds/cog/v1/JAXA.G-Portal_GCOM-W.AMSR2_standard.L3-SMC.daytime.v3_global_monthly/collection.json";

    // Create and initialize an ImageCollection. Initialization loads the necessary information from collection.json.
    const ic = new je.ImageCollection({ collectionUrl });
    await ic.init();

    // Retrieve a je.Image from the ImageCollection.
    const im = await ic.getImage({
    // Specify the date. The data for the specified date is retrieved. If omitted, the current date is used so that the latest data can be retrieved.
    // In this example, the data for 2021/6 is retrieved.
    date: new Date(Date.UTC(2021, 6 - 1)),

    // Specify the band name. If omitted, the first band name is selected automatically.
    band: "SMC",
    });

    // Retrieve the DataObject.
    const dataObject = await im.getDataObject({

    // Specify the Bbox. If omitted, it behaves as if [-180,-90,180,90] was specified.
    bbox: [110, 30, 150, 50],

    // Specify the size. If omitted, it behaves as if a width of 1000px and a height of 500px was specified.
    width: 800,
    height: 400,

    // Specify the resampling method. If omitted, it behaves as if je.Resampling.NEAREST was specified.
    // resampling: je.Resampling.BILINEAR,
    });

    console.log(dataObject);
    Index

    Methods

    • Retrieves a DataObject.

      Parameters

      • options: {
            bbox?: Bbox;
            width?: number;
            height?: number;
            resampling?: Resampling;
            onloading?: (progress: number, dataObject: DataObject) => void;
        }
        • Optionalbbox?: Bbox

          Specifies the Bbox. If omitted, it behaves as if [-180, -90, 180, 90] was specified.

        • Optionalwidth?: number

          Specifies the image width [px]. If omitted, it behaves as if 1000 was specified.

        • Optionalheight?: number

          Specifies the image height [px]. If omitted, it behaves as if 500 was specified.

        • Optionalresampling?: Resampling

          Specifies the resampling method. If omitted, it behaves as if je.Resampling.NEAREST was specified and processing is done with nearest neighbor.

        • Optionalonloading?: (progress: number, dataObject: DataObject) => void

          A callback function that is executed each time a file is loaded. The callback function receives, as arguments, progress (a progress rate from 0 to 100) and the DataObject at each point in time.

      Returns Promise<DataObject>

    • Returns the collectionUrl of this Image.

      Returns string

    • Returns the date of this Image.

      Returns Date

    • Returns the date of this Image as a string representation that takes into account the time interval of the dataset.

      Returns string

    • Returns the band name of this Image.

      Returns string