s2js
    Preparing search index...

    Class ClosestEdgeQueryOptions

    Options that control the set of edges returned. Note that by default all edges are returned, so you will always want to set either the maxResults option or the maxDistance option (or both).

    Index

    Constructors

    Properties

    includeInteriors: boolean = true

    Specifies that polygon interiors should be included when measuring distances. If true, the distance to a point inside a polygon is zero.

    Default: true

    maxDistance: number = ...

    Specifies that only edges whose distance to the target is less than "maxDistance" should be returned.

    Note that edges whose distance is exactly equal to "maxDistance" are not returned. Normally this doesn't matter, because distances are not computed exactly in the first place, but if such edges are needed then see setInclusiveMaxDistance() below.

    Default: Infinity

    maxError: number = 0

    Specifies that edges up to maxError further away than the true closest edges may be substituted in the result set, as long as such edges satisfy all the remaining search criteria (such as maxDistance). This option only has an effect if maxResults is also specified; otherwise all edges closer than maxDistance will always be returned.

    Default: 0

    maxResults: number = Infinity

    Specifies that at most "maxResults" edges should be returned. Default: Infinity (no limit)

    useBruteForce: boolean = false

    Specifies that distances should be computed by examining every edge rather than using the ShapeIndex. This is useful for testing and debugging, and also for very small indexes where the overhead of building the index is not worthwhile.

    Default: false

    Methods

    • Sets maxDistance such that edges whose true distance is less than or equal to maxDistance will be returned (along with some edges whose true distance is slightly greater).

      This ensures that all edges whose true distance is less than or equal to maxDistance will be returned. The maxDistance is increased by the maximum error in the distance calculation.

      Parameters

      • maxDistance: number

      Returns void

    • Sets maxDistance to the given value such that edges whose distance is exactly equal to maxDistance are also returned. Equivalent to setting maxDistance to maxDistance.successor().

      Parameters

      • maxDistance: number

      Returns void