Skip to content

editorGlobalsRemotePolygonClipper

Class: RemotePolygonClipper

A polygon clipper that uses a remote API to do the calculations. Polygons are sent/received using their array representation

The results will be cached internally, thus they should be treated as immutable.

Hierarchy

AsyncPolygonClipper

RemotePolygonClipper

Index

Constructors

Properties

Methods

Constructors

constructor

+ new RemotePolygonClipper(polygonCleanseOptions: object): RemotePolygonClipper

Defined in src/util/polygon/RemotePolygonClipper.ts:37

Parameters:

Default value polygonCleanseOptions: object= { duplicatePoints: true, collinearPoints: true, area: true }

Name Type Default
area boolean true
collinearPoints boolean true
duplicatePoints boolean true

Returns: RemotePolygonClipper

Properties

Private endpointUrl

endpointUrl: string = Config.get("general.apiRoot") + "api/v1/polygon_clipping/"

Defined in src/util/polygon/RemotePolygonClipper.ts:36


Private polygonCleanseOptions

polygonCleanseOptions: object

Defined in src/util/polygon/RemotePolygonClipper.ts:37

Type declaration:

  • area: boolean

  • collinearPoints: boolean

  • duplicatePoints: boolean

Methods

Private _queryServer

_queryServer(bases: number[], candidates: number[], operation: OperationType): ICancellablePromise‹any›

Defined in src/util/polygon/RemotePolygonClipper.ts:121

Sends a clipping query to the server

Parameters:

Name Type
bases number[]
candidates number[]
operation OperationType

Returns: ICancellablePromise‹any›

promise that will resolve to an array of serialized polygons


Private _run

_run(operation: OperationType, basePolygons: Array‹Polygon | MultiPolygon›, candidates: Array‹Polygon | MultiPolygon›): ICancellablePromise‹MultiPolygon

Defined in src/util/polygon/RemotePolygonClipper.ts:145

Parameters:

Name Type
operation OperationType
basePolygons Array‹Polygon | MultiPolygon
candidates Array‹Polygon | MultiPolygon

Returns: ICancellablePromise‹MultiPolygon


difference

difference(base: Polygon | MultiPolygon, candidates: Array‹Polygon | MultiPolygon›): ICancellablePromise‹MultiPolygon

Overrides AsyncPolygonClipper.difference

Defined in src/util/polygon/RemotePolygonClipper.ts:88

Parameters:

Name Type
base Polygon | MultiPolygon
candidates Array‹Polygon | MultiPolygon

Returns: ICancellablePromise‹MultiPolygon


intersection

intersection(base: Polygon | MultiPolygon, candidates: Array‹Polygon | MultiPolygon›): ICancellablePromise‹MultiPolygon

Overrides AsyncPolygonClipper.intersection

Defined in src/util/polygon/RemotePolygonClipper.ts:104

Parameters:

Name Type
base Polygon | MultiPolygon
candidates Array‹Polygon | MultiPolygon

Returns: ICancellablePromise‹MultiPolygon


multiUnion

multiUnion(polygons: Array‹Polygon | MultiPolygon›): ICancellablePromise‹MultiPolygon

Overrides AsyncPolygonClipper.multiUnion

Defined in src/util/polygon/RemotePolygonClipper.ts:57

Parameters:

Name Type
polygons Array‹Polygon | MultiPolygon

Returns: ICancellablePromise‹MultiPolygon


union

union(base: Polygon | MultiPolygon, candidates: Array‹Polygon | MultiPolygon›): ICancellablePromise‹MultiPolygon

Overrides AsyncPolygonClipper.union

Defined in src/util/polygon/RemotePolygonClipper.ts:44

Parameters:

Name Type
base Polygon | MultiPolygon
candidates Array‹Polygon | MultiPolygon

Returns: ICancellablePromise‹MultiPolygon