AreaGeometryGroups
Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.
The geometry groups to cut into tiles.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
context-geometry? | readonly | Readonly<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? | readonly | Readonly<Record<string, JsonTilingMesh>> | Buildings and near neighbours to analyse; each mesh is cut per tile. |
ground-geometry? | readonly | Readonly<Record<string, JsonTilingMesh>> | Terrain meshes. Needs terrainContext in ComposeOptions. |
ground-materials? | readonly | Readonly<Record<string, unknown>> | Ground-material layers. |
vegetation? | readonly | Readonly<Record<string, unknown>> | Vegetation group. |
CELL_SIZE_M
Import from @infrared-city/infrared-sdk.
constCELL\_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
| Property | Modifier | Type | Description | |
|---|---|---|---|---|
analysisType? | readonly | string \ | null | The analysis type, which selects the tiling parameters; unset uses the wind preset. |
contextBufferM? | readonly | number | See RunAreaOptions.contextBufferM. | |
contextReachM? | readonly | number \ | null | How 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? | readonly | TerrainContext | Required 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
| Parameter | Type | Description |
|---|---|---|
groups | AreaGeometryGroups | The geometry groups to cut into tiles. |
tiles | readonly IndexedTile\[\] | The tiles to compose, with their grid positions. |
polygon | Polygon | The area polygon the tiles cover. |
options | ComposeOptions | The analysis type, and terrainContext (required with ground-geometry). |
Returns
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
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
| Parameter | Type | Description | |
|---|---|---|---|
polygon | Polygon | The GeoJSON Polygon to cover; it is validated first (see validatePolygon). | |
options | \{ analysisType?: string \ | null; maxTilesOverride?: number; \} | - |
options.analysisType? | string \ | null | Selects the tile size and spacing (wind, or solar and thermal); unset uses the wind preset. |
options.maxTilesOverride? | number | Raises 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
| Parameter | Type | Description | |
|---|---|---|---|
analysisType? | string \ | null | The analysis type, or unset for the wind preset. |
Returns
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
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
| Name | Type |
|---|---|
coordinates? | readonly number\[\] |
coordinates_bin? | never |
indices? | readonly number\[\] |
indices_bin? | never |
Point
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
| Property | Modifier | Type | Description |
|---|---|---|---|
coordinates | readonly | readonly readonly Position\[\]\[\] | The rings of the polygon; an area run takes exactly one. |
type | readonly | "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
readonlymargin\_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
| Property | Modifier | Type | Description |
|---|---|---|---|
centroid | readonly | Point | Centre of the tile. |
empty | readonly | boolean | true when the tile's analysed square does not touch the polygon, so no job runs for it. |
size | readonly | object | Edge lengths of the analysed square, in metres. |
size.x | readonly | number | - |
size.y | readonly | number | - |
tileId | readonly | string | Identifier of the tile; it is the key of the tile in schedules and tile payloads. |
TILE_SIZE_CELLS
Import from @infrared-city/infrared-sdk.
constTILE\_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.
constTILE\_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.
constTILING\_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
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
| Parameter | Type | Description |
|---|---|---|
polygon | Polygon | The GeoJSON Polygon to check. |
Returns
The validated polygon, wound counter-clockwise.
Throws
when the polygon breaks any of the rules above; the message names the problem.