acquireGroundMaterials

Import from @infrared-city/infrared-sdk/geodata.

acquireGroundMaterials(bbox, options?): Promise<DirectGroundResult>

Read and compose ground materials for an area, returning parsed layers.

The same composition as acquireGroundMaterialsJson, parsed once for a caller that wants objects.

Parameters

ParameterTypeDescription
bboxBboxThe area's bounding box in WGS84 degrees.
optionsAcquireGroundOptionsRead and frame options.

Returns

Promise<DirectGroundResult>

The layers, the total feature count and the Overture release.

Throws

when the optional parquet reader packages are not installed.

Throws

when a data URL is not on the allow-list.


acquireGroundMaterialsArea

Import from @infrared-city/infrared-sdk/geodata.

acquireGroundMaterialsArea(site, options): Promise<GroundAreaResult>

Read, compose, merge and clean the ground materials of a whole site.

The site is read in chunks of about 2 x 2 km (one rectangle below 4 km2), each with its own road read and a shared Overture read of the site. The chunks are then composed, merged and cleaned in a single step, so no per-tile documents exist. If any chunk fails to read the whole call fails.

Parameters

ParameterTypeDescription
siteBboxThe site's bounding box in WGS84 degrees.
optionsAcquireGroundAreaOptionsCleaning extent, optional tile rectangles and read options.

Returns

Promise<GroundAreaResult>

The merged layers as JSON text, the Overture release and the chunks.

Throws

when one or more chunks cannot be read; it names every failed chunk.

Throws

when the optional parquet reader packages are not installed.


acquireGroundMaterialsJson

Import from @infrared-city/infrared-sdk/geodata.

acquireGroundMaterialsJson(bbox, options?): Promise<AcquireGroundJson>

Read and compose ground materials for an area, returning JSON text.

Reads OSM roads and the Overture base themes for the bounding box and composes them into material layers, clipped to the box. The result is left unparsed so it can be passed on without building objects.

Parameters

ParameterTypeDescription
bboxBboxThe area's bounding box in WGS84 degrees.
optionsAcquireGroundOptionsRead and frame options.

Returns

Promise<AcquireGroundJson>

The composed {material: FeatureCollection} JSON text and the Overture release it came from.

Throws

when the optional parquet reader packages are not installed.

Throws

when a data URL is not on the allow-list.


AreaGroundMaterials

Import from @infrared-city/infrared-sdk.

The ground materials read for a polygon area, from GroundMaterialsService.getArea. Pass it as groundMaterials to runArea.

Properties

PropertyModifierTypeDescription
analysisTypereadonlystringThe analysis the read margin was taken from.
executionTimereadonlynumberHow long the read took, in seconds.
failedTilesreadonlyreadonly string\[\]Tiles that could not be read. Always empty: a site is read as a whole, so it succeeds or fails as one.
layersreadonlyMaterialLayersThe cleaned material layers, by layer name; empty when the polygon has no tiles to read.
overtureRelease?readonlystringOverture release this area was read from. The index pointer moves daily, so a result without it is not reproducible; pass it back as overtureRelease to pin the read.
polygonreadonlyPolygonThe polygon the materials were read for.
readMarginMreadonlynumberHalf extent, in metres, of the rectangle every tile was read with: 363 for the wind analyses and 544 for the others. runArea refuses a run whose analysis needs a larger margin than this.
totalFeaturesreadonlynumberThe number of features across all layers.

cleanV3Local

Import from @infrared-city/infrared-sdk.

cleanV3Local(layers, params): MaterialLayers

Clean ground materials locally, using the initialized Infrared core.

The layers are cropped to params.distance metres around the point, stacked by material precedence rather than by the order of the keys in layers, and given a vertical offset per layer. An undefined zStep selects the default of 0.05 m. Cleaning the result a second time keeps the same material classification.

initializeCore() must have completed before you call it. The layers are serialized to JSON text and the result parsed back, so very large inputs cost one serialization and one parse.

Parameters

ParameterTypeDescription
layersMaterialLayersMaterial name to GeoJSON feature collection (WGS84 degrees).
paramsCleanV3ParamsThe centre point, crop distance and layer options.

Returns

MaterialLayers

The cleaned layers, keyed by material name.


CleanV3Params

Import from @infrared-city/infrared-sdk.

Parameters for cleaning ground-material layers around a point.

Properties

PropertyTypeDescription
defaultLayer?stringName of the default (background) material layer.
distancenumberDistance from the centre point to the edge of the cropped area, in metres.
latitudenumberLatitude of the centre point, in degrees.
longitudenumberLongitude of the centre point, in degrees.
zStep?numberVertical step between stacked material layers, in metres. Defaults to 0.05.

FeatureCollection

Import from @infrared-city/infrared-sdk.

A GeoJSON feature collection, as accepted by the ground-material cleaner.

Indexable

\[key: string\]: unknown

Properties

PropertyTypeDescription
features?Record<string, unknown>\[\]The GeoJSON features (polygons in WGS84 degrees).
type?stringThe GeoJSON type, normally "FeatureCollection".

FlatMesh

Import from @infrared-city/infrared-sdk.

One flat mesh returned by geojsonLayersToDotbim.

Properties

PropertyTypeDescription
coordinatesnumber\[\]Flat [x, y, z, ...] in metres. z is always 0.
indicesnumber\[\]Flat triangle vertex indices into coordinates.
mesh_idnumberAlways 0.

geojsonLayersToDotbim

Import from @infrared-city/infrared-sdk.

geojsonLayersToDotbim(layers): Record<string, FlatMesh\[\]>

Triangulates GeoJSON polygon layers into flat dotbim meshes.

