Options
All
  • Public
  • Public/Protected
  • All
Menu

Package harp-geometry

@here/harp-geometry

Overview

Algorithms and data structures needed by harp.gl to create and process geometries.

Index

References

OrientedBox3

Re-exports OrientedBox3

OrientedBox3

Re-exports OrientedBox3

wrapLineString

Re-exports wrapLineString

Type aliases

ClippedVertex

ClippedVertex: Vector2 & ClipInfo

Functions

clipLineString

  • clipLineString(lineString: Vector2[], minX: number, minY: number, maxX: number, maxY: number): Vector2[][]
  • Clip the input line against the given bounds.

    Parameters

    • lineString: Vector2[]

      The line to clip.

    • minX: number

      The minimum x coordinate.

    • minY: number

      The minimum y coordinate.

    • maxX: number

      The maxumum x coordinate.

    • maxY: number

      The maxumum y coordinate.

    Returns Vector2[][]

clipPolygon

  • clipPolygon(polygon: Vector2[], extent: number): Vector2[]
  • Clip the given polygon against a rectangle using the Sutherland-Hodgman algorithm.

    remarks

    The coordinates of the polygon must be integer numbers.

    Parameters

    • polygon: Vector2[]

      The vertices of the polygon to clip.

    • extent: number

      The extents of the rectangle to clip against.

    Returns Vector2[]

wrapLineString

  • wrapLineString(coordinates: GeoCoordinates[]): Partial<WrappedLineString>
  • Wrap the given line string.

    remarks

    This function splits this input line string in three parts.

    The left member of the result contains the part of the line string with longitude less than -180.

    The middle member contains the part of the line string with longitude in the range [-180, 180].

    The right member contains the part of the line string with longitude greater than 180.

    Parameters

    • coordinates: GeoCoordinates[]

      The coordinates of the line string to wrap.

    Returns Partial<WrappedLineString>

wrapPolygon

  • Wrap the given polygon.

    remarks

    This function splits this input polygon in three parts.

    The left member of the result contains the part of the polygon with longitude less than -180.

    The middle member contains the part of the polygon with longitude in the range [-180, 180].

    The right member contains the part of the polygon with longitude greater than 180.

    Parameters

    • coordinates: GeoCoordinates[]

      The coordinates of the polygon to wrap.

    Returns Partial<WrappedPolygon>

Generated using TypeDoc