Multi-polygon geometry.

Hierarchy (view full)

Constructors

  • Parameters

    • coordinates: number[] | (Polygon | Coordinate[][])[]

      Coordinates. For internal use, flat coordinates in combination with layout and endss are also accepted.

    • Optionallayout: GeometryLayout

      Layout.

    • Optionalendss: number[][]

      Array of ends for internal use with flat coordinates.

    Returns MultiPolygon

Properties

disposed: boolean

The object has already been disposed.

flatCoordinates: number[]
layout: GeometryLayout
on: ObjectOnSignature<EventsKey>
once: ObjectOnSignature<EventsKey>
simplifiedGeometryMaxMinSquaredTolerance: number
simplifiedGeometryRevision: number
simplifyTransformedInternal: ((...arg0: any[]) => Geometry)

Get a transformed and simplified version of the geometry.

Type declaration

    • (...arg0): Geometry
    • Parameters

      • Rest...arg0: any[]

      Returns Geometry

      Simplified geometry.

stride: number
un: ObjectOnSignature<void>

Methods

  • Parameters

    • key: string

      Key name.

    • listener: Listener

      Listener.

    Returns void

  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

  • Append the passed polygon to this multipolygon.

    Parameters

    Returns void

  • Protected

    Apply any properties from another object without triggering events.

    Parameters

    • source: Object

      The source object.

    Returns void

  • Apply a transform function to the coordinates of the geometry. The geometry is modified in place. If you do not want the geometry modified in place, first clone() it and then use this function on the clone.

    Parameters

    • transformFn: TransformFunction

      Transform function. Called with a flat array of geometry coordinates.

    Returns void

  • Increases the revision counter and dispatches a 'change' event.

    Returns void

  • Parameters

    • x: number

      X.

    • y: number

      Y.

    • closestPoint: Coordinate

      Closest point.

    • minSquaredDistance: number

      Minimum squared distance.

    Returns number

    Minimum squared distance.

  • Protected

    Parameters

    • extent: Extent

      Extent.

    Returns Extent

    extent Extent.

  • Parameters

    • x: number

      X.

    • y: number

      Y.

    Returns boolean

    Contains (x, y).

  • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

    Parameters

    • event: string | BaseEvent

      Event object.

    Returns undefined | boolean

    false if anyone called preventDefault on the event object or if any of the listeners returned false.

  • Clean up.

    Returns void

  • Protected

    Extension point for disposable objects.

    Returns void

  • Gets a value.

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

  • Return the area of the multipolygon on projected plane.

    Returns number

    Area (on projected plane).

  • Return the closest point of the geometry to the passed point as module:ol/coordinate~Coordinate coordinate.

    Parameters

    • point: Coordinate

      Point.

    • OptionalclosestPoint: Coordinate

      Closest point.

    Returns Coordinate

    Closest point.

  • Get the coordinate array for this geometry. This array has the structure of a GeoJSON coordinate array for multi-polygons.

    Parameters

    • Optionalright: boolean

      Orient coordinates according to the right-hand rule (counter-clockwise for exterior and clockwise for interior rings). If false, coordinates will be oriented according to the left-hand rule (clockwise for exterior and counter-clockwise for interior rings). By default, coordinate orientation will depend on how the geometry was constructed.

    Returns Coordinate[][][]

    Coordinates.

  • Returns number[][]

    Endss.

  • Get the extent of the geometry.

    Parameters

    • Optionalextent: Extent

      Extent.

    Returns Extent

    extent Extent.

  • Return the first coordinate of the geometry.

    Returns Coordinate

    First coordinate.

  • Returns number[]

    Flat coordinates.

  • Returns number[]

    Flat interior points.

  • Return the interior points as module:ol/geom/MultiPoint~MultiPoint multipoint.

    Returns MultiPoint

    Interior points as XYM coordinates, where M is the length of the horizontal intersection that the point belongs to.

  • Get a list of object property names.

    Returns string[]

    List of property names.

  • Return the last coordinate of the geometry.

    Returns Coordinate

    Last point.

  • Return the import("./Geometry.js").GeometryLayout layout of the geometry.

    Returns GeometryLayout

    Layout.

  • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

    Parameters

    • type: string

      Type.

    Returns undefined | Listener[]

    Listeners.

  • Returns number[]

    Oriented flat coordinates.

  • Return the polygon at the specified index.

    Parameters

    • index: number

      Index.

    Returns Polygon

    Polygon.

  • Return the polygons of this multipolygon.

    Returns Polygon[]

    Polygons.

  • Get an object of all property names and values.

    Returns {
        [x: string]: any;
    }

    Object.

    • [x: string]: any
  • Get an object of all property names and values.

    Returns null | {
        [x: string]: any;
    }

    Object.

  • Get the version number for this object. Each time the object is modified, its version number will be incremented.

    Returns number

    Revision.

  • Create a simplified version of this geometry using the Douglas Peucker algorithm.

    Parameters

    • squaredTolerance: number

      Squared tolerance.

    Returns SimpleGeometry

    Simplified geometry.

  • Returns number

    Stride.

  • Get the type of this geometry.

    Returns Type

    Geometry type.

  • Parameters

    • Optionaltype: string

      Type. If not provided, true will be returned if this event target has any listeners.

    Returns boolean

    Has listeners.

  • Returns boolean

    The object has properties.

  • Returns true if this geometry includes the specified coordinate. If the coordinate is on the boundary of the geometry, returns false.

    Parameters

    • coordinate: Coordinate

      Coordinate.

    Returns boolean

    Contains coordinate.

  • Test if the geometry and the passed extent intersect.

    Parameters

    • extent: Extent

      Extent.

    Returns boolean

    true if the geometry and the extent intersect.

  • Parameters

    • key: string

      Key name.

    • oldValue: any

      Old value.

    Returns void

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Parameters

    • key: string

      Key name.

    • listener: Listener

      Listener.

    Returns void

  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

  • Rotate the geometry around a given coordinate. This modifies the geometry coordinates in place.

    Parameters

    • angle: number

      Rotation angle in radians.

    • anchor: Coordinate

      The rotation center.

    Returns void

  • Scale the geometry (with an optional origin). This modifies the geometry coordinates in place.

    Parameters

    • sx: number

      The scaling factor in the x-direction.

    • Optionalsy: number

      The scaling factor in the y-direction (defaults to sx).

    • Optionalanchor: Coordinate

      The scale origin (defaults to the center of the geometry extent).

    Returns void

  • Sets a value.

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • Set the coordinates of the multipolygon.

    Parameters

    • coordinates: Coordinate[][][]

      Coordinates.

    • Optionallayout: GeometryLayout

      Layout.

    Returns void

  • Parameters

    • layout: GeometryLayout

      Layout.

    • flatCoordinates: number[]

      Flat coordinates.

    Returns void

  • Protected

    Parameters

    • layout: undefined | GeometryLayout

      Layout.

    • coordinates: any[]

      Coordinates.

    • nesting: number

      Nesting.

    Returns void

  • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

    Parameters

    • values: {
          [x: string]: any;
      }

      Values.

      • [x: string]: any
    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • Create a simplified version of this geometry. For linestrings, this uses the Douglas Peucker algorithm. For polygons, a quantization-based simplification is used to preserve topology.

    Parameters

    • tolerance: number

      The tolerance distance for simplification.

    Returns Geometry

    A new, simplified version of the original geometry.

  • Get a transformed and simplified version of the geometry.

    Parameters

    • squaredTolerance: number

      Squared tolerance.

    • Optionaltransform: TransformFunction

      Optional transform function.

    Returns Geometry

    Simplified geometry.

  • Transform each coordinate of the geometry from one coordinate reference system to another. The geometry is modified in place. For example, a line will be transformed to a line and a circle to a circle. If you do not want the geometry modified in place, first clone() it and then use this function on the clone.

    Parameters

    • source: ProjectionLike

      The current projection. Can be a string identifier or a module:ol/proj/Projection~Projection object.

    • destination: ProjectionLike

      The desired projection. Can be a string identifier or a module:ol/proj/Projection~Projection object.

    Returns this

    This geometry. Note that original geometry is modified in place.

  • Translate the geometry. This modifies the geometry coordinates in place. If instead you want a new geometry, first clone() this geometry.

    Parameters

    • deltaX: number

      Delta X.

    • deltaY: number

      Delta Y.

    Returns void

  • Protected

    Unlisten for a certain type of event.

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns void

  • Unsets a property.

    Parameters

    • key: string

      Key name.

    • Optionalsilent: boolean

      Unset without triggering an event.

    Returns void