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

    Class PointGrid<M>

    Grid Cluster

    A cluster store to build grid data of gridSize x gridSize. The resultant tiles are filled. Useful for building raster tiles or other grid like data (temperature, precipitation, wind, etc).

    import { PointGrid } from 'gis-tools-ts';
    const PointGrid = new PointGrid();

    // add a lon-lat
    PointGrid.insertLonLat(lon, lat, data);
    // add an STPoint
    PointGrid.insertFaceST(face, s, t, data);

    // after adding data build the clusters
    await PointGrid.buildClusters();

    // get the clusters for a tile
    const tile = await PointGrid.getTile(id);

    Type Parameters

    • M extends MValue = Properties | RGBA
    Index

    Constructors

    Methods

    • Build the grid cluster tiles

      Returns Promise<void>

    • Get the point data as a grid of a tile

      Parameters

      • id: bigint

        the cell id

      Returns Promise<undefined | TileGrid>

      • a tile grid
    • Add a point to the maxzoom index. The point is a Point3D

      Parameters

      • point: VectorPointM<M>

        the point to add

      Returns void

    • Insert an STPoint to the index

      Parameters

      • face: Face

        the face of the cell

      • s: number

        the s coordinate

      • t: number

        the t coordinate

      • data: M

        the data associated with the point

      Returns void

    • Add a vector feature. It will try to use the M-value first, but if it doesn't exist it will use the feature properties data

      Parameters

      • data: JSONCollection<unknown, M, M>

        any source of data like a feature collection or features themselves

      Returns void

    • Add a lon-lat pair to the cluster

      Parameters

      • ll: VectorPoint<M>

        lon-lat vector point in degrees

      Returns void

    • Add all points from a reader. It will try to use the M-value first, but if it doesn't exist it will use the feature properties data

      Parameters

      Returns Promise<void>