A GeoBuffer represents all points whose distance to the base shape is less than or equal to a certain distance.

A buffer is an area around a given shape, adding a fixed width to the shape.

The contour of the buffer is a polygon in which each exterior point lies at a fixed distance from the line segments of the base shape.

The supported base shapes are polylines and polygons.

For open base shapes (polylines), it is possible specify a CAP_BUTT end style (see EndCapStyle enumeration) that cuts off the buffer at the start and end of the base shape.

Hierarchy

Constructors

Accessors

  • get baseShape(): Shape
  • The base shape of this buffer.

    Returns Shape

  • set baseShape(baseShape): void
  • Parameters

    Returns void

  • get bounds(): null | Bounds
  • The bounds of this shape. This property is to be treated in a read only manner. An error will be thrown when trying to assign to this property. Note that the bounds property is not immutable. Modifying properties of the bounds property may corrupt your data.

    Returns null | Bounds

  • get contour(): Shape
  • Returns the contour of the Geobuffer, as a shape. By definition, the contour of the buffer is constructed by creating a closed polygon around the axis, in which each point lies at a distance equal to the width from the axis

    • except for the end points, which can have a custom style. The contour is modeled as a complex polygon (i.e., a composite polygon consisting of one or more polygons that each define an edge of the contour). In the simplest form, the contour is represented by a single polygon. In cases where the buffer intersects with itself, holes are formed and multiple polygons are used to define the contour.

    This method returns a copy of the contour. Modifying it will not have any effect on the geobuffer visualization.

    Returns Shape

    GeoBuffer contour as a complex polygon.

    Since

    2023.0

  • get coordinateType(): CoordinateType
  • The coordinate type this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns CoordinateType

  • get endCapStyle(): EndCapStyle
  • The end cap style of this buffer, which defines the representation of the contour at the endings of the base shape. This is a member of the EndCapStyle enumeration. By default, CAP_ROUND is used.

    Returns EndCapStyle

  • set endCapStyle(endCapStyle): void
  • Parameters

    Returns void

  • get focusPoint(): null | Point
  • The focus point of this shape. This property is read only. An error will be thrown when trying to assign to this property. This property contains an object but should be treated with value semantics: changes to the shape will not be reflected in the focusPoint that was retrieved from this Polygon before the modification.

    Returns null | Point

  • get reference(): null | CoordinateReference
  • The spatial reference of this shape. This property is read only. An Error will be thrown when trying to assign to this property.

    Returns null | CoordinateReference

  • get width(): number
  • The width of this buffer, expressed in meters and measured from the line segments of the base shape to the contour. The width must be positive.

    Returns number

  • set width(width): void
  • Parameters

    • width: number

    Returns void

Methods

  • Determines whether a given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    Parameters

    • x: number | Point | Bounds

      The point for which containment must be checked. If a 3D point is passed to this function, it will be treated as a 2D point: the z coordinate (height) will be ignored. The reference of this point must be the same reference as this Shape

    • Optional y: number

    Returns boolean

    true when the given point is contained in this shape

    Throws

    Point with another spatial reference

    Deprecated

    Please use contains2DPoint instead.

  • Determines whether the given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    Parameters

    • x: number

      The x coordinate of the point for which containment must be checked

    • y: number

      The y coordinate of the point for which containment must be checked

    Returns boolean

    true when the given point is contained in this shape

    Throws

    Point with another spatial reference

  • Determines whether the given point is inside this shape. This method checks containment only in two dimensions: on the (x,y)-axis or the (lon,lat)-axis (depending on the spatial reference of the shape).

    Parameters

    • point: Point

      The point for which containment must be checked.

    Returns boolean

    true when the given point is contained in this shape

    Throws

    Point with another spatial reference

  • Indicates whether this shape is equal to another.

    Parameters

    • aGeoBuffer: Shape

      the other shape this shape is compared with.

    Returns boolean

    true if both shapes are equal, false otherwise.

  • Converts the shape to a string. This functionality is for debugging purposes only. Results of toString cannot be used to uniquely identify a shape instance.

    Returns string

  • Translates the shape over the given vector in 2D space.

    Parameters

    • x: number

      The x coordinate of the translation vector

    • y: number

      The y coordinate of the translation vector

    Returns void

  • Tests whether the given shape can be used as a base shape for a GeoBuffer.

    Currently GeoBuffer supports Polygon as base shape.

    Parameters

    • shape: Shape

      The shape to be tested.

    Returns boolean

    Whether the shape is a possible base shape.