Skip to content

API / geotoolkit / util / Region / Region

Class: Region

util.Region.Region

Class with can handle some operation with rectangles and polygons and represent a geometry region

Table of contents

Constructors
  • [new Region(epsilon)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.region.region.md#new region(epsilon))
Methods

Contents

Constructors

new Region(epsilon)

• new Region(epsilon?)

Parameters

Name Type Description
Optional epsilonnumberepsilon, accuracy of clipping
Methods

clear

▸ clear(): Region

Clear region

Returns

Region

this


contains

▸ contains(shape): boolean

Check if region contains shape

Parameters

Name Type Description
shapeRect | Region | Polygonshape

Returns

boolean

true if contains, else false


containsPoint

▸ containsPoint(point): boolean

Check if region contains point

Parameters

Name Type Description
pointPointpoint

Returns

boolean

true if contains, else false


getBoundingBox

▸ getBoundingBox(): Rect

Return bounding rectangle

Returns

Rect

bounding box


getGraphicsPath

▸ getGraphicsPath(): GraphicsPath

Return polygon as graphics path

Returns

GraphicsPath

graphics path


getGraphicsPaths

▸ getGraphicsPaths(): GraphicsPath[]

Return polygon as any array of non-overlapping graphics paths.

Returns

GraphicsPath[]

array of graphic paths


getPolygons

▸ getPolygons(): Polygon[]

Returns polygons

Returns

Polygon[]

polygons


getRectangles

▸ getRectangles(eps?): Rect[]

Return an array of non-overlapping rectangles that make up the region

Parameters

Name Type Description
Optional epsnumberepsilon, accuracy

Returns

Rect[]

array array of non-overlapping rectangles that make up the region


intersect

▸ intersect(shape, dest?): Polygon[]

Intersect shape

Parameters

Name Type Description
shapeRect | GraphicsPath | Rect[] | Region | Polygon | Polygon[] | Region[] | GraphicsPath[]shape
Optional destRegiondestination region

Returns

Polygon[]

result polygons


intersects

▸ intersects(shape): boolean

Check if region intersects shape

Parameters

Name Type Description
shapeRect | Region | Polygonshape

Returns

boolean

true if intersects, else false


isEmpty

▸ isEmpty(): boolean

Check if region is empty

Returns

boolean

true if it is empty, else false


subtract

▸ subtract(shape, dest?): Polygon[]

Subtract polygon

Parameters

Name Type Description
shapeRect | GraphicsPath | Rect[] | Region | Polygon | Polygon[] | Region[] | GraphicsPath[]shape
Optional destRegiondestination region

Returns

Polygon[]

result polygons


transformRegion

▸ transformRegion(transformation): Region

Transform region

Parameters

Name Type Description
transformationTransformationtransformation

Returns

Region

this


union

▸ union(shape, dest?): Polygon[]

Union shape

Parameters

Name Type Description
shapeRect | GraphicsPath | Rect[] | Region | Polygon | Polygon[] | Region[] | GraphicsPath[]shape
Optional destRegiondestination region

Returns

Polygon[]

result polygons