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

    Class RasterTilesFileReader<T, P>

    Raster Tiles File 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.

    import { convertTerrariumElevationData } from 'gis-tools-ts';
    import { RasterTilesFileReader } from 'gis-tools-ts/file';

    // creates a reader for a tile set treating the max zoom as 3 instead of the metadata's max zoom
    const reader = new RasterTilesFileReader('./raster-tiles-top-level-folder', 3);
    // example of reading in an elevation dataset
    const reader2 = new RasterTilesFileReader('./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 file 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, P, VectorGeometry<T>>
          | VectorFeature<TileMetadata, T, P>,
      >

      • 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, P>>

      • 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, P>>

      • 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