gis-tools-ts - v0.6.0
    Preparing search index...

    Class RasterTilesReader<T>

    Raster Tiles Reader

    Read an entire archive of raster tiles, where the max zoom data is iterated upon

    Supports reading either RGB(A) data and/or RGB(A) encoded elevation data.

    NOTE: Consider using the RasterTilesFileReader from gis-tools-ts/file instead for local access.

    import { RasterTilesReader, convertTerrariumElevationData } from 'gis-tools-ts';

    // creates a reader for a tile set treating the max zoom as 3 instead of the metadata's max zoom
    const reader = new RasterTilesReader('https://example.com/satellite-data', 3);
    // example of reading in an elevation dataset
    const reader2 = new RasterTilesReader('https://example.com/terrariumData', -1, convertTerrariumElevationData);

    // grab the metadata
    const metadata = await reader.getMetadata();

    // grab a WM tile
    const tile1 = await reader.getTile(0, 0, 0);
    // or if it's an S2 tile spec
    const tile2 = await reader.getTileS2(0, 0, 0, 0);

    // grab all the max zoom tiles:
    for await (const tile of reader) {
    console.log(tile);
    }

    Type Parameters

    Implements

    Index

    Constructors

    Properties

    converter?: ElevationConverter

    the elevation converter

    input: string | S2PMTilesReader

    the URL path or S2PMTilesReader to read from

    threshold: number = -1

    if non-zero its the max zoom to read all tiles in the FeatureIterator

    Methods

    • Iterate over all tiles in the archive

      Returns AsyncGenerator<
          | S2Feature<S2TileMetadata, T, Properties, VectorGeometry<T>>
          | VectorFeature<TileMetadata, T, Properties>,
      >

      • the each of the tile's pixel RGBA data as lon-lat or S2 s-t coordinates with the RGBA as m-values
    • Get the metadata of the archive

      Returns Promise<Metadata>

      • the metadata
    • Grab the tile at the given (face, zoom, x, y) coordinates

      Parameters

      • face: Face

        the Open S2 projection face

      • zoom: number

        the zoom level of the tile

      • x: number

        the x coordinate of the tile

      • y: number

        the y coordinate of the tile

      Returns Promise<undefined | RasterS2TileReader<T, T>>

      • the tile
    • Grab the tile at the given zoom-x-y coordinates

      Parameters

      • zoom: number

        the zoom level of the tile

      • x: number

        the x coordinate of the tile

      • y: number

        the y coordinate of the tile

      Returns Promise<undefined | RasterTileReader<T, T>>

      • the tile
    • Return true if the tile exists

      Parameters

      • face: Face

        the Open S2 projection face

      • zoom: number

        the zoom level of the tile

      • x: number

        the x coordinate of the tile

      • y: number

        the y coordinate of the tile

      Returns Promise<boolean>

      • true if the tile exists
    • Return true if the tile exists

      Parameters

      • zoom: number

        the zoom level of the tile

      • x: number

        the x coordinate of the tile

      • y: number

        the y coordinate of the tile

      Returns Promise<boolean>

      • true if the tile exists