Skip to content

@bendyline/molen-worldgen-earth/kernel ​

Earth binding for Molen worldgen: terrain-semantics adapter, OSM label mapping, and lon/lat region atlas (kernel) with terrain tile renderers (client).

ts
import { /* … */ } from '@bendyline/molen-worldgen-earth/kernel';

Interfaces ​

AtlasRegion ​

Properties ​

bbox? ​
ts
optional bbox?: [number, number, number, number];

[minLon, minLat, maxLon, maxLat] in degrees; quick reject and sole geometry when no polygons.

bindings ​
ts
bindings: AtlasRegionBindings;
id ​
ts
id: string;
polygons? ​
ts
optional polygons?: [number, number][][];

WGS84 outer rings (union, no holes, no antimeridian crossing).

priority ​
ts
priority: number;

Higher wins where regions overlap.

title? ​
ts
optional title?: string;

AtlasRegionBindings ​

Properties ​

buildings ​
ts
buildings: StyleRule[];

Ordered style rules evaluated first for buildings inside the region.

default? ​
ts
optional default?: string;

Archstyle used inside the region when no region rule matches (before pack rules).

scatter? ​
ts
optional scatter?: string;

Scatter rule set for the region.

treeFillFactor? ​
ts
optional treeFillFactor?: number;

Synthetic tree fill around low-rise homes, 0..1. Zero disables it; inherits atlas default.


BusinessCatalog ​

A business identity catalog, resolved against the landmark models its signs use.

Properties ​

doc ​
ts
readonly doc: BusinessCatalogDoc;
hash ​
ts
readonly hash: string;

Hash of the validated catalog; a cache key for generated tiles.

profiles ​
ts
readonly profiles: readonly BusinessProfile[];
version ​
ts
readonly version: number;

Methods ​

resolve() ​
ts
resolve(poi): ResolvedBusiness | undefined;

Identify a mapped place, or undefined when it is not a business this catalog knows.

Parameters ​
poi ​

PoiIdentity

Returns ​

ResolvedBusiness | undefined


BusinessCatalogDoc ​

Properties ​

categories ​
ts
categories: object[];
id ​
ts
id: BusinessCategory;
kinds ​
ts
kinds: string[];
landmark ​
ts
landmark: string;
format ​
ts
format: "molen/business-catalog@1";
profiles ​
ts
profiles: object[];
aliases ​
ts
aliases: string[];
brandIds ​
ts
brandIds: string[];
categories ​
ts
categories: string[];
id ​
ts
id: string;
landmark ​
ts
landmark: string;
version ​
ts
version: number;

BusinessProfile ​

Properties ​

accent ​
ts
accent: string;
aliases ​
ts
aliases: readonly string[];
brandIds ​
ts
brandIds: readonly string[];
categories ​
ts
categories: readonly string[];
id ​
ts
id: string;
sign ​
ts
sign: string;
wall ​
ts
wall: string;

HistoricalStructureAppearance ​

A dated reconstruction that is never eligible for the default current-world view.

Properties ​

currentWorldEligible ​
ts
currentWorldEligible: false;
kind ​
ts
kind: "historical";
representedDate? ​
ts
optional representedDate?: string;
validFrom ​
ts
validFrom: string;

Inclusive ISO calendar date.

validUntil ​
ts
validUntil: string;

Exclusive ISO calendar date.


PlacesContent ​

Properties ​

businesses ​
ts
readonly businesses: BusinessCatalog;
landmarks ​
ts
readonly landmarks: LandmarkLibrary;

PlacesContentDocs ​

Places content as loaded documents; plain data, so it can be posted to a Worker.

Properties ​

businesses ​
ts
businesses: unknown;

A molen/business-catalog@1 document.

landmarks ​
ts
landmarks: LandmarkDocs;

ProjectedRegion ​

Properties ​

bounds ​
ts
bounds: WorldBounds;
polygons ​
ts
polygons: Vec2[][];
region ​
ts
region: AtlasRegion;

