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

    Class FileTileWriter

    Tile File Writer

    This is a filesystem Tile writer that organizes data via folders.

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

    const tileWriter = new FileTileWriter('./store', 'png');

    // store WM tiles
    await tileWriter.writeTileWM(0, 0, 0, data);
    // store S2 tiles
    await tileWriter.writeTileS2(0, 0, 0, 0, data);
    // store temportal WM tiles
    await tileWriter.writeTemporalTileWM(new Date(), 0, 0, 0, data);
    // store temportal S2 tiles
    await tileWriter.writeTemporalTileS2(new Date(), 0, 0, 0, 0, data);

    // after writing all the tiles, store the metadata
    await tileWriter.commit(metadata);

    Implements

    Index

    Constructors

    • Parameters

      • path: string

        the location to write the data

      • fileType: string = 'vector.pbf'

        the file ending to write

      Returns FileTileWriter

    Properties

    fileType: string = 'vector.pbf'

    the file ending to write

    path: string

    the location to write the data

    Methods

    • Finish writing by building the header with root and leaf directories.

      Parameters

      • metadata: Metadata

        the metadata about all the tiles to store

      Returns Promise<void>

    • Write a time series tile to the folder location given its (face, zoom, x, y) coordinates.

      Parameters

      • time: Date

        the date of the data

      • face: number

        the Open S2 projection face

      • zoom: number

        the zoom level

      • x: number

        the tile X coordinate

      • y: number

        the tile Y coordinate

      • data: Uint8Array

        the tile data to store

      Returns Promise<void>

    • Write a time series tile to the folder location given its (t, z, x, y) coordinates.

      Parameters

      • time: Date

        the date of the data

      • zoom: number

        the zoom level

      • x: number

        the tile X coordinate

      • y: number

        the tile Y coordinate

      • data: Uint8Array

        the tile data to store

      Returns Promise<void>

    • Write a tile to the folder location given its (face, zoom, x, y) coordinates.

      Parameters

      • face: number

        the Open S2 projection face

      • zoom: number

        the zoom level

      • x: number

        the tile X coordinate

      • y: number

        the tile Y coordinate

      • data: Uint8Array

        the tile data to store

      Returns Promise<void>

    • Write a tile to the folder location given its (z, x, y) coordinates.

      Parameters

      • zoom: number

        the zoom level

      • x: number

        the tile X coordinate

      • y: number

        the tile Y coordinate

      • data: Uint8Array

        the tile data to store

      Returns Promise<void>