Skip to content

webdggrid / Webdggrid

Class: Webdggrid

Constructors

new Webdggrid(_module)

private new Webdggrid(_module): Webdggrid

Parameters

_module: any

Returns

Webdggrid

Source

src-ts/webdggrid.ts:70

Properties

_module

protected _module: any

Source

src-ts/webdggrid.ts:70


dggs

dggs: IDGGSProps = DEFAULT_DGGS

Source

src-ts/webdggrid.ts:67


resolution

resolution: number = DEFAULT_RESOLUTION

Source

src-ts/webdggrid.ts:68

Methods

_main()

_main(): any

test function

Returns

any

Memberof

WebDggrid

Source

src-ts/webdggrid.ts:136


cellAreaKM()

cellAreaKM(resolution): number

Parameters

resolution: number= DEFAULT_RESOLUTION

Returns

number

Source

src-ts/webdggrid.ts:169


cellDistKM()

cellDistKM(resolution): number

Parameters

resolution: number= DEFAULT_RESOLUTION

Returns

number

Source

src-ts/webdggrid.ts:191


geoToGeo()

geoToGeo(coordinates, resolution): Position[]

Converts a set of coordinates to the cell centroid values

Parameters

coordinates: number[][]

A 2d array of lng and lat values

resolution: number= DEFAULT_RESOLUTION

[resolution=DEFAULT_RESOLUTION] The resolution of the dggs

Returns

Position[]

An array of dggs cell centroid coordinates

Source

src-ts/webdggrid.ts:312


geoToSequenceNum()

geoToSequenceNum(coordinates, resolution): bigint[]

Converts an array of geography coordinates to the list of the sequence numbers AKA DggId

Parameters

coordinates: number[][]

A 2d array of [[lng, lat]] values

resolution: number= DEFAULT_RESOLUTION

[resolution=DEFAULT_RESOLUTION] The dggs resolution

Returns

bigint[]

An array of the DggIds

Source

src-ts/webdggrid.ts:240


getResolution()

getResolution(): number

Get the resolution of the current dggs

Returns

number

the current dggs resolution

Memberof

WebDggrid

Source

src-ts/webdggrid.ts:118


gridStatCLS()

gridStatCLS(resolution): number

Parameters

resolution: number= DEFAULT_RESOLUTION

Returns

number

Source

src-ts/webdggrid.ts:213


nCells()

nCells(resolution?): number

Parameters

resolution?: number= DEFAULT_RESOLUTION

Returns

number

Follow

Hi Returns the number of the cells in specific resolution

Memberof

WebDggrid

Source

src-ts/webdggrid.ts:147


sequenceNumToGeo()

sequenceNumToGeo(sequenceNum, resolution): Position[]

Convert a sequence number to the [lng,lat] of the center of the related cell

Parameters

sequenceNum: bigint[]

resolution: number= DEFAULT_RESOLUTION

[resolution=DEFAULT_RESOLUTION]

Returns

Position[]

An array of [lng,lat]

Source

src-ts/webdggrid.ts:275


sequenceNumToGrid()

sequenceNumToGrid(sequenceNum, resolution): Position[][]

Convert an array of sequence numbers to the grid coordinates with format of [lng,lat]. The output is an array with the same size as input sequenceNum and it includes an array of CoordinateLike objects.

Parameters

sequenceNum: bigint[]

resolution: number= DEFAULT_RESOLUTION

[resolution=DEFAULT_RESOLUTION]

Returns

Position[][]

An array of [lng,lat]

Source

src-ts/webdggrid.ts:355


sequenceNumToGridFeatureCollection()

sequenceNumToGridFeatureCollection(sequenceNum, resolution): FeatureCollection<Polygon, Object & Object>

Parameters

sequenceNum: bigint[]

resolution: number= DEFAULT_RESOLUTION

Returns

FeatureCollection<Polygon, Object & Object>

Source

src-ts/webdggrid.ts:414


setDggs()

setDggs(dggs, resolution): void

Set the main dggs configuration

Parameters

dggs: IDGGSProps= DEFAULT_DGGS

A dggs object

resolution: number= DEFAULT_RESOLUTION

Returns

void

Source

src-ts/webdggrid.ts:108


setResolution()

setResolution(resolution?): void

Set the resolution of the dggs

Parameters

resolution?: number

the resolution. It should be a valid integer

Returns

void

Memberof

WebDggrid

Source

src-ts/webdggrid.ts:126


version()

version(): string

Returns

string

The Webdggrid c++ version

Source

src-ts/webdggrid.ts:100


load()

static load(): Promise<typeof Webdggrid>

Compiles and instantiates the raw wasm.

INFO

In general WebAssembly compilation is disallowed on the main thread if the buffer size is larger than 4KB, hence forcing load to be asynchronous;

Returns

Promise<typeof Webdggrid>

A promise to an instance of the Webdggrid class.

Source

src-ts/webdggrid.ts:84


unload()

static unload(): void

Unloades the compiled wasm instance.

Returns

void

Source

src-ts/webdggrid.ts:93