RegionAtlasDefaults ​

Properties ​

buildings ​
ts
buildings: StyleRule[];
scatter? ​
ts
optional scatter?: string;
style? ​
ts
optional style?: string;
treeFillFactor? ​
ts
optional treeFillFactor?: number;

Synthetic residential tree fill, 0..1. Omitted means disabled in unclassified regions.


RegionAtlasDoc ​

Properties ​

default ​
ts
default: RegionAtlasDefaults;

Worldwide fallback chain, evaluated after region bindings and before pack defaults.

doc? ​
ts
optional doc?: string;
format ​
ts
format: "molen/region-atlas@1";
id ​
ts
id: string;
regions ​
ts
regions: AtlasRegion[];
title ​
ts
title: string;
version ​
ts
version: number;

RegionResolver ​

Properties ​

atlas ​
ts
readonly atlas: RegionAtlasDoc;

Methods ​

intersecting() ​
ts
intersecting(bounds): AtlasRegion[];

Regions whose extent intersects a world rectangle.

Parameters ​
bounds ​

WorldBounds

Returns ​

AtlasRegion[]

resolve() ​
ts
resolve(x, z): AtlasRegion | undefined;

Highest-priority region containing a world point (document order breaks ties).

Parameters ​
x ​

number

z ​

number

Returns ​

AtlasRegion | undefined


RegionResolverOptions ​

Properties ​

metersPerUnit ​
ts
metersPerUnit: number;

cos(center latitude) factor the terrain package applies to Mercator meters.


ResolvedBusiness ​

Properties ​

accent ​
ts
accent: string;
category ​
ts
category: BusinessCategory;
matchedBy ​
ts
matchedBy: "name" | "brand" | "brand-id" | "category";
profile? ​
ts
optional profile?: BusinessProfile;
sharedWidth? ​
ts
optional sharedWidth?: number;
sign ​
ts
sign: string;
style? ​
ts
optional style?: string;
width? ​
ts
optional width?: number;

SemanticAdapterOptions ​

Extended by ​

Properties ​

atlas? ​
ts
optional atlas?: RegionAtlasDoc;
budgets? ​
ts
optional budgets?: Partial<WorldgenBudgets>;
buffer? ​
ts
optional buffer?: number;

Source clip buffer in tile units (default: the Protomaps basemap buffer).

features? ​
ts
optional features?: object;
buildings? ​
ts
optional buildings?: boolean;
interiors? ​
ts
optional interiors?: boolean;
scatter? ​
ts
optional scatter?: boolean;
keep? ​
ts
optional keep?: number;

Extra keep multiplier on top of the scatter tiers (default 1).

pack ​
ts
pack: ResolvedStylePack;
places? ​
ts
optional places?: PlacesContent;

Landmarks and business identities for mapped places. Without them, mapped businesses are not recognized and street furniture is not placed.

regions? ​
ts
optional regions?: RegionResolver;
tierOffset? ​
ts
optional tierOffset?: number;

Added to the detail tier derived from the level (economy quality starts one tier lower).


SemanticBatch ​

Extends ​

  • WorldgenBatchInput

Properties ​

budgets? ​
ts
optional budgets?: Partial<WorldgenBudgets>;
Inherited from ​
ts
WorldgenBatchInput.budgets
buildings ​
ts
buildings: BuildingRequest[];
Inherited from ​
ts
WorldgenBatchInput.buildings
clippedPieces ​
ts
clippedPieces: number;
fallbackStyle? ​
ts
optional fallbackStyle?: string;
Inherited from ​
ts
WorldgenBatchInput.fallbackStyle
ground? ​
ts
optional ground?: HeightSampler;
Inherited from ​
ts
WorldgenBatchInput.ground
interiors? ​
ts
optional interiors?: boolean;

Real ground-floor openings and lazy interior descriptors; needs the pack's interiors.

