s2tiles - v1.1.3
    Preparing search index...

    Class S2TilesStore

    S2 Tiles Reader

    Reads & Writes data via the S2Tiles specification.

    Index

    Constructors

    • Parameters

      • path: string

        the location of the S2Tiles data

      • Optionalmaxzoom: number

        set the maxzoom if you're writing

      • Optionalcompression: Compression

        set the compression algorithm if you're writing

      Returns S2TilesStore

    Properties

    path: string

    the location of the S2Tiles data

    Methods

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

      Parameters

      • metadata: Metadata

        the metadata to store

      • OptionaltileCompression: Compression

        the compression algorithm that was used on the tiles [Default: None]

      Returns Promise<void>

    • Get the metadata of the archive

      Returns Promise<Metadata>

      • the metadata of the archive
    • Get the bytes of 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 | Uint8Array<ArrayBufferLike>>

      • the bytes of the tile at the given (face, zoom, x, y) coordinates, or undefined if the tile does not exist in the archive.
    • Get the bytes of 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 | Uint8Array<ArrayBufferLike>>

      • the bytes of the tile at the given (z, x, y) coordinates, or undefined if the tile does not exist in the archive.
    • Check if an S2 tile exists in the archive

      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 in the archive
    • Check if a tile exists in the archive

      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 in the archive
    • Write a tile to the S2Tiles file given its (face, zoom, x, y) coordinates.

      Parameters

      • face: Face

        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>

    • Setup the reader

      Returns Promise<void>

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

      Parameters

      • face: Face

        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 S2Tiles file 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>