Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Polygon

The Polygon class is a type of GeometryObject representing a chain of line segments closed in a loop.

example


var polyGeometryObject = { type: "Polygon", coordinates: [[[-82.44, 29.20], [-82.44, 29.53], [-82.10, 29.53], [-82.10, 29.20], [-82.44, 29.20]]] };
var poly=new Polygon(polyGeometryObject);

Hierarchy

  • Polygon

Implements

Index

Constructors

constructor

  • Parameters

    Returns Polygon

  • Parameters

    • Optional geoJSON: GeometryObject

      is an optional GeometryObject to use for the coordinates property of this Polygon.

    Returns Polygon

  • Parameters

    • Optional geoJSON: GeometryObject

      is an optional GeometryObject to use for the coordinates property of this Polygon.

    Returns Polygon

Properties

bbox

  • get bbox(): number[]
  • Retrieves an array of number that represents the bounding box of this Polygon.

    Returns number[]

coordinates

coordinates: Position[][] = []

The coordinates property is an array of an array of Position.

Private terraPrimitive

  • Construct a Terraformer Primitive from this Polygon.

    Returns Primitive

    the Terraformer.Primitive of this Polygon.

Private turfFeature

  • Construct a Turf Feature from this Polygon.

    Returns Feature

    the Turf Feature of this Polygon.

type

  • get type(): string
  • The type property of a Polygon.

    Returns string

Methods

buffer

  • buffer(geometryMeasure: GeometryMeasure): GeometryObject
  • buffer(geometryMeasure: GeometryMeasure): GeometryObject
  • buffer(geometryMeasure: GeometryMeasure): GeometryObject

contains

  • contains(geometryObject: GeometryObject): boolean
  • contains(geometryObject: GeometryObject): boolean
  • contains(geometryObject: GeometryObject): boolean
  • See if this Polygon contains a given GeometryObject parameter.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon contains a given GeometryObject parameter.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon contains a given GeometryObject parameter.

    Parameters

    Returns boolean

    a boolean

convexHull

  • convexHull(): Polygon
  • convexHull(): Polygon
  • convexHull(): Polygon
  • Convex Hull is the Polygon stretched around this Polygon

    Returns Polygon

    a new Polygon

  • Convex Hull is the Polygon stretched around this Polygon

    Returns Polygon

    a new Polygon

  • Convex Hull is the Polygon stretched around this Polygon

    Returns Polygon

    a new Polygon

disjoint

  • disjoint(geometryObject: GeometryObject): boolean
  • disjoint(geometryObject: GeometryObject): boolean
  • disjoint(geometryObject: GeometryObject): boolean
  • See if this Polygon does not intersect a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon does not intersect a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon does not intersect a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

equals

  • equals(geometryObject: GeometryObject): boolean
  • equals(geometryObject: GeometryObject): boolean
  • equals(geometryObject: GeometryObject): boolean
  • See if a GeometryObject is equal to this Polygon.

    Parameters

    Returns boolean

    a boolean

  • See if a GeometryObject is equal to this Polygon.

    Parameters

    Returns boolean

    a boolean

  • See if a GeometryObject is equal to this Polygon.

    Parameters

    Returns boolean

    a boolean

getArea

  • getArea(units: string): GeometryMeasure
  • getArea(units: string): GeometryMeasure
  • getArea(units: string): GeometryMeasure
  • Parameters

    • units: string

    Returns GeometryMeasure

  • Parameters

    • units: string

    Returns GeometryMeasure

  • Parameters

    • units: string

    Returns GeometryMeasure

intersects

  • intersects(geometryObject: GeometryObject): boolean
  • intersects(geometryObject: GeometryObject): boolean
  • intersects(geometryObject: GeometryObject): boolean
  • See if this Polygon intersects a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon intersects a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon intersects a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

overlaps

  • overlaps(geometryObject: GeometryObject): boolean
  • overlaps(geometryObject: GeometryObject): boolean
  • overlaps(geometryObject: GeometryObject): boolean
  • See if this Polygon overlaps a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon overlaps a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon overlaps a given GeometryObject.

    Parameters

    Returns boolean

    a boolean

toWkt

  • toWkt(): string
  • toWkt(): string
  • toWkt(): string
  • Convert this Polygon to well-known text representation.

    Returns string

    the well-known text representation this Polygon.

  • Convert this Polygon to well-known text representation.

    Returns string

    the well-known text representation this Polygon.

  • Convert this Polygon to well-known text representation.

    Returns string

    the well-known text representation this Polygon.

within

  • within(geometryObject: GeometryObject): boolean
  • within(geometryObject: GeometryObject): boolean
  • within(geometryObject: GeometryObject): boolean
  • See if this Polygon is within a given GeometryObject (Polygon).

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon is within a given GeometryObject (Polygon).

    Parameters

    Returns boolean

    a boolean

  • See if this Polygon is within a given GeometryObject (Polygon).

    Parameters

    Returns boolean

    a boolean

Static createFromWkt

  • createFromWkt(wkt: string): Polygon
  • createFromWkt(wkt: string): Polygon
  • createFromWkt(wkt: string): Polygon
  • Static method for creating a Polygon from well-known text.

    Parameters

    • wkt: string

      is a string of well-known text representing a Polygon.

    Returns Polygon

    a Polygon parsed from the well-known text.

  • Static method for creating a Polygon from well-known text.

    Parameters

    • wkt: string

      is a string of well-known text representing a Polygon.

    Returns Polygon

    a Polygon parsed from the well-known text.

  • Static method for creating a Polygon from well-known text.

    Parameters

    • wkt: string

      is a string of well-known text representing a Polygon.

    Returns Polygon

    a Polygon parsed from the well-known text.