Inherited from ​
ts
WorldgenBatchInput.interiors
pack ​
ts
pack: ResolvedStylePack;
Inherited from ​
ts
WorldgenBatchInput.pack
props? ​
ts
optional props?: ModelPlacementRequest[];

Authored point placements, admitted before procedural scatter.

Inherited from ​
ts
WorldgenBatchInput.props
regionId? ​
ts
optional regionId?: string;
rules? ​
ts
optional rules?: StyleRule[];

Rules evaluated before the pack defaults (e.g. from a world binding).

Inherited from ​
ts
WorldgenBatchInput.rules
scatter? ​
ts
optional scatter?: ScatterRequest;
Inherited from ​
ts
WorldgenBatchInput.scatter
scatterId? ​
ts
optional scatterId?: string;
Overrides ​
ts
WorldgenBatchInput.scatterId
skippedByOwnership ​
ts
skippedByOwnership: number;

Building polygons this tile skipped because a neighbour owns them.

tier? ​
ts
optional tier?: number;

Detail tier for the batch (0 = full).

Inherited from ​
ts
WorldgenBatchInput.tier

StructureCatalogDoc ​

Properties ​

entries ​
ts
entries: StructurePlacement[];
format ​
ts
format: "molen/structure-placements@1";
rules? ​
ts
optional rules?: StructureMapRule[];
title ​
ts
title: string;

StructureIndex ​

Properties ​

cells ​
ts
readonly cells: ReadonlyMap<string, readonly StructurePlacement[]>;
entries ​
ts
readonly entries: readonly StructurePlacement[];
rules ​
ts
readonly rules: readonly StructureMapRule[];

Methods ​

query() ​
ts
query(bounds, options?): StructurePlacement[];

Geographic rectangle [west, south, east, north].

Parameters ​
bounds ​

readonly [number, number, number, number]

options? ​

boolean | StructureQueryOptions

Returns ​

StructurePlacement[]


StructureMapRule ​

A deliberately reusable model. Never inferred from a unique landmark's category.

Properties ​

asset ​
ts
asset: string;
dimensions ​
ts
dimensions: [number, number, number];

Native model dimensions in meters, in +X,+Y,+Z order. Base must be Y=0.

fit? ​
ts
optional fit?: "native" | "footprint";
id ​
ts
id: string;
lengthAxis? ​
ts
optional lengthAxis?: "x" | "z";
match ​
ts
match: object;

All supplied fields must match; values within each array are alternatives.

classes? ​
ts
optional classes?: string[];
subclasses? ​
ts
optional subclasses?: string[];
tags? ​
ts
optional tags?: Record<string, string[]>;
maxPerTile? ​
ts
optional maxPerTile?: number;
minLevel? ​
ts
optional minLevel?: number;
orientation? ​
ts
optional orientation?: "direction" | "longest-edge" | "north";
replaceFootprint? ​
ts
optional replaceFootprint?: boolean;

Also replace a nongeneralized building containing a matching point feature.

source ​
ts
source: string;
title ​
ts
title: string;

StructurePlacement ​

Properties ​

anchor ​
ts
anchor: [number, number];

[longitude, latitude], at the intended model origin.

appearance? ​
ts
optional appearance?: HistoricalStructureAppearance;
asset ​
ts
asset: string;
bounds? ​
ts
optional bounds?: [number, number, number, number];

WGS84 extent [west, south, east, north]. Extended models are clipped per resident tile.

datum? ​
ts
optional datum?: "terrain" | "sea-level";
elevation? ​
ts
optional elevation?: number;

Vertical offset from datum, in world meters (lake surfaces need not be sea level).

groundCutout? ​
ts
optional groundCutout?: object;

Ground opening in native model X/Z metres; active only while this structure is visible.

basis ​
ts
basis: string;
outline ​
ts
outline: [number, number][];
heading? ​
ts
optional heading?: number;

Rotation about +Y in radians, from the model's authored +Z front.

id ​
ts
id: string;
lengthAxis? ​
ts
optional lengthAxis?: "x" | "z";

Model horizontal axis aligned to the longest mapped edge (default +X).

mapIdentity? ​
ts
optional mapIdentity?: object;

Optional confirmed map identity used to refine orientation from a nearby feature.

maxDistance? ​
ts
optional maxDistance?: number;
names? ​
ts
optional names?: string[];
wikidata? ​
ts
optional wikidata?: string;
minLevel? ​
ts
optional minLevel?: number;

The model enters adaptive terrain at this level.

note? ​
ts
optional note?: string;
orientation? ​
ts
optional orientation?: "fixed" | "mapped";

Fixed is the catalog heading; mapped follows a confirmed footprint or bridge axis.

replaceFootprint? ​
ts
optional replaceFootprint?: boolean;

Only a contained, nongeneralized mapped footprint may be replaced.

replaceRoads? ​
ts
optional replaceRoads?: object;

Suppress mapped bridge centerlines inside this model-local rectangle (meters).

deckHeight? ​
ts
optional deckHeight?: number;
deckHeights? ​
ts
optional deckHeights?: [number, number];
includeConnectedApproaches? ​
ts
optional includeConnectedApproaches?: boolean;
length ​
ts
length: number;
outline? ​
ts
optional outline?: [number, number][];
width ​
ts
width: number;
scale? ​
ts
optional scale?: [number, number, number];

Multiplicative model scale; omitted means authored meters.

source ​
ts
source: string;
status ​
ts
status: "historical" | "preview" | "draft";

Draft records are never drawn; historical records require an explicit viewing date.

terrainReference? ​
ts
optional terrainReference?: object;

Ground at another known site point; modelHeight is that point's native model Y in metres.

anchor ​
ts
anchor: [number, number];
basis ​
ts
basis: string;
modelHeight ​
ts
modelHeight: number;
title ​
ts
title: string;

StructureQueryOptions ​

Properties ​

includeDraft? ​
ts
optional includeDraft?: boolean;

Inspection only: include every record regardless of status or date.

viewingDate? ​
ts
optional viewingDate?: string;

Explicit ISO calendar date for historical models. Omitted means current-world previews.


StyleSuggestion ​

Properties ​

regionId? ​
ts
optional regionId?: string;
variants ​
ts
variants: object[];
share ​
ts
share: number;
style ​
ts
style: string;
weight ​
ts
weight: number;

TileGeometry ​

Properties ​

level ​
ts
level: number;
levelBelowMax ​
ts
levelBelowMax: number;

0 at the finest level, 1 one level coarser, ...

metersPerUnit ​
ts
metersPerUnit: number;

cos(center latitude) factor between projected units and world meters.

originX ​
ts
originX: number;

World XZ of the tile corner (local (0, 0)).

originZ ​
ts
originZ: number;
size ​
ts
size: number;

Tile edge in world meters.

x ​
ts
x: number;
z ​
ts
z: number;

WorldgenTileInput ​

Extends ​

Properties ​

atlas? ​
ts
optional atlas?: RegionAtlasDoc;
Inherited from ​

SemanticAdapterOptions.atlas

budgets? ​
ts
optional budgets?: Partial<WorldgenBudgets>;
Inherited from ​

SemanticAdapterOptions.budgets

buffer? ​
ts
optional buffer?: number;

Source clip buffer in tile units (default: the Protomaps basemap buffer).

Inherited from ​

SemanticAdapterOptions.buffer

features? ​
ts
optional features?: object;
buildings? ​
ts
optional buildings?: boolean;
interiors? ​
ts
optional interiors?: boolean;
scatter? ​
ts
optional scatter?: boolean;
Inherited from ​

SemanticAdapterOptions.features

geom ​
ts
geom: TileGeometry;
ground ​
ts
ground: Pick<Heightfield, "sampleHeight" | "slopeAt" | "normalAt">;

World-space ground (a terrain heightfield); wrapped into tile-local meters.

keep? ​
ts
optional keep?: number;

