Skip to content
Last updated

API / geotoolkit / controls / util / density / DensityGrid / DensityGrid

Class: DensityGrid

density.DensityGrid.DensityGrid

Computes contour polygons by applying marching squares to a rectangular array of numeric values. Each node contains a density value.

The grid coordinate system is orthogonal. The node indices may be only non-negative (starting from 0). You may think about grid data as of two-dimensional array.

Hierarchy

Table of contents

Constructors
  • [new DensityGrid(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.util-1.density-1.densitygrid.densitygrid.md#new densitygrid(options))
Methods
Css Properties
Name Type Description
bandwidthnumberBand width
cellsizenumberCell size
dimensionDimensionVirtual grid dimension
dimension-heightnumberHeight of dimension
dimension-widthnumberWidth of dimension or properties
modellimitsRectReal model limits of X and Y values, by default it is calculated with using min and max values for specified data
modellimits-heightnumberHeight
modellimits-readonlybooleanReadonly
modellimits-widthnumberWidth
modellimits-xnumberLeft
modellimits-ynumberTop
thresholdsnumberThresholds

Contents

Constructors

new DensityGrid(options)

• new DensityGrid(options?)

Parameters

Name Type
Optional optionsOptions

Overrides

EventDispatcher.constructor

Methods

dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getAverageDistance

▸ getAverageDistance(): number

Return average distance from center

Returns

number

average distance


getBandwidth

▸ getBandwidth(): number

Return band width

Returns

number

band width


getCellSize

▸ getCellSize(): number

Return cell size

Returns

number

cell size


getCenterX

▸ getCenterX(): number

Return center of x values

Returns

number

center x


getCenterY

▸ getCenterY(): number

Return center of y values

Returns

number

center y


getClassName

▸ getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getContours

▸ getContours(): { coordinates: number[][][][] ; value: number }[]

Return density contours coordinates

Returns

{ coordinates: number[][][][] ; value: number }[]

density contours objects


getDensityValueAt

▸ getDensityValueAt(n, m): number

Return density grid value at specified n m grid indices

Parameters

Name Type Description
nnumbern index, horizontal
mnumberm index, vertical

Returns

number

density value


getDensityValues

▸ getDensityValues(): Float32Array

Return density values

Returns

Float32Array

packed density values


getGridDimension

▸ getGridDimension(): Dimension

Return grid dimension

Returns

Dimension

grid dimension


getGridSize

▸ getGridSize(): Dimension

Return grid size

Returns

Dimension

grid size


getGridToModelTransformation

▸ getGridToModelTransformation(): Transformation

Return grid to model transformation

Returns

Transformation

grid to model transformation


getModelLimits

▸ getModelLimits(): Rect

Return model limits

Returns

Rect

values model limits


getProperties

▸ getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties


getThresholds

▸ getThresholds(): number | number[] | (value: Float32Array) => number

Return thresholds

Returns

number | number[] | (value: Float32Array) => number

thresholds


getX

▸ getX(): number[]

Return X values

Returns

number[]

x values


getY

▸ getY(): number[]

Return Y values

Returns

number[]

y values


hasEventListener

▸ hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

▸ isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


notify

▸ notify(type, source, args?): DensityGrid

Notify listeners

Parameters

Name Type Description
typestringevent types
sourceanyof the event
Optional argsanyarguments of the event

Returns

DensityGrid

this

Inherited from

EventDispatcher.notify


off

▸ off(type?, callback?): DensityGrid

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Parameters

Name Type Description
Optional typestringtype of the event
Optional callbackEventListenerfunction to be called

Returns

DensityGrid

this

Inherited from

EventDispatcher.off

▸ off<E&gt;(type, callback): DensityGrid

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: DensityGrid, args: EventMap[E]) => void

Returns

DensityGrid

Inherited from

EventDispatcher.off


on

▸ on(type, callback, options?): DensityGrid

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target. </p>

Parameters

Name Type Description
typestringtype of event or property
callbackEventListenerto be called
Optional optionsOptionsoptions of subscription

Returns

DensityGrid

this

Inherited from

EventDispatcher.on

▸ on<E&gt;(type, callback, options?): DensityGrid

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: DensityGrid, args: EventMap[E]) => void
Optional optionsOptions

Returns

DensityGrid

Inherited from

EventDispatcher.on


setBandwidth

▸ setBandwidth(bandwidth): DensityGrid

Set band width

Throws

Error if bandwidth < 0

Parameters

Name Type Description
bandwidthnumberband width

Returns

DensityGrid

this


setCellSize

▸ setCellSize(cellSize): DensityGrid

Set cell size

Parameters

Name Type Description
cellSizenumbercell size

Returns

DensityGrid

this


setGridDimension

▸ setGridDimension(dimension): DensityGrid

Set grid dimension

Throws

Error if passed parameter is null

Parameters

Name Type Description
dimensionDimensiongrid dimension

Returns

DensityGrid

this


setModelLimits

▸ setModelLimits(modelLimits): DensityGrid

Set model limits

Parameters

Name Type Description
modelLimitsRectvalues model limits

Returns

DensityGrid

this


setProperties

▸ setProperties(properties?): DensityGrid

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

DensityGrid

this


setSilent

▸ setSilent(bool): DensityGrid

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

DensityGrid

this

Inherited from

EventDispatcher.setSilent


setThresholds

▸ setThresholds(thresholds): DensityGrid

Set thresholds

Parameters

Name Type Description
thresholdsnumber | number[] | (value: Float32Array) => numberthresholds

Returns

DensityGrid

this


setValues

▸ setValues(x, y): DensityGrid

Set X Y values

Parameters

Name Type Description
xnumber[]X values
ynumber[]Y values

Returns

DensityGrid

this


setX

▸ setX(x): DensityGrid

Set X values

Parameters

Name Type Description
xnumber[]x values

Returns

DensityGrid

this


setY

▸ setY(y): DensityGrid

Set Y values

Parameters

Name Type Description
ynumber[]y values

Returns

DensityGrid

this


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName