AreaGeometryGroups

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

The geometry groups to cut into tiles.

Properties

PropertyModifierTypeDescription
context-geometry?readonlyReadonly<Record<string, JsonTilingMesh>>Distant occluders for shading only. Keep them low-poly (guide: below about 50,000 triangles for the whole site). A context mesh goes into every tile job whose reach box (the tile plus contextReachM) it touches, less its triangles in the tile's detailed area plus contextBufferM, and its triangles cost upload bytes and memory once per tile. Analysed buildings and near neighbours go in geometries, which is cut per tile. See the README, "Bring your own geometry".
geometries?readonlyReadonly<Record<string, JsonTilingMesh>>Buildings and near neighbours to analyse; each mesh is cut per tile.
ground-geometry?readonlyReadonly<Record<string, JsonTilingMesh>>Terrain meshes. Needs terrainContext in ComposeOptions.
ground-materials?readonlyReadonly<Record<string, unknown>>Ground-material layers.
vegetation?readonlyReadonly<Record<string, unknown>>Vegetation group.

CELL_SIZE_M

Import from @infrared-city/infrared-sdk.

const CELL\_SIZE\_M: 1 = 1

Edge length of one analysis grid cell, in metres.


ComposeOptions

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

Options for composeTilePayloads.

Properties

PropertyModifierTypeDescription
analysisType?readonlystring \nullThe analysis type, which selects the tiling parameters; unset uses the wind preset.
contextBufferM?readonlynumberSee RunAreaOptions.contextBufferM.
contextReachM?readonlynumber \nullHow far outside a tile's core, in metres, a context-geometry mesh still reaches that tile. Default 600; null sends every mesh to every tile.
terrainContext?readonlyTerrainContextRequired when ground-geometry is present.

composeTilePayloads

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

composeTilePayloads(groups, tiles, polygon, options?): TilePayloads

Assigns supported geometry groups to the non-empty tiles of a grid.

Each tile's payload comes back finished: every group is already in the tile's own local frame, with the terrain policy applied, so it can be sent as it is. Compact vegetation-instances has no tiling policy yet and is rejected.

Parameters

ParameterTypeDescription
groupsAreaGeometryGroupsThe geometry groups to cut into tiles.
tilesreadonly IndexedTile\[\]The tiles to compose, with their grid positions.
polygonPolygonThe area polygon the tiles cover.
optionsComposeOptionsThe analysis type, and terrainContext (required with ground-geometry).

Returns

TilePayloads

The payload of each tile, keyed by tile id.

Throws

when a group is unknown or has no tiling policy, a mesh uses packed binary coordinates, ground-geometry is given without terrainContext, or a tile row or column is not an integer from 0 through 4,294,967,295.


FrameOrigin

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

A frame origin as longitude and latitude in WGS84 degrees.

Properties

PropertyModifierType
latreadonlynumber
lonreadonlynumber

generateTilesForPolygon

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

generateTilesForPolygon(polygon, options?): Tile\[\]\[\]

Covers a polygon with tiles and returns the grid as tiles[row][col], with row 0 at the south and column 0 at the west.

The grid is deterministic for a polygon and analysis type, and includes tiles that do not touch the polygon (empty: true); only non-empty tiles are billed jobs. A run is refused when it would need more than 100 non-empty tiles, unless maxTilesOverride raises that cap.

Parameters

ParameterTypeDescription
polygonPolygonThe GeoJSON Polygon to cover; it is validated first (see validatePolygon).
options\{ analysisType?: string \null; maxTilesOverride?: number; \}-
options.analysisType?string \nullSelects the tile size and spacing (wind, or solar and thermal); unset uses the wind preset.
options.maxTilesOverride?numberRaises the cap on non-empty tiles; an integer from 0 through 4,294,967,295.

Returns

Tile\[\]\[\]

The tile grid.

Throws

when the polygon is invalid, or when it would need too many tiles; the message gives the counts and the maxTilesOverride that would allow the run.

Throws

when maxTilesOverride is not a valid integer.


getTilingConfig

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

getTilingConfig(analysisType?): TilingConfig

Returns the tiling parameters for an analysis type.

Wind analyses (wind-speed, pedestrian-wind-comfort) and an unset or empty type use the wind preset; any other analysis name uses the solar preset.

Parameters

ParameterTypeDescription
analysisType?string \nullThe analysis type, or unset for the wind preset.

Returns

TilingConfig

The tile size, context size, step and cell size for that family.


IndexedTile

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

A tile with its position in the grid.

Properties