Extra keep multiplier on top of the scatter tiers (default 1).

Inherited from ​

SemanticAdapterOptions.keep

pack ​
ts
pack: ResolvedStylePack;
Inherited from ​

SemanticAdapterOptions.pack

places? ​
ts
optional places?: PlacesContent;

Landmarks and business identities for mapped places. Without them, mapped businesses are not recognized and street furniture is not placed.

Inherited from ​

SemanticAdapterOptions.places

regions? ​
ts
optional regions?: RegionResolver;
Inherited from ​

SemanticAdapterOptions.regions

tierOffset? ​
ts
optional tierOffset?: number;

Added to the detail tier derived from the level (economy quality starts one tier lower).

Inherited from ​

SemanticAdapterOptions.tierOffset

tile ​
ts
tile: TerrainSemanticTile;

WorldgenTileOutput ​

Extends ​

  • WorldgenBatchOutput

Properties ​

buildingCells? ​
ts
optional buildingCells?: PreparedBuildingCell[];

Optional renderer preparation returned by the worker; source geometry remains canonical.

buildings? ​
ts
optional buildings?: MeshBuffers;
Inherited from ​
ts
WorldgenBatchOutput.buildings
clippedPieces ​
ts
clippedPieces: number;
generationMs? ​
ts
optional generationMs?: number;
hash ​
ts
hash: string;

sha256 over every output array; equal hashes mean byte-identical output.

Inherited from ​
ts
WorldgenBatchOutput.hash
placements ​
ts
placements: PlacementSet[];
Inherited from ​
ts
WorldgenBatchOutput.placements
preparationMs? ​
ts
optional preparationMs?: number;
records ​
ts
records: BuildingRecord[];
Inherited from ​
ts
WorldgenBatchOutput.records
regionId? ​
ts
optional regionId?: string;
scatterId? ​
ts
optional scatterId?: string;
skippedByOwnership ​
ts
skippedByOwnership: number;
stats ​
ts
stats: WorldgenStats;
Inherited from ​
ts
WorldgenBatchOutput.stats

WorldgenWorkerCancel ​

Properties ​

id ​
ts
id: number;
kind ​
ts
kind: "cancel";

WorldgenWorkerConfigure ​

Properties ​

atlas? ​
ts
optional atlas?: RegionAtlasDoc;
kind ​
ts
kind: "configure";
metersPerUnit ​
ts
metersPerUnit: number;
pack ​
ts
pack: ResolvedStylePack;
places? ​
ts
optional places?: PlacesContentDocs;

Places content as documents; the worker builds the libraries (none when omitted).


WorldgenWorkerGenerate ​

Properties ​

budgets? ​
ts
optional budgets?: Partial<WorldgenBudgets>;
features? ​
ts
optional features?: object;
buildings? ​
ts
optional buildings?: boolean;
interiors? ​
ts
optional interiors?: boolean;
scatter? ​
ts
optional scatter?: boolean;
geom ​
ts
geom: TileGeometry;
ground ​
ts
ground: HeightGrid;

Tile ground as a plain grid (transferable).

id ​
ts
id: number;
kind ​
ts
kind: "generate";
renderCellsOnly? ​
ts
optional renderCellsOnly?: boolean;
tierOffset? ​
ts
optional tierOffset?: number;
tile ​
ts
tile: TerrainSemanticTile;

WorldgenWorkerHandler ​

Methods ​

handle() ​
ts
handle(message): Promise<void>;

Handle one request; generation runs cooperatively and resolves when its result was posted.

Parameters ​
message ​

WorldgenWorkerRequest

Returns ​

Promise&lt;void&gt;


WorldgenWorkerPort ​

Methods ​

postMessage() ​
ts
postMessage(message, transfer?): void;
Parameters ​
message ​

unknown

transfer? ​

Transferable[]

Returns ​

void


WorldgenWorkerResult ​

Properties ​

