A Bounds object is a 3D axis-aligned box. It has a location, a width, height, and a depth. The location is represented by the smallest x, y and z coordinate encompassed by the box, i.e. the lower-left corner. The width, height and depth are the box's extents in the positive directions of the x, y and z axis, respectively.

Note that Bounds instances will be normalized when (re)configuring them. width, h In case the Bounds instance is defined in a CoordinateType.GEODETIC coordinate system, the properties will be normalized:
  • the x coordinate will be in the [-180, 180] range.
  • the width will be in the [0, 360] range. In case the width covers the entire world, the x coordinate will be normalized to -180.
  • the y coordinate will be [-90, 90] range.
  • the height coordinate will never exceed the north pole. (i.e. y + height <= 90).
  • no normalization occurs on the z-axis.

The box is typically used as a bounding box for more complex geometries. It must be instantiated using createBounds.

Hierarchy

Constructors

Accessors

  • get bounds(): 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 Bounds

  • 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 depth(): number
  • The depth of the bounding box (the box's extent along the Z-axis). The depth must be larger than or equal to zero.

    Returns number

  • set depth(value): void
  • Parameters

    • value: number

    Returns void

  • get focusPoint(): 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 Point

  • get height(): number
  • The height of the bounding box (the box's extent along the Y-axis). The height must be larger than or equal to zero.

    Returns number

  • set height(value): void
  • Parameters

    • value: number

    Returns void

  • 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 bounding box (the box's extent along the x-axis). The width must be larger than or equal to zero.

    Returns number

  • set width(value): void
  • Parameters

    • value: number

    Returns void

  • get x(): number
  • The x coordinate or longitude of the location of the bounding box.

    Returns number

  • set x(value): void
  • Parameters

    • value: number

    Returns void

  • get y(): number
  • The y coordinate or latitude of the location of the bounding box.

    Returns number

  • set y(value): void
  • Parameters

    • value: number

    Returns void

  • get z(): number
  • The z coordinate of the location of the bounding box.

    Returns number

  • set z(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Determines whether a given bounds is inside this bounds. 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

    • bounds: Bounds

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

    Returns boolean

    true when the given bounds are contained in this bounds

    Throws

    Bounds with another spatial reference

    Deprecated

    Please use contains2DBounds instead.

  • Determines whether a given bounds is inside this bounds. 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

    • bounds: Bounds

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

    Returns boolean

    true when the given bounds are contained in this bounds

    Throws

    Bounds 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

    • 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

  • Check whether this Bounds instance contains the bounds in the 3D space.

    Parameters

    • pointOrBounds: Point | Bounds

      The bounds or point whose containment must be checked

    Returns boolean

    true when the point or bounds are contained

    Throws

    InvalidReferenceError when the reference of the bounds parameter does not correspond with the reference of this Bounds

    Deprecated

    Please use contains3DBounds instead.

  • Check whether this Bounds instance contains the bounds in the 3D space.

    Parameters

    • bounds: Bounds

      The bounds whose containment must be checked

    Returns boolean

    true when the point or bounds are contained

    Throws

    InvalidReferenceError when the reference of the bounds parameter does not correspond with the reference of this Bounds

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

    Parameters

    • point: Point

      The point for which containment must be checked. If a 3D point is passed to this function, a z-coordinate (height) value of 0 is assumed. This point must have the same spatial reference as the shape.

    Returns boolean

    Throws

    Point with another spatial reference.

  • Indicates whether this shape is equal to another.

    Parameters

    • otherShape: Shape

      the other shape this shape is compared with.

    Returns boolean

    true if both shapes are equal, false otherwise.

  • Checks whether this Bounds object interacts with the given Bounds object in the 2D space. Only the first two dimensions of the Bounds objects are considered.

    Parameters

    • bounds: Bounds

      the bounds to compare with.

    Returns boolean

    the boolean result of the interaction test.

  • Moves the location of this Bounds instance to the location specified by x and y.

    Parameters

    • xOrPoint: number | Point

      x coordinate value or the location as a point.

    • Optional y: number

      y coordinate value

    Returns void

    Throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

  • Moves the location of this Bounds instance to the location specified by x and y.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    Returns void

  • Moves the location of this Bounds instance to the location of the point. The z-value of the point is ignored.

    Parameters

    • point: Point

      a Point instance or x coordinate value

    Returns void

    Throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

  • Moves this Bounds instance to the location specified by the x, y and z parameters.

    Parameters

    • xOrPoint: number | Point

      x coordinate value or the point to move the location of this bounds to

    • Optional y: number

      y coordinate value

    • Optional z: number

      z coordinate value

    Returns void

    Throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

  • Moves this Bounds instance to the location specified by the x, y and z parameters.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value

    Returns void

  • Moves this Bounds instance to the location in 3D space as specified by the point.

    Parameters

    • point: Point

      the point to move the location of this bounds to.

    Returns void

    Throws

    InvalidReferenceError when the reference of the Point parameter does not correspond with the reference of this Bounds.

  • Configure this Bounds instance in 2 dimensions.

    Parameters

    • x: number

      The x coordinate of Bounds instance's location.

    • width: number

      The width of the Bounds instance.

    • y: number

      The y coordinate of the Bounds instance's

    • height: number

      The height of the Bounds instance's location

    Returns void

  • Calculates the 2D intersection of this Bounds instance and a given Bounds instance. Only the first two dimensions of the Bounds objects are considered. This Bounds object is updated with the result. Its third dimension is left unchanged.

    Parameters

    • bounds: Bounds

      the other Bounds operand for the intersection.

    Returns void

    Throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

  • Calculates the 2D union of this Bounds instance and a given Bounds instance. The result contains at least all the points that are contained in either of the Bounds objects (and typically more). Only the first two dimensions of the Bounds objects are considered. This Bounds object is updated with the result. Its third dimension is left unchanged.

    Parameters

    • bounds: Bounds

      the other Bounds operand for the union.

    Returns void

    Throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

  • Configure this Bounds instance in 3 dimensions.

    Parameters

    • x: number

      The x coordinate of Bounds instance's location.

    • width: number

      The width of the Bounds instance.

    • y: number

      The y coordinate of the Bounds instance's

    • height: number

      The height of the Bounds instance's location

    • z: number

      The z coordinate of the Bounds instance's

    • depth: number

      The depth of the Bounds instance's location

    Returns void

  • Calculates the 3D intersection of this Bounds instance and a given Bounds instance. This Bounds object is updated with the result.

    Parameters

    • bounds: Bounds

      the other Bounds operand for the intersection.

    Returns void

    Throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

  • Calculates the 3D union of this Bounds object and a given Bounds object. The result contains at least all the points that are contained in either or both of the Bounds objects (and typically more). This Bounds object is updated with the result.

    Parameters

    • bounds: Bounds

      the other Bounds operand for the union.

    Returns void

    Throws

    InvalidReferenceError when the reference of the Bounds parameter does not correspond with the reference of this Bounds object

  • Configure this Bounds instance in 2 dimensions, using the dimensions of another Bounds instance.

    Parameters

    • bounds: Bounds

      the bounds that must be used to configure this bounds. Only the x, width, y and height properties of this bounds instance will be considered.

    Returns void

    Throws

    InvalidReferenceError if bounds is defined in a different reference

  • Configure this Bounds instance in 2 dimensions, using the dimensions of another Bounds instance.

    Parameters

    • bounds: Bounds

      the bounds that must be used to configure this bounds.

    Returns void

    Throws

    InvalidReferenceError if bounds is defined in a different reference

  • Calculates the 2D extension of this Bounds object that contains a given Point. The result contains at least the given point and all the points that are contained in this Bounds (and typically more). Only the first two dimensions of this Bounds object and the Bounds are considered. This Bounds object is updated with the result. Its third dimension is left unchanged.

    Parameters

    • point: Point

      the point that should be inside (or at the edge) after the extension of the bounds.

    Returns void

    Throws

    Point's reference does not match the spatial reference of this Bounds.

  • Calculates the 3D extension of this Bounds that contains a given Point. The result contains at least the given point and all the points that are contained in this Bounds (and typically more). This Bounds object is updated
    with the result.

    Parameters

    • point: Point

      the point operand for the union.

    Returns void

    Throws

    Point's reference does not match the spatial reference of this Bounds.

  • 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 this bounds from its current position over the given translation vector to another location. This method can be called with an x, y and optionally a z value. If the z coordinate is not specified, the translation will only affect the x and y coordinate.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • Optional z: number

      z coordinate value, may be omitted.

    Returns void

  • 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

  • Translates this bounds from its current position over the given translation vector to another location.

    Parameters

    • x: number

      x coordinate value

    • y: number

      y coordinate value

    • z: number

      z coordinate value

    Returns void