JAXA Earth API for JavaScript
    Preparing search index...

    Function getDataObject

    • A method for easily retrieving a DataObject with the specified conditions, without having to deal with ImageCollection and Image operations.

      This is equivalent to the following process.

      const ic = new ImageCollection({
      collectionUrl,
      });

      await ic.init();

      const image = await ic.getImage({
      date,
      band,
      });

      const dataObject = await image.getDataObject({
      bbox,
      width,
      height,
      resampling,
      onloading,
      });

      Parameters

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

          The URL of the collection.json of the dataset to use.

        • 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, and returns the latest available data.

        • Optionalband?: string

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

        • Optionalbbox?: Bbox

          A Bbox indicating the latitude-longitude range. If omitted, it behaves as if [-180, -90, 180, 90] was specified.

        • Optionalwidth?: number

          The width [px] of the image to retrieve. If omitted, it behaves as if 1000 was specified.

        • Optionalheight?: number

          The height [px] of the image to retrieve. If omitted, it behaves as if 500 was specified.

        • Optionalresampling?: Resampling

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

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

          A callback function that is executed each time a file is loaded. The callback function is passed progress (a progress value from 0 to 100) and the DataObject at each point in time as arguments. If omitted, it behaves as if a function that does nothing () => { } was specified.

      Returns Promise<DataObject>

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

      const dataObject = await je.getDataObject({
      // Specify the URL of the collection.json of the dataset to use.
      collectionUrl: "https://s3.ap-northeast-1.wasabisys.com/je-pds/cog/v1/JAXA.EORC_ALOS.PRISM_AW3D30.v3.2_global/collection.json",

      // Specify the band name of the dataset to use.
      band: "DSM",

      // Specify the latitude-longitude range from which to retrieve data.
      // [min longitude (west), min latitude (south), max longitude (east), max latitude (north)]
      bbox: [-180, -90, 180, 90],

      // Specify the size of the image to retrieve in number of pixels.
      width: 1000,
      height: 500,

      // A callback function executed each time data is loaded.
      onloading: (progress, dataObject) => {
      console.log(progress, dataObject);
      // Display the loading progress or visualize the intermediate state.
      }
      });