Class Geometry

Hierarchy

Index

Classes

Constructor methods

Properties

Methods

Classes

Collection: Collection

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public static CLASS_NAME: string

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

Curve: Curve

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

LineString: LineString

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

LinearRing: LinearRing

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

MultiLineString: MultiLineString

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

MultiPoint: MultiPoint

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

MultiPolygon: MultiPolygon

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

Point: Point

constructor(x: number, y: number): Point

Construct a point geometry.

Parameters

  • x: number
  • y: number

Returns

Point

public bounds: Bounds

The bounds of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public x: number

public y: number

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Geometry

Create a clone of this geometry.

Returns

Geometry

public clone(obj: Point): Point

An exact clone of this OpenLayers.Geometry.Point

Parameters

Returns

Point

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geom: Point): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Returns the area of the collection by summing its parts

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(): Point

Calculate the centroid of this geometry. This method is defined in subclasses.

Returns

Point

public getLength(): number

Returns the length of the collection by summing its parts

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a point relative to some origin. For points, this has the effect of scaling a vector (from the origin to the point). This method is more useful on geometry collection subclasses.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a point around another.

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Translate the x,y properties of the point from source to dest.

Parameters

Returns

Geometry

Polygon: Polygon

constructor(components: Geometry[]): Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

Returns

Collection

public bounds: Bounds

The bounds of this geometry

public componentTypes: Array<string>

An array of class names representing the types of components that the collection can include. A null value means the component types are not restricted.

public components: Geometry[]

The component parts of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

public addComponent(component: Geometry, index: number): boolean

Add a new component (geometry) to the collection. If this.componentTypes is set, then the component class name must be in the componentTypes array.

Parameters

Returns

boolean

public addComponents(components: Geometry[])

Add components to this geometry.

Parameters

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public calculateBounds()

Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Collection

Clone this geometry.

Returns

Collection

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: DistanceOptions): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public equals(geometry: Geometry): boolean

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Parameters

Returns

boolean

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Calculate the area of this geometry. Note how this function is overridden in .

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(weighted?: boolean): Point

Compute the centroid for this geometry collection.

Parameters

  • weighted?: boolean optional

Returns

Point

public getComponentsString(): string

Get a string representing the components for this collection

Returns

string

public getGeodesicArea(projection: Projection): number

Calculate the approximate area of the polygon were it projected onto the earth.

Parameters

Returns

number

public getGeodesicLength(projection: Projection): number

Calculate the approximate length of the geometry were it projected onto the earth.

Parameters

Returns

number

public getLength(): number

Calculate the length of this geometry

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public intersects(geometry: Geometry): boolean

Determine if the input geometry intersects this one.

Parameters

Returns

boolean

public move(x: number, y: number)

Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.

Parameters

  • x: number
  • y: number

public removeComponent(component: Geometry): boolean

Remove a component from this geometry.

Parameters

Returns

boolean

public removeComponents(components: Geometry[]): boolean

Remove components from this geometry.

Parameters

Returns

boolean

public resize(scale: number, origin: Point, ratio: number): Geometry

Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.

Parameters

  • scale: number
  • origin: Point
  • ratio: number

Returns

Geometry

public rotate(angle: number, origin: Point)

Rotate a geometry around some origin

Parameters

  • angle: number
  • origin: Point

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string

public transform(source: Projection, dest: Projection): Geometry

Reproject the components geometry from source to dest.

Parameters

Returns

Geometry

Constructor methods

constructor(): Geometry

A Geometry is a description of a geographic object.

Returns

Geometry

Properties

public static CLASS_NAME: string

public bounds: Bounds

The bounds of this geometry

public id: string

A unique identifier for this geometry.

public parent: Geometry

This is set when a Geometry is added as component of another geometry

Methods

public atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean

Return whether or not the geometry is at the specified location

Parameters

  • lonlat: LonLat
  • toleranceLon?: number optional
  • toleranceLat?: number optional

Returns

boolean

public clearBounds()

Nullify this components bounds and that of its parent as well.

public clone(): Geometry

Create a clone of this geometry. Does not set any non-standard properties of the cloned geometry.

Returns

Geometry

public destroy()

Destroy this geometry.

public distanceTo(geometry: Geometry, options: Object): Object

Calculate the closest distance between two geometries (on the x-y plane).

Parameters

Returns

Object

public extendBounds(newBounds: Bounds)

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Parameters

public getArea(): number

Returns the area of the collection by summing its parts

Returns

number

public getBounds(): Bounds

Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.

Returns

Bounds

public getCentroid(): Point

Calculate the centroid of this geometry. This method is defined in subclasses.

Returns

Point

public getLength(): number

Returns the length of the collection by summing its parts

Returns

number

public getVertices(nodes: boolean): Array<any>

Return a list of all points in this geometry.

Parameters

  • nodes: boolean

Returns

Array<any>

public setBounds(bounds: Bounds)

Set the bounds for this Geometry.

Parameters

public toString(): string

Returns a text representation of the geometry. If the WKT format is included in a build, this will be the Well-Known Text representation.

Returns

string