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

    Class PointCluster<M>

    Point Cluster

    A cluster store to index points at each zoom level

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

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

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

    // get the clusters for a tile
    const tile = await pointCluster.getTile(id);
    // or get the raw cluster data
    const clusters = await pointCluster.getCellData(id);

    Type Parameters

    • M extends MValue = Properties
    Index

    Constructors

    Methods

    • Parameters

      • id: bigint

        the cell id

      Returns Promise<undefined | PointShape<Cluster<M>>[]>

      • the data within the range of the tile id
    • Parameters

      • id: bigint

        the id of the vector tile

      Returns Promise<undefined | Tile<Record<string, unknown>, { value: number }, M>>

      • the vector tile
    • 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>