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

    Function K_MIN_WIDTH

    • The width of geometric figure is defined as the distance between two parallel bounding lines in a given direction. For cells, the minimum width is always attained between two opposite edges, and the maximum width is attained between two opposite vertices. However, for our purposes we redefine the width of a cell as the perpendicular distance between a pair of opposite edges. A cell therefore has two widths, one in each direction. The minimum width according to this definition agrees with the classic geometric one, but the maximum width is different. (The maximum geometric width corresponds to kMaxDiag defined below.)

      For a cell at level k, the distance between opposite edges is at least kMinWidth.getValue(k) and at most kMaxWidth.getValue(k). The average width in both directions for all cells at level k is approximately kAvgWidth.getValue(k).

      The width is useful for bounding the minimum or maximum distance from a point on one edge of a cell to the closest point on the opposite edge. For example, this is useful when "growing" regions by a fixed distance.

      Note that because S2Cells are not usually rectangles, the minimum width of a cell is generally smaller than its minimum edge length. (The interior angles of an S2Cell range from 60 to 120 degrees.)

      Linear -> sqrt(2.0 / 3.0) (0.816) Tan -> pi / (2.0 * @sqrt(2.0)) (1.111) Quadratic -> 2.0 * @sqrt(2.0) / 3.0 (0.943) [Default]

      Returns LengthMetric

      • new LengthMetric((2 * Math.sqrt(2)) / 3.0)