Every Polygon, and every part of a MultiPolygon, becomes one mesh lying flat at z = 0. Holes are kept. Other geometry types produce no mesh, so a layer without polygons maps to an empty list.

All layers share one local frame: x points east and y points north, in metres, measured from the south-west corner of the whole input. That corner is the smallest longitude and the smallest latitude over every coordinate in every layer, including the coordinates of features that are not polygons. The projection is a tangent plane on a sphere of radius 6 371 000 m.

Each ring's closing vertex stays in coordinates, but no triangle uses it.

initializeCore() must have completed before you call it.

Parameters

ParameterTypeDescription
layersRecord<string, FeatureCollection>Layer key to GeoJSON feature collection, in WGS84 degrees ([longitude, latitude]). Keys are returned unchanged, in the same order.

Returns

Record<string, FlatMesh\[\]>

Layer key to the meshes of that layer, in feature order.

Throws

for a polygon that cannot be read or triangulated. The message names the layer.


GroundMaterialCleaner

Import from @infrared-city/infrared-sdk.

An asynchronous ground-material cleaner. Implement it to replace the built-in local cleaner.

Methods

cleanV3()

cleanV3(layers, params): Promise<MaterialLayers>

Clean the layers around the point given in params.

Parameters
ParameterTypeDescription
layersMaterialLayersMaterial name to GeoJSON feature collection.
paramsCleanV3ParamsThe centre point, crop distance and layer options.
Returns

Promise<MaterialLayers>

The cleaned layers.


GroundMaterialsCleaner

Import from @infrared-city/infrared-sdk.

GroundMaterialsCleaner = GroundMaterialCleaner

A cleaner of your own for the cleaner option of getArea: an object implementing GroundMaterialCleaner. Leave the option unset to clean with the SDK's built-in cleaner.


GroundMaterialsService

Import from @infrared-city/infrared-sdk.

Reads the ground materials (roads, water, parks and so on) around a point or a polygon from the public data hosts. Available as InfraredClient.groundMaterials.

Constructors

Constructor

new GroundMaterialsService(options): GroundMaterialsService

Creates the service from the client's transport settings (fetch, timeout and logger).

Parameters
ParameterType
optionsServiceOptions
Returns

GroundMaterialsService

Methods

getArea()

getArea(polygon, options?): Promise<AreaGroundMaterials>

Reads the material layers for a whole polygon area and cleans them, ready to pass to runArea as groundMaterials. Which tiles are read, and how far around each, follows the analysis (options.analysisType).

Parameters
ParameterTypeDescription
polygonPolygonThe GeoJSON polygon to cover.
options\{ analysisType?: string; cleaner?: GroundMaterialCleaner; defaultMaterial?: string; maxTilesOverride?: number; maxWorkers?: number; overtureRelease?: string; signal?: AbortSignal; zStep?: number; \}Read options; see each field.
options.analysisType?stringThe analysis this read is for. It decides the tile grid and the read margin: 363 m for the two wind analyses and 544 m for every other one, which needs shadow casters further out. Omit it for the widest margin, which is valid for every analysis.
options.cleaner?GroundMaterialCleanerA cleaner of your own; unset uses the built-in cleaner.
options.defaultMaterial?stringThe name of the background material layer; a built-in default when unset.
options.maxTilesOverride?numberRaises the limit on how many non-empty tiles the polygon may cover.
options.maxWorkers?numberThe most data chunks read at the same time; it can lower the built-in limit, not raise it.
options.overtureRelease?stringPin the Overture release this read uses.
options.signal?AbortSignalAborts the read.
options.zStep?numberThe vertical step between stacked material layers, in metres. Default 0.05.
Returns

Promise<AreaGroundMaterials>

The AreaGroundMaterials, with empty layers when the polygon has no tiles to read.

Throws

when the removed acquisition option is passed.


getRaw()

getRaw(lat, lon, distance): Promise<MaterialLayers \| null>

Reads the material layers of one square tile around a point.

Parameters
ParameterTypeDescription
latnumberCentre latitude in degrees.
lonnumberCentre longitude in degrees.
distancenumberHalf-width of the tile in metres.
Returns

Promise<MaterialLayers \| null>

The layers, or null when the tile has no material at all.


LocalCleaner

Import from @infrared-city/infrared-sdk.

A GroundMaterialCleaner that cleans locally with cleanV3Local.

Implements

Constructors

Constructor

new LocalCleaner(): LocalCleaner
Returns

LocalCleaner

Methods

cleanV3()

cleanV3(layers, params): Promise<MaterialLayers>

Clean the layers locally. Equivalent to calling cleanV3Local.

Parameters
ParameterTypeDescription
layersMaterialLayersMaterial name to GeoJSON feature collection.
paramsCleanV3ParamsThe centre point, crop distance and layer options.
Returns

Promise<MaterialLayers>

The cleaned layers.

Implementation of

GroundMaterialCleaner.cleanV3


MaterialLayers

Import from @infrared-city/infrared-sdk.

MaterialLayers = Record<string, FeatureCollection>

Ground material name to GeoJSON feature collection.


roadsToIrFeatures

Import from @infrared-city/infrared-sdk/geodata.

roadsToIrFeatures(features): Record<string, unknown>\[\]

Normalise road features read from the FlatGeobuf file into the shape the ground composer takes as input.

Use this when you already hold feature objects. The acquisition functions do not call it; they pass the road data on as text.

The id of a road comes from its @id property only. surface and lanes are read from the feature's own properties, where the world file does not carry them, so every road composes as asphalt.

Parameters

ParameterTypeDescription
featuresreadonly Record<string, unknown>\[\]Road features as read from the world FlatGeobuf file.

Returns

Record<string, unknown>\[\]

The normalised road features.