Tiling
AreaGeometryGroups
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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 is not cut: it goes whole into every tile job whose context box (the tile plus a border of up to 128 m, depending on the analysis) it touches, 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-ts.
constCELL_SIZE_M:1=1
Edge length of one analysis grid cell, in metres.
ComposeOptions
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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. |
terrainContext? |
readonly |
TerrainContext |
Required when ground-geometry is present. |
composeTilePayloads
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/tiling.
A frame origin as longitude and latitude in WGS84 degrees.
Properties
| Property | Modifier | Type |
|---|---|---|
lat |
readonly |
number |
lon |
readonly |
number |
generateTilesForPolygon
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/tiling.
A tile with its position in the grid.
Properties
JsonTilingMesh
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/tiling.
A geographic point.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
latitude |
readonly |
number |
Latitude in degrees (-90 to 90). |
longitude |
readonly |
number |
Longitude in degrees (-180 to 180). |
Polygon
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/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-ts.
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-ts.
constTILE_SIZE_M:512=512
Edge length of one analysis tile, in metres.
TilePayloads
Import from @infrared-city/infrared-sdk-ts, @infrared-city/infrared-sdk-ts/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-ts.
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-ts, @infrared-city/infrared-sdk-ts/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-ts, @infrared-city/infrared-sdk-ts/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.