cancelled? ​
ts
optional cancelled?: boolean;
error? ​
ts
optional error?: string;
id ​
ts
id: number;
kind ​
ts
kind: "result";
output? ​
ts
optional output?: WorldgenTileOutput;

Type Aliases ​

BusinessCategory ​

ts
type BusinessCategory = 
  | "grocery"
  | "restaurant"
  | "cafe"
  | "pharmacy"
  | "shop"
  | "mall"
  | "department_store"
  | "outlet_mall"
  | "strip_mall";

EdgeDecision ​

ts
type EdgeDecision = 
  | {
  mode: "whole";
}
  | {
  mode: "clipped";
  polygon: TerrainSemanticPolygon;
  seamEdges: number[];
}
  | {
  mode: "skip";
};

WorldBounds ​

ts
type WorldBounds = [number, number, number, number];

WorldgenQualityPreset ​

ts
type WorldgenQualityPreset = "economy" | "balanced" | "high";

WorldgenWorkerRequest ​

ts
type WorldgenWorkerRequest = 
  | WorldgenWorkerConfigure
  | WorldgenWorkerGenerate
  | WorldgenWorkerCancel;

Variables ​

PROTOMAPS_TILE_BUFFER ​

ts
const PROTOMAPS_TILE_BUFFER: number;

Protomaps basemap tiles carry a 64 / 4096 buffer.


REGION_ATLAS_EXAMPLE ​

ts
const REGION_ATLAS_EXAMPLE: JsonValue;

Functions ​

analyzeTileEdge() ​

ts
function analyzeTileEdge(polygon, buffer): EdgeDecision;

Decide whether this tile renders a footprint whole, clipped to the unit square, or not at all.

Parameters ​

polygon ​

TerrainSemanticPolygon

buffer ​

number

Returns ​

EdgeDecision


associateBusinesses() ​

ts
function associateBusinesses(
   tile, 
   pieces, 
   catalog
): BuildingOccupants;

Parameters ​

tile ​

TerrainSemanticTile

pieces ​

readonly BuildingPiece[]

catalog ​

BusinessCatalog

Returns ​

BuildingOccupants


buildingClipBuffer() ​

ts
function buildingClipBuffer(
   tile, 
   level, 
   buffer?
): number;

The clip buffer of a tile's building footprints. Footprints composed from a finer level (buildingSourceLevel, a building-detail sidecar) were cut at that level's buffer, which is 2^(source - tile level) times narrower in this tile's units.

Parameters ​

tile ​
buildingSourceLevel? ​

number

level ​

number

buffer? ​

number

Returns ​

number


buildingLabels() ​

ts
function buildingLabels(feature): string[];

Specific building use when present; generic outline/part tags never override that use.

Parameters ​

feature ​

TerrainBuildingFeature

Returns ​

string[]


contextLabelAt() ​

ts
function contextLabelAt(point, landcover): string | undefined;

Most specific mapped land use, then the smallest physical landcover polygon.

Parameters ​

point ​

TerrainSemanticPoint

landcover ​

readonly TerrainLandcoverFeature[]

Returns ​

string | undefined


createBusinessCatalog() ​

ts
function createBusinessCatalog(doc, landmarks): BusinessCatalog;

Validate a molen/business-catalog@1 document against a landmark library.

Parameters ​

doc ​

unknown

landmarks ​

LandmarkLibrary

Returns ​

BusinessCatalog


createPlacesContent() ​

ts
function createPlacesContent(docs): PlacesContent;

Validate places documents and build the libraries generation reads.

Parameters ​

docs ​

PlacesContentDocs

Returns ​

PlacesContent


createRegionResolver() ​

ts
function createRegionResolver(atlas, options): RegionResolver;

Parameters ​

atlas ​

RegionAtlasDoc

options ​

RegionResolverOptions

Returns ​

RegionResolver


createStructureIndex() ​

ts
function createStructureIndex(doc): StructureIndex;

Parameters ​

doc ​

StructureCatalogDoc

Returns ​

StructureIndex


