s2js
    Preparing search index...

    Interface ClosestEdgeQueryTarget

    Target represents the geometry to which the distance is measured. This is the base interface for all target types.

    interface ClosestEdgeQueryTarget {
        getCapBound(): { center: s2.Point; radius: number } | null;
        includeInteriors(): boolean;
        maxBruteForceIndexSize(): number;
        setIncludeInteriors(includeInteriors: boolean): void;
        setMaxError(maxError: number): boolean;
        updateMinDistanceToCell(
            cell: Cell,
            minDist: number,
        ): { distance: number; updated: boolean };
        updateMinDistanceToEdge(
            v0: s2.Point,
            v1: s2.Point,
            minDist: number,
        ): { distance: number; updated: boolean };
        updateMinDistanceToPoint(
            point: s2.Point,
            minDist: number,
        ): { distance: number; updated: boolean };
        visitContainingShapeIds(
            index: ShapeIndex,
            visitor: (shapeID: number, point: s2.Point) => boolean,
        ): boolean;
    }

    Implemented by

    Index

    Methods

    • Returns the maximum number of edges in the index for which it is faster to use brute force search rather than the hierarchical method.

      Returns number

    • Sets whether to include polygon interiors when measuring distances.

      Parameters

      • includeInteriors: boolean

      Returns void

    • Sets the max error for distance calculations. Returns true if the target uses this error for optimization.

      Parameters

      • maxError: number

      Returns boolean

    • Updates minDist if the distance to the cell is less than minDist. Returns true if the distance was updated.

      Parameters

      • cell: Cell
      • minDist: number

      Returns { distance: number; updated: boolean }

    • Updates minDist if the distance to the edge (v0, v1) is less than minDist. Returns true if the distance was updated.

      Parameters

      Returns { distance: number; updated: boolean }

    • Updates minDist if the distance to the point is less than minDist. Returns true if the distance was updated.

      Parameters

      Returns { distance: number; updated: boolean }