PropertyModifierTypeDescription
colreadonlynumberColumn in the tile grid; column 0 is the westernmost.
rowreadonlynumberRow in the tile grid; row 0 is the southernmost.
tileIdreadonlystringThe identifier of the tile at this position.

JsonTilingMesh

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

JsonTilingMesh = Readonly<Record<string, unknown>> & object

A mesh given as flat JSON arrays of numbers: coordinates for the vertices and indices for the triangles. Packed binary arrays (coordinates_bin, indices_bin) are not accepted for area tiling.

Type Declaration

NameType
coordinates?readonly number\[\]
coordinates_bin?never
indices?readonly number\[\]
indices_bin?never

Point

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

A geographic point.

Properties

PropertyModifierTypeDescription
latitudereadonlynumberLatitude in degrees (-90 to 90).
longitudereadonlynumberLongitude in degrees (-180 to 180).

Polygon

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

A GeoJSON Polygon for an area run: one ring, no holes, closed (first and last position equal) and not self-intersecting. Positions are [longitude, latitude].

Properties

PropertyModifierTypeDescription
coordinatesreadonlyreadonly readonly Position\[\]\[\]The rings of the polygon; an area run takes exactly one.
typereadonly"Polygon"Always "Polygon".

Position

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

Position = readonly \[number, number\] \| readonly \[number, number, number\]

A GeoJSON position: [longitude, latitude] in degrees, with an optional third value (elevation).


SupportedAreaGroup

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

SupportedAreaGroup = "geometries" \| "context-geometry" \| "ground-geometry" \| "vegetation" \| "ground-materials"

The geometry groups an area run can tile.


TerrainContext

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

TerrainContext = object

How far beyond a tile terrain is read: the caller's reach in metres, never less than the analysis family's own context margin (it is a floor, not an addition to it).

Properties

margin\_m

readonly margin\_m: number

Tile

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

One tile of the grid that covers an area polygon. generateTilesForPolygon returns them as Tile[row][col], with row 0 at the south and column 0 at the west.

Properties

PropertyModifierTypeDescription
centroidreadonlyPointCentre of the tile.
emptyreadonlybooleantrue when the tile's analysed square does not touch the polygon, so no job runs for it.
sizereadonlyobjectEdge lengths of the analysed square, in metres.
size.xreadonlynumber-
size.yreadonlynumber-
tileIdreadonlystringIdentifier of the tile; it is the key of the tile in schedules and tile payloads.

TILE_SIZE_CELLS

Import from @infrared-city/infrared-sdk.

const TILE\_SIZE\_CELLS: number

Number of grid cells along one tile edge (TILE_SIZE_M / CELL_SIZE_M).


TILE_SIZE_M

Import from @infrared-city/infrared-sdk.

const TILE\_SIZE\_M: 512 = 512

Edge length of one analysis tile, in metres.


TilePayloads

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

TilePayloads = Record<string, Record<string, unknown>>

The payload of each tile, as { [tileId]: { [group]: data } }, every group in the tile's own local frame.


TILING_SUPPORTED_TYPES

Import from @infrared-city/infrared-sdk.

const TILING\_SUPPORTED\_TYPES: ReadonlySet<AnalysesName>

The analyses that can be run over a polygon area, split into tiles: every analysis name except daylight-factor.


TilingConfig

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

The tiling parameters of an analysis family (wind, or solar and thermal), as returned by getTilingConfig.

Properties

PropertyModifierTypeDescription
cellSizeMreadonlynumberSize of one grid cell, in metres.
contextSizeMreadonlynumberEdge length of the square read for surrounding geometry, in metres.
inferenceSizeCellsreadonlynumberNumber of grid cells along one edge of a tile's result.
inferenceSizeMreadonlynumberEdge length of the square a tile analyses, in metres.
stepCellsreadonlynumberstepM expressed in grid cells.
stepMreadonlynumberDistance between neighbouring tile centres, in metres.

validatePolygon

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

validatePolygon(polygon): Polygon

Checks a GeoJSON polygon and returns it with counter-clockwise winding.

The polygon must be a single ring with no holes, at least four positions (three distinct vertices and the closing one), [longitude, latitude] positions in range, a closed ring, no self-intersection and a non-zero area. A clockwise ring is reversed; positions are otherwise returned as given.

Parameters

ParameterTypeDescription
polygonPolygonThe GeoJSON Polygon to check.

Returns

Polygon

The validated polygon, wound counter-clockwise.

Throws

when the polygon breaks any of the rules above; the message names the problem.