createWorldgenWorkerHandler() ​

ts
function createWorldgenWorkerHandler(port): WorldgenWorkerHandler;

Parameters ​

port ​

WorldgenWorkerPort

Returns ​

WorldgenWorkerHandler


encodeStructureGeohash() ​

ts
function encodeStructureGeohash(
   longitude, 
   latitude, 
   length?
): string;

Standard geohash, kept here so the Earth pack does not depend on Qualla.

Parameters ​

longitude ​

number

latitude ​

number

length? ​

number

Returns ​

string


generateWorldgenTile() ​

ts
function generateWorldgenTile(input): WorldgenTileOutput;

Parameters ​

input ​

WorldgenTileInput

Returns ​

WorldgenTileOutput


generateWorldgenTileSteps() ​

ts
function generateWorldgenTileSteps(input, step?): Generator<WorldgenProgress, WorldgenTileOutput, void>;

Parameters ​

input ​

WorldgenTileInput

step? ​

number

Returns ​

Generator&lt;WorldgenProgress, WorldgenTileOutput, void&gt;


isHistoricalStructureAppearance() ​

ts
function isHistoricalStructureAppearance(value): value is HistoricalStructureAppearance;

Parameters ​

value ​

unknown

Returns ​

value is HistoricalStructureAppearance


isStructureViewingDate() ​

ts
function isStructureViewingDate(value): value is string;

Calendar-only ISO date validation without a clock, timezone, or Date dependency.

Parameters ​

value ​

unknown

Returns ​

value is string


landcoverAreaOf() ​

ts
function landcoverAreaOf(tile, geom): number;

Total land polygon area in the tile, in m² (diagnostics).

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

Returns ​

number


landcoverLabel() ​

ts
function landcoverLabel(feature): string;

Land label for scatter rules: class plus subclass so word matching sees both.

Parameters ​

feature ​

TerrainLandcoverFeature

Returns ​

string


mappedPropExclusions() ​

ts
function mappedPropExclusions(tile, size): ScatterExclusion[];

