@urban-toolkit/autk-compute / AutkComputeEngine
Class: AutkComputeEngine
Defined in: compute.ts:41
Main compute engine for GPGPU analysis and render sampling.
AutkComputeEngine provides the package-level API for running analytical and render compute passes. It accepts GeoJSON feature collections and writes the results back to feature.properties.compute on the returned collection.
Example
const compute = new AutkComputeEngine();
await compute.gpgpuPipeline(params);Constructors
Constructor
new AutkComputeEngine():
AutkComputeEngine
Returns
AutkComputeEngine
Methods
gpgpuPipeline()
gpgpuPipeline(
params):Promise<FeatureCollection<Geometry,GeoJsonProperties>>
Defined in: compute.ts:62
Runs the GPGPU pipeline and writes results to feature.properties.compute.
Parameters
params
Pipeline parameters.
Returns
Promise<FeatureCollection<Geometry, GeoJsonProperties>>
Promise resolving to the input collection with computed values attached.
Throws
If resultField or outputColumns is missing, or WGSL identifiers are invalid.
Example
const engine = new AutkComputeEngine();
const result = await engine.gpgpuPipeline({
collection: fc,
variableMapping: { pop: 'properties.population' },
wgslBody: 'return pop * 1.5;',
resultField: 'scaledPop',
});renderPipeline()
renderPipeline(
params):Promise<FeatureCollection<Geometry,GeoJsonProperties>>
Defined in: compute.ts:80
Runs the render pipeline and writes metrics to feature.properties.compute.render.
Parameters
params
Pipeline parameters.
Returns
Promise<FeatureCollection<Geometry, GeoJsonProperties>>
Promise resolving to the viewpoints collection with aggregated render metrics.
Throws
If no layers are provided or tileSize is invalid.
Example
const engine = new AutkComputeEngine();
const result = await engine.renderPipeline({
layers: [{ id: 'b', collection: fc, type: 'buildings' }],
viewpoints: { collection: vpFC },
aggregation: { type: 'classes' },
});