Skip to main content

Interface: IGeometryProvider

api.IGeometryProvider

interface IGeometryProvider

Interface describing geometry provider members.

This is a specification for implementers to model: it is not an exported method or class.

Implemented by#

Methods#

bboxToCellIds#

â–¸ bboxToCellIds(sw, ne): string[]

Convert a geodetic bounding box to the the minimum set of cell ids containing the bounding box.

description The bounding box needs to be sufficiently small to be contained in an area with the size of maximally four tiles. Up to nine adjacent tiles may be returned.

Parameters#

NameTypeDescription
swLngLatSouth west corner of bounding box.
neLngLatNorth east corner of bounding box.

Returns#

string[]

Array of cell ids.

Defined in#

api/interfaces/IGeometryProvider.ts:25


getAdjacent#

â–¸ getAdjacent(cellId): string[]

Get the cell ids of all adjacent cells.

description In the case of approximately rectangular cells this is typically the eight orthogonally and diagonally adjacent cells.

Parameters#

NameTypeDescription
cellIdstringId of cell.

Returns#

string[]

Array of cell ids. No specific order is guaranteed.

Defined in#

api/interfaces/IGeometryProvider.ts:38


getVertices#

â–¸ getVertices(cellId): LngLat[]

Get the vertices of a cell.

description The vertices form an unclosed clockwise polygon in the 2D longitude, latitude space. No assumption on the position of the first vertex relative to the others can be made.

Parameters#

NameTypeDescription
cellIdstringId of cell.

Returns#

LngLat[]

Unclosed clockwise polygon.

Defined in#

api/interfaces/IGeometryProvider.ts:51


lngLatToCellId#

â–¸ lngLatToCellId(lngLat): string

Convert geodetic coordinates to a cell id.

Parameters#

NameTypeDescription
lngLatLngLatLongitude, latitude to convert.

Returns#

string

Cell id for the longitude, latitude.

Defined in#

api/interfaces/IGeometryProvider.ts:59