Exclude around mapped crowns (including neighbors' buffered records) before scattering.

Parameters ​

tile ​

TerrainSemanticTile

size ​

number

Returns ​

ScatterExclusion[]


mappedPropRequests() ​

ts
function mappedPropRequests(
   tile, 
   geom, 
   trees, 
   furniture
): ModelPlacementRequest[];

Mapped trees (when trees) and street furniture. Furniture is placed only for landmark models the furniture library holds; pass undefined for none.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

trees ​

boolean

furniture ​

Pick&lt;LandmarkLibrary, "get"&gt; | undefined

Returns ​

ModelPlacementRequest[]


matchMapStructures() ​

ts
function matchMapStructures(
   tile, 
   geometry, 
   rules, 
   geographic?, 
   maxPerTile?
): StructurePlacement[];

Emit at most 64 category structures per resident tile. Rule order defines preference.

Parameters ​

tile ​

TerrainSemanticTile

geometry ​

TileGeometry

rules ​

readonly StructureMapRule[]

geographic? ​

readonly StructurePlacement[]

maxPerTile? ​

number

Returns ​

StructurePlacement[]


orientMappedStructure() ​

ts
function orientMappedStructure(
   entry, 
   tile, 
   geometry
): StructurePlacement | undefined;

Resolve a named landmark only against its explicit identity, never category similarity.

Parameters ​

entry ​

StructurePlacement

tile ​

TerrainSemanticTile

geometry ​

TileGeometry

Returns ​

StructurePlacement | undefined


regionScatterId() ​

ts
function regionScatterId(atlas, region): string | undefined;

Scatter rule set id for a region, falling back to the atlas default (may be undefined).

Parameters ​

atlas ​

RegionAtlasDoc

region ​

AtlasRegion | undefined

Returns ​

string | undefined


regionStyleRules() ​

ts
function regionStyleRules(atlas, region): StyleRule[];

The ordered rule chain for a region: region rules, region default, atlas rules, atlas default.

Parameters ​

atlas ​

RegionAtlasDoc

region ​

AtlasRegion | undefined

Returns ​

StyleRule[]


registerBusinessCatalogSchema() ​

ts
function registerBusinessCatalogSchema(): void;

Returns ​

void


registerRegionAtlasSchema() ​

ts
function registerRegionAtlasSchema(): void;

Returns ​

void


registerStructurePlacementsSchema() ​

ts
function registerStructurePlacementsSchema(): void;

Returns ​

void


scatterRequestFromTile() ​

ts
function scatterRequestFromTile(
   tile, 
   geom, 
   avoid, 
   keep
): ScatterRequest;

Build the scatter request: land polygons with labels plus road, water, and building exclusions.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

avoid ​
buildings ​

number

roads ​

number

water ​

number

keep ​

number

Returns ​

ScatterRequest


semanticTileToBatch() ​

ts
function semanticTileToBatch(
   tile, 
   geom, 
   options
): SemanticBatch;

Turn a semantic tile into a batch input (without ground; the caller supplies the sampler).

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

options ​

SemanticAdapterOptions

Returns ​

SemanticBatch


suggestStructureStyles() ​

ts
function suggestStructureStyles(
   atlas, 
   longitude, 
   latitude, 
   metrics
): StyleSuggestion | undefined;

Inspect the same ordered atlas rules used by generation, without choosing a random variant.

Parameters ​

atlas ​

RegionAtlasDoc

longitude ​

number

latitude ​

number

metrics ​

BuildingMetrics

Returns ​

StyleSuggestion | undefined


tileGroundSampler() ​

ts
function tileGroundSampler(ground, geom): HeightSampler;

Tile-local sampler over a world-space heightfield.

Parameters ​

ground ​

Pick&lt;Heightfield, "sampleHeight" | "slopeAt" | "normalAt"&gt;

geom ​

TileGeometry

Returns ​

HeightSampler


validateBusinessCatalogDocuments() ​

ts
function validateBusinessCatalogDocuments(data, definitions): BusinessCatalogDoc;

Validate a catalog and check that every sign it names is a sign in definitions.

Parameters ​

data ​

unknown

definitions ​

LandmarkDefinitions

Returns ​

BusinessCatalogDoc


validateRegionAtlas() ​

ts
function validateRegionAtlas(data): ValidationIssue[];

Parameters ​

data ​

unknown

Returns ​

ValidationIssue[]


worldgenBuildingCellSize() ​

ts
function worldgenBuildingCellSize(levelBelowMax): number;

Edge of the spatial cells a tile's buildings are batched into, meters. Each cell is a draw (per material group up close), so the coarser levels, which cover four or sixteen times the ground and only switch detail far from the camera, use cells four times the area.

Parameters ​

levelBelowMax ​

number

Returns ​

number


worldgenTileBudgetForQuality() ​

ts
function worldgenTileBudgetForQuality(quality, levelBelowMax): WorldgenBudgets;

Per-tile budgets by quality and detail level. The finest level keeps every building: the largest get full detail, the rest a simplified facade (a row of windows per floor), then walls and roof alone, then an instanced stand-in once vertices run out. The level below it, which covers four times the ground, draws a few hundred simplified buildings and stands in the rest (pitched buildings as gabled boxes, so a neighbourhood seen from the air still reads as roofs). Coarser levels carry no buildings at all (the human-feature layer is level-bounded). Scatter shrinks with the level (see SCATTER_INSTANCES) and stops three levels below the finest.

The counts are sized for real footprints: a zoom-15 suburb has 800-1,600 houses per zoom-14 tile, and a downtown about 1,700 footprints and parts.

Parameters ​

quality ​

WorldgenQualityPreset

levelBelowMax ​

number

Returns ​

WorldgenBudgets

37 guides · 36 schema formats · 41 API entry points · 10 samples. API, CLI and schema pages are generated from the shipped build.