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 ​

AgricultureCrop ​

Properties ​

aliases ​
ts
aliases: string[];
color ​
ts
color: string;
growingMonths ​
ts
growingMonths: number;
id ​
ts
id: string;
interval ​
ts
interval: number;
kind ​
ts
kind: "annual" | "orchard" | "vineyard" | "pasture" | "fallow";
model ​
ts
model: string;
ripe ​
ts
ripe: string;
soil ​
ts
soil: string;
sowingMonth ​
ts
sowingMonth: number;

Sowing month in the northern hemisphere; shifted six months in the south.

spacing ​
ts
spacing: number;

Row spacing and along-row patch interval in meters.

variants? ​
ts
optional variants?: string[];

AgricultureProfile ​

Properties ​

crops ​
ts
crops: object[];

One crop is selected per field, not independently for each plant.

crop ​
ts
crop: string;
weight ​
ts
weight: number;
orchards? ​
ts
optional orchards?: object[];

Optional mixture for explicitly mapped permanent plantings.

crop ​
ts
crop: string;
weight ​
ts
weight: number;
tropical? ​
ts
optional tropical?: boolean;

Near-equatorial cultivation remains mature without an explicit source calendar.


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.


BuildingInfillOptions ​

Properties ​

density? ​
ts
optional density?: number;

Stable keep fraction, 0..1.

seed? ​
ts
optional seed?: number;

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;

EcologyArea ​

Properties ​

bounds ​
ts
bounds: [number, number, number, number];

Projected world rectangle; cells of the same region are merged along a row.

region ​
ts
region: Ecoregion | undefined;

EcologyAtlasDoc ​

Properties ​

cellDegrees ​
ts
cellDegrees: number;

Equal-angle global grid. North-to-south rows, west-to-east columns.

format ​
ts
format: "molen/ecology-atlas@1";
id ​
ts
id: string;
regions ​
ts
regions: Ecoregion[];
rows ​
ts
rows: number[][];

Each row alternates run length and region index + 1; zero means no source coverage.

source ​
ts
source: object;
citation ​
ts
citation: string;
interpretation ​
ts
interpretation: string;
license ​
ts
license: string;
sha256 ​
ts
sha256: string;
title ​
ts
title: string;
url ​
ts
url: string;
title ​
ts
title: string;
version ​
ts
version: number;

EcologyCell ​

Properties ​

bounds ​
ts
bounds: [number, number, number, number];

[west, south, east, north], WGS84 degrees.

column ​
ts
column: number;
region ​
ts
region: Ecoregion | undefined;
row ​
ts
row: number;

EcologyResolver ​

Properties ​

atlas ​
ts
readonly atlas: EcologyAtlasDoc;

Methods ​

areas() ​
ts
areas(bounds, maxAreas?): EcologyArea[] | undefined;

Bounded palette geometry. Undefined when a very coarse request exceeds maxAreas.

Parameters ​
bounds ​

[number, number, number, number]

maxAreas? ​

number

Returns ​

EcologyArea[] | undefined

at() ​
ts
at(longitude, latitude): Ecoregion | undefined;

Geographic lookup. Longitude wraps; invalid latitude or non-finite coordinates return nothing.

Parameters ​
longitude ​

number

latitude ​

number

Returns ​

Ecoregion | undefined

cellAt() ​
ts
cellAt(longitude, latitude): EcologyCell | undefined;
Parameters ​
longitude ​

number

latitude ​

number

Returns ​

EcologyCell | undefined

intersecting() ​
ts
intersecting(bounds): (Ecoregion | undefined)[];

Distinct cells' regions in a projected rectangle; includes undefined for uncovered ground.

Parameters ​
bounds ​

[number, number, number, number]

Returns ​

(Ecoregion | undefined)[]

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

Projected world-meter lookup in the same frame as terrain and the architectural atlas.

Parameters ​
x ​

number

z ​

number

Returns ​

Ecoregion | undefined


Ecoregion ​

Properties ​

biome ​
ts
biome: number;

RESOLVE terrestrial biome number (1..14); 0 means rock/ice or unclassified.

id ​
ts
id: number;

Stable identifier in the source dataset; never an array offset.

name ​
ts
name: string;
realm ​
ts
realm: 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.


LandSiteOptions ​

Properties ​

buffer? ​
ts
optional buffer?: number;

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

seed? ​
ts
optional seed?: number;

Re-rolls every layout.


MapOverride ​

A host's replacement for one rectangle of the mapped world.

Properties ​

area ​
ts
area: MapOverrideArea;
buildings? ​
ts
optional buildings?: readonly MapOverrideBuilding[];

At most 64.

clear? ​
ts
optional clear?: MapOverrideClear;

What is removed from the rectangle (see each flag's default).

id ​
ts
id: string;

Stable id, lowercase: letters, digits, ., _ and -; names the features it generates.

minLevel? ​
ts
optional minLevel?: number;

Coarsest tile level the map is edited at, 0 to 26 (default 11); landmarks hide at every level.

models? ​
ts
optional models?: readonly MapOverrideModel[];

At most 16.

props? ​
ts
optional props?: readonly MapOverrideProp[];

At most 256.

surface? ​
ts
optional surface?: MapOverrideSurface;

The ground of the cleared rectangle (default 'ground'); unused when vegetation is kept.


MapOverrideBuilding ​

A building generated where the override stands, by the same generator as the mapped city.

Properties ​

height? ​
ts
optional height?: number;

Meters above its base, up to 1000.

id ​
ts
id: string;

Unique among the override's buildings.

levels? ​
ts
optional levels?: number;

Floors, 1 to 200 (default 1 when there is no height).

minHeight? ​
ts
optional minHeight?: number;

Meters its base stands above the ground (default 0).

name? ​
ts
optional name?: string;
outline? ​
ts
optional outline?: MapOverridePoint[];

Footprint ring in the override's frame: 3 to 256 points, not self-crossing. Give this or rect.

rect? ​
ts
optional rect?: object;

A rectangular footprint instead of outline.

center? ​
ts
optional center?: MapOverridePoint;

Its center (default the area's).

heading? ​
ts
optional heading?: number;
size ​
ts
size: [number, number];
style? ​
ts
optional style?: string;

An architecture style id of the style pack; ignored when the pack has none by that id.

trim? ​
ts
optional trim?: string;

Trim color, #rrggbb.

use? ​
ts
optional use?: string;

What it is, as map data names buildings (warehouse, school, house): picks a default look.

wall? ​
ts
optional wall?: string;

Wall color, #rrggbb.


MapOverrideChange ​

What changed in a MapOverrideSet.

Properties ​

bounds ​
ts
bounds: readonly readonly [number, number, number, number][];

WGS84 [west, south, east, north] of everything those overrides clear or draw, as they were and as they are: the ground to build again.

ids ​
ts
ids: readonly string[];

Overrides added, replaced or removed.

revision ​
ts
revision: number;

The set's revision after the change.

tiles ​
ts
tiles: boolean;

The map itself changed; false when only fields this module ignores did (a host's bundles).


MapOverrideClear ​

What an override removes from its rectangle.

Properties ​

buildings? ​
ts
optional buildings?: boolean | "clip";

Mapped building footprints (default true): one at least half inside the rectangle goes whole, and one cut by a tile's edge or merged with its neighbors on a coarse tile is trimmed at the rectangle. 'clip' trims every footprint at the rectangle instead.

landmarks? ​
ts
optional landmarks?: boolean;

Catalogued landmark models anchored in the rectangle (default true).

parking? ​
ts
optional parking?: boolean;

Parking lots, their aisles and driveways, and the cars parked on them (default true).

props? ​
ts
optional props?: boolean;

Mapped street furniture: lamps, benches, bicycle racks, chargers (default true).

roads? ​
ts
optional roads?: boolean;

Roads and paths whose center line is in the rectangle (default false). Bridges, tunnels, graded approaches, railways and runways are never cut, and the ground keeps the grading the removed road gave it.

vegetation? ​
ts
optional vegetation?: boolean;

Land cover, scattered plants and mapped trees (default true).


MapOverrideFrame ​

Where an override's frame sits: its origin and compass heading.

Properties ​

center ​
ts
center: [number, number];
heading ​
ts
heading: number;

Radians.


MapOverrideModel ​

A model placed whole where the override stands: a landmark of the content packs, or the host's own.

Properties ​

asset ​
ts
asset: string;

A structure asset id of the style pack, or any ref the view's override assets load.

elevation? ​
ts
optional elevation?: number;

Meters above the ground at position (default 0).

heading? ​
ts
optional heading?: number;

Compass heading added to the area's, radians (default 0: the model's +Z front faces the frame's +z).

id ​
ts
id: string;

Unique among the override's models.

minLevel? ​
ts
optional minLevel?: number;

Coarsest tile level it is drawn at (default the override's, and 13 for the host's own models).

position ​
ts
position: MapOverridePoint;

Where the model's origin stands, in the override's frame.

scale? ​
ts
optional scale?: number | [number, number, number];

One factor or [x, y, z], each 0.01 to 100 (default 1).


MapOverridesDoc ​

Map overrides kept as a document: what a host passes a view, as data.

Properties ​

format ​
ts
format: "molen/map-overrides@1";
overrides ​
ts
overrides: MapOverride[];
title? ​
ts
optional title?: string;

MapOverrideSet ​

The overrides of one view. It keeps what it is given by reference (a host's own fields on an override, functions included, survive), so treat an override as immutable once set and set a new object to change it.

Type Parameters ​

T ​

T extends MapOverride = MapOverride

Properties ​

revision ​
ts
readonly revision: number;

Bumped by every change.

Methods ​

delete() ​
ts
delete(id): boolean;

Remove one; false when there was none by that id.

Parameters ​
id ​

string

Returns ​

boolean

forTile() ​
ts
forTile(geom, buffer?): readonly ResolvedMapOverride[];

The overrides that edit a tile: at or above their minLevel, reaching its square grown by buffer of its size (default the map tiles' own clip buffer). Ordered by id.

Parameters ​
geom ​

TileGeometry

buffer? ​

number

Returns ​

readonly ResolvedMapOverride[]

get() ​
ts
get(id): T | undefined;
Parameters ​
id ​

string

Returns ​

T | undefined

list() ​
ts
list(): readonly T[];
Returns ​

readonly T[]

query() ​
ts
query(bounds): readonly ResolvedMapOverride[];

The overrides reaching a WGS84 [west, south, east, north] rectangle. Ordered by id.

Parameters ​
bounds ​

readonly [number, number, number, number]

Returns ​

readonly ResolvedMapOverride[]

replace() ​
ts
replace(overrides): void;

Make the set exactly these, as one change. Throws, changing nothing, when any is invalid.

Parameters ​
overrides ​

readonly T[]

Returns ​

void

resolved() ​
ts
resolved(id): ResolvedMapOverride | undefined;

An override as laid out on the map.

Parameters ​
id ​

string

Returns ​

ResolvedMapOverride | undefined

set() ​
ts
set(override): void;

Add an override, or replace the one with its id. Throws, changing nothing, when it is invalid.

Parameters ​
override ​

T

Returns ​

void

subscribe() ​
ts
subscribe(listener): () => void;

Called after each change, in the same task. Returns the call that stops it.

Parameters ​
listener ​

(change) => void

Returns ​

() => void


MapOverrideStructureOptions ​

Properties ​

isCatalogAsset? ​
ts
optional isCatalogAsset?: (asset) => boolean;

Whether an asset ref is one the catalog's own model source streams with detail levels. Other refs are a host's own models, drawn at one detail level and so from nearer by default. Without it every ref is taken for the catalog's.

Parameters ​
asset ​

string

Returns ​

boolean


PartyWalls ​

Properties ​

edges ​
ts
edges: number[];

Outer-ring edge indices: edge i runs from vertex i to vertex i + 1.

length ​
ts
length: number;

Their total length and the whole outline's, meters.

perimeter ​
ts
perimeter: number;

PlacesContent ​

Properties ​

businesses ​
ts
readonly businesses: BusinessCatalog;
landmarks ​
ts
readonly landmarks: LandmarkLibrary;
signs? ​
ts
readonly optional signs?: SignNamer;

Present when signs show mapped names (see PlacesContentDocs.signNames).


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.

glyphs? ​
ts
optional glyphs?: unknown[];

molen/glyph-atlas@1 documents, in fallback order: the metrics names are laid out with. The page pixels stay with the renderer.

landmarks ​
ts
landmarks: LandmarkDocs;
signLooks? ​
ts
optional signLooks?: unknown;

A molen/sign-looks@1 document: how mapped names are set on storefront signs.

signNames? ​
ts
optional signNames?: "real" | "generic";

real (the default) shows mapped names on signs when signLooks and glyphs are present; generic keeps every sign's descriptor text, as without them.


ProjectedRegion ​

Properties ​

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

RegionalCatalogDoc ​

Properties ​

animals? ​
ts
optional animals?: WildlifeSpecies[];
crops? ​
ts
optional crops?: AgricultureCrop[];
format ​
ts
format: "molen/regional-catalog@1";
id ​
ts
id: string;
overrides ​
ts
overrides: string[];

IDs of profiles or scatter documents intentionally replaced from required catalogs.

plants? ​
ts
optional plants?: PlantPreset[];
populations? ​
ts
optional populations?: RegionalWildlifePopulation[];
profiles ​
ts
profiles: RegionalProfile[];
requires ​
ts
requires: object[];

Exact content versions; hosts must supply all required catalogs.

id ​
ts
id: string;
version ​
ts
version: number;
scatters ​
ts
scatters: ScatterDoc[];
stylePack? ​
ts
optional stylePack?: string;

Bind architecture to this style-pack identity. Other hosts omit this whole module.

title ​
ts
title: string;
version ​
ts
version: number;

RegionalContext ​

Properties ​

ecoregion? ​
ts
optional ecoregion?: Ecoregion;
regionId? ​
ts
optional regionId?: string;

RegionalEnvironment ​

Properties ​

docs ​
ts
readonly docs: RegionalEnvironmentDocs;
ecology ​
ts
readonly ecology: EcologyResolver | undefined;
hasEcology ​
ts
readonly hasEcology: boolean;

False for architecture-only modules: preserve the host's existing scatter and ground.

library ​
ts
readonly library: RegionalLibrary;
wildlifeRanges ​
ts
readonly wildlifeRanges: WildlifeRangeResolver | undefined;

Methods ​

agricultureAt() ​
ts
agricultureAt(x, z): RegionalSelection;
Parameters ​
x ​

number

z ​

number

Returns ​

RegionalSelection

at() ​
ts
at(x, z): RegionalSelection;
Parameters ​
x ​

number

z ​

number

Returns ​

RegionalSelection

modelAt() ​
ts
modelAt(
   model, 
   x, 
   z
): string;
Parameters ​
model ​

string

x ​

number

z ​

number

Returns ​

string

scatter() ​
ts
scatter(bounds): 
  | Pick<ScatterSampleInput, "doc" | "pack" | "acceptsRule" | "modelAt" | "treeline" | "crowns">
  | undefined;

Combined document shares one instance/model budget, with pointwise ecological filtering.

Parameters ​
bounds ​

WorldBounds

Returns ​

| Pick&lt;ScatterSampleInput, "doc" | "pack" | "acceptsRule" | "modelAt" | "treeline" | "crowns"&gt; | undefined

scatterAt() ​
ts
scatterAt(x, z): ScatterDoc | undefined;

Vegetation/ground channel only; avoids unrelated architectural polygon lookups.

Parameters ​
x ​

number

z ​

number

Returns ​

ScatterDoc | undefined

seasonAt() ​
ts
seasonAt(z): PlantSeason;
Parameters ​
z ​

number

Returns ​

PlantSeason

wildlife() ​
ts
wildlife(
   x, 
   z, 
   context?
): WildlifeChoice[];

Range + potential habitat + observed local context, before actual-surface placement.

Parameters ​
x ​

number

z ​

number

context? ​
protected? ​

boolean

waterDistance? ​

number

Returns ​

WildlifeChoice[]


RegionalEnvironmentDocs ​

Documents cross the worker boundary once; lookup caches and functions stay local.

Properties ​

atlas? ​
ts
optional atlas?: EcologyAtlasDoc;
catalogs ​
ts
catalogs: RegionalCatalogDoc[];
vegetationMonth? ​
ts
optional vegetationMonth?: number;

Explicit 1..12 calendar month; omission retains neutral leaf-on appearance.

wildlifeRanges? ​
ts
optional wildlifeRanges?: WildlifeRangesDoc;

RegionalLibrary ​

Properties ​

animals ​
ts
readonly animals: ReadonlyMap<string, WildlifeSpecies>;
catalogs ​
ts
readonly catalogs: readonly RegionalCatalogDoc[];
crops ​
ts
readonly crops: ReadonlyMap<string, AgricultureCrop>;
plants ​
ts
readonly plants: Readonly<Record<string, PlantPreset>>;
populations ​
ts
readonly populations: ReadonlyMap<string, RegionalWildlifePopulation>;
profiles ​
ts
readonly profiles: readonly RegionalProfile[];
scatters ​
ts
readonly scatters: ReadonlyMap<string, ScatterDoc>;
taxa ​
ts
readonly taxa: ReadonlyMap<string, PlantPreset>;

Methods ​

select() ​
ts
select(context): RegionalSelection;
Parameters ​
context ​

RegionalContext

Returns ​

RegionalSelection


RegionalMatch ​

Properties ​

biomes? ​
ts
optional biomes?: number[];

AND between dimensions, OR within each list. Omitted dimensions impose no constraint.

ecoregions? ​
ts
optional ecoregions?: number[];
realms? ​
ts
optional realms?: string[];
regions? ​
ts
optional regions?: string[];

Architectural atlas region IDs. Ecology-only profiles normally omit this.


RegionalProfile ​

Properties ​

agriculture? ​
ts
optional agriculture?: AgricultureProfile;
buildings? ​
ts
optional buildings?: StyleRule[];
id ​
ts
id: string;
match ​
ts
match: RegionalMatch;
priority ​
ts
priority: number;

Higher wins, separately in each channel. Equal-priority competing channels are errors.

scatter? ​
ts
optional scatter?: string;
title ​
ts
title: string;
wildlife? ​
ts
optional wildlife?: string;

RegionalSelection ​

Properties ​

agriculture? ​
ts
optional agriculture?: AgricultureProfile;
agricultureProfile? ​
ts
optional agricultureProfile?: string;
architectureProfile? ​
ts
optional architectureProfile?: string;
buildings? ​
ts
optional buildings?: StyleRule[];
ecologyProfile? ​
ts
optional ecologyProfile?: string;
scatter? ​
ts
optional scatter?: ScatterDoc;
wildlife? ​
ts
optional wildlife?: RegionalWildlifePopulation;
wildlifeProfile? ​
ts
optional wildlifeProfile?: string;

RegionalWildlifePopulation ​

Properties ​

id ​
ts
id: string;
rules ​
ts
rules: object[];
animal ​
ts
animal: string;
density ​
ts
density: number;
habitats ​
ts
habitats: string[];
match ​
ts
match: RegionalMatch;
nearWater? ​
ts
optional nearWater?: number;
protectedOnly? ​
ts
optional protectedOnly?: boolean;
title ​
ts
title: string;

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;
fallbackDistanceMeters? ​
ts
optional fallbackDistanceMeters?: number;

Nearest-outline fallback for coarse coastline gaps, in local world meters. Default 0.

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;
matchedAlias? ​
ts
optional matchedAlias?: string;

The catalog alias a brand or name match found, as the catalog writes it.

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;

ResolvedMapOverride ​

An override validated and laid out on the map. Planar coordinates are Web Mercator meters.

Properties ​

areaBounds ​
ts
readonly areaBounds: readonly [number, number, number, number];

Bounds of the rectangle alone.

axisX ​
ts
readonly axisX: Vec2;
axisZ ​
ts
readonly axisZ: Vec2;
bounds ​
ts
readonly bounds: readonly [number, number, number, number];

Bounds of everything the override clears or draws.

buildings ​
ts
readonly buildings: readonly ResolvedMapOverrideBuilding[];
center ​
ts
readonly center: readonly [number, number];

The frame's origin, [longitude, latitude], and compass heading, radians.

clear ​
ts
readonly clear: object;
buildings ​
ts
readonly buildings: boolean | "clip";
landmarks ​
ts
readonly landmarks: boolean;
parking ​
ts
readonly parking: boolean;
props ​
ts
readonly props: boolean;
roads ​
ts
readonly roads: boolean;
vegetation ​
ts
readonly vegetation: boolean;
cover ​
ts
readonly cover: string;

Land cover subclass of the cleared ground.

geoBounds ​
ts
readonly geoBounds: readonly [number, number, number, number];

The same as WGS84 [west, south, east, north].

half ​
ts
readonly half: Vec2;

Half the rectangle's width and depth, meters in the frame.

hash ​
ts
readonly hash: string;

Content hash of the fields the map edit reads; equal hashes edit a tile identically.

heading ​
ts
readonly heading: number;
id ​
ts
readonly id: string;
minLevel ​
ts
readonly minLevel: number;
models ​
ts
readonly models: readonly ResolvedMapOverrideModel[];
origin ​
ts
readonly origin: Vec2;

The origin in Web Mercator meters, and the frame's axes there: mercator = origin + axis * meters.

props ​
ts
readonly props: readonly ResolvedMapOverrideProp[];
ring ​
ts
readonly ring: readonly Vec2[];

The rectangle's four corners.


ResolvedMapOverrideBuilding ​

A host building as the tile edit injects it. Coordinates are Web Mercator meters.

Properties ​

bounds ​
ts
readonly bounds: readonly [number, number, number, number];
featureId ​
ts
readonly featureId: string;
height? ​
ts
readonly optional height?: number;
levels? ​
ts
readonly optional levels?: number;
minHeight? ​
ts
readonly optional minHeight?: number;
name? ​
ts
readonly optional name?: string;
ring ​
ts
readonly ring: readonly Vec2[];

Footprint ring, open, with positive shoelace area in (x, z).

style? ​
ts
readonly optional style?: string;
trim? ​
ts
readonly optional trim?: string;
use? ​
ts
readonly optional use?: string;
wall? ​
ts
readonly optional wall?: string;

ResolvedMapOverrideModel ​

A host model as the structure index offers it.

Properties ​

anchor ​
ts
readonly anchor: readonly [number, number];
asset ​
ts
readonly asset: string;
elevation ​
ts
readonly elevation: number;
id ​
ts
readonly id: string;

Placement id, override.<override id>.<model id>.

localId ​
ts
readonly localId: string;
minLevel? ​
ts
readonly optional minLevel?: number;

Set by the declaration; the index applies the defaults, which depend on where the asset comes from.

rotation ​
ts
readonly rotation: number;

Rotation about +Y, radians, as StructurePlacement.heading.

scale? ​
ts
readonly optional scale?: readonly [number, number, number];

ResolvedMapOverrideProp ​

A host prop as the tile edit injects it.

Properties ​

color? ​
ts
readonly optional color?: string;
crownDiameter? ​
ts
readonly optional crownDiameter?: number;
featureId ​
ts
readonly featureId: string;
height? ​
ts
readonly optional height?: number;
leafType? ​
ts
readonly optional leafType?: string;
model? ​
ts
readonly optional model?: string;

With poiClass the override prop class: the model ref, scale "sx,sy,sz" and tint.

poiClass ​
ts
readonly poiClass: string;

The POI class it travels as.

point ​
ts
readonly point: Vec2;

Web Mercator meters.

rotation ​
ts
readonly rotation: number;

Rotation about +Y, radians: the model's +Z front as placed.

scale? ​
ts
readonly optional scale?: string;
species? ​
ts
readonly optional species?: string;

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).

buildingInfill? ​
ts
optional buildingInfill?: boolean | BuildingInfillOptions;

Synthetic homes in dense streets with missing outlines; opt in with true or seed/density.

buildingInfillExclusions? ​
ts
optional buildingInfillExclusions?: TerrainSemanticPolygon[];

Additional occupied map polygons, e.g. original footprints replaced by landmarks.

environment? ​
ts
optional environment?: RegionalEnvironment;

Independent ecological geography and composable regional channels.

features? ​
ts
optional features?: object;
buildings? ​
ts
optional buildings?: boolean;
interiors? ​
ts
optional interiors?: boolean;
scatter? ​
ts
optional scatter?: boolean;
focus? ​
ts
optional focus?: readonly [number, number];

Where a viewer stands on the ground, in world X/Z. At the finest level the buildings within BUILDING_FOCUS_RADIUS of it take the tile's detail budget first, nearest first: the ones a walker can reach get their facades, entrances and interiors before the largest in the tile.

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
focus? ​
ts
optional focus?: object;

Where a viewer stands, in the buildings' own frame. Buildings within radius of it are queued nearest first, ahead of every other, so the batch's detail budget (and with it real entrances and interiors) goes to what the viewer can walk up to instead of to the largest footprints. Omitted, the queue is by priority and area alone.

radius ​
ts
radius: number;
x ​
ts
x: number;
z ​
ts
z: number;
Inherited from ​
ts
WorldgenBatchInput.focus
glyphs? ​
ts
optional glyphs?: GlyphAtlasSet;

Glyph atlas metrics for storefront names (StorefrontRequest.sign): with it, named storefronts build WorldgenBatchOutput.signs; without it they show their sign models.

Inherited from ​
ts
WorldgenBatchInput.glyphs
ground? ​
ts
optional ground?: HeightSampler;
Inherited from ​
ts
WorldgenBatchInput.ground
hashOutput? ​
ts
optional hashOutput?: boolean;

Hash the output (WorldgenBatchOutput.hash, default true). Streaming skips it, leaving the hash empty: SHA-256 over every array was a fifth of a batch's generation, and nothing reads it there. Compare outputs with hashWorldgenOutput instead.

Inherited from ​
ts
WorldgenBatchInput.hashOutput
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
regional? ​
ts
optional regional?: object;
ecoregions ​
ts
ecoregions: number[];
profileAtCenter? ​
ts
optional profileAtCenter?: string;
uncovered ​
ts
uncovered: boolean;
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
scatterEnvironment? ​
ts
optional scatterEnvironment?: Pick<ScatterSampleInput, "doc" | "pack" | "acceptsRule" | "modelAt" | "treeline" | "crowns">;

A composed scatter channel with its own identity and optional spatial rule gate.

Inherited from ​
ts
WorldgenBatchInput.scatterEnvironment
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

SignLook ​

How a sign sets a name: plate and letter colors, an optional accent band, a font role and case. Never a mark, emblem or brand typeface: a look gives a place the colors of its real counterpart, and the name is always set in the host's own faces.

Properties ​

case? ​
ts
optional case?: "as-is" | "upper";

upper capitalizes the name; default as mapped.

font? ​
ts
optional font?: string;

A glyph atlas role (bold, sans, serif) or face id; default the atlas's default face.

ink ​
ts
ink: string;
letterSpacing? ​
ts
optional letterSpacing?: number;

Extra advance between letters, em.

plate ​
ts
plate: string;
stripe? ​
ts
optional stripe?: string;

Accent band along the plate's lower edge.


SignLooksDoc ​

Properties ​

chains? ​
ts
optional chains?: Record<string, {
  display?: string;
  look?: Partial<SignLook>;
}>;

Catalog identities (business-catalog profile ids). A chain's look starts from its descriptor sign's palette (plate = background, letters = foreground, band = mark); look overrides any of it and display the name shown (default the profile's first alias, or a non-Latin alias the map matched, such as マクドナルド).

families ​
ts
families: Partial<Record<BusinessCategory, SignLook[]>>;

Looks for named places by category. A place takes one by a hash of its normalized name, so every branch of a local chain the catalog does not know still matches the others.

format ​
ts
format: "molen/sign-looks@1";
version ​
ts
version: number;

SignNamer ​

Properties ​

glyphs ​
ts
readonly glyphs: GlyphAtlasSet;
hash ​
ts
readonly hash: string;

Hash of the looks, the glyph atlas set and the catalog: part of a tile's cache key.

looks ​
ts
readonly looks: SignLooksDoc;

Methods ​

sign() ​
ts
sign(poi, business): StorefrontSign | undefined;

The sign for a recognized place, or undefined to keep its descriptor sign.

Parameters ​
poi ​

Pick&lt;TerrainPoiFeature, "name" | "nameLatin"&gt;

business ​

ResolvedBusiness

Returns ​

StorefrontSign | undefined


StructureCatalogDoc ​

Properties ​

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

StructureDirectory ​

Properties ​

cells ​
ts
cells: Record<string, string[]>;

Geohash2 coverage -> owning shards, including cross-boundary extents and identity searches.

format ​
ts
format: "molen/structure-placement-index@1";
shards ​
ts
shards: Record<string, StructureShard>;

StructureIndex ​

Extended by ​

Properties ​

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

Methods ​

dispose()? ​
ts
optional dispose(): void;

Release an optional regional loader when the owning content is closed.

Returns ​

void

isLoaded()? ​
ts
optional isLoaded(bounds): boolean;

False means coverage is not loaded; an empty synchronous query is then incomplete.

Parameters ​
bounds ​

readonly [number, number, number, number]

Returns ​

boolean

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

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

Parameters ​
bounds ​

readonly [number, number, number, number]

options? ​

boolean | StructureQueryOptions

Returns ​

StructurePlacement[]

queryAsync()? ​
ts
optional queryAsync(bounds, options?): Promise<StructurePlacement[]>;

Present for regional catalogs. Returned records do not depend on cache residency.

Parameters ​
bounds ​

readonly [number, number, number, number]

options? ​

StructureLoadOptions

Returns ​

Promise&lt;StructurePlacement[]&gt;


StructureLoadOptions ​

Extends ​

Properties ​

includeDraft? ​
ts
optional includeDraft?: boolean;

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

Inherited from ​

StructureQueryOptions.includeDraft

level? ​
ts
optional level?: number;

Skip regions whose placements all require finer tiles.

signal? ​
ts
optional signal?: AbortSignal;
viewingDate? ​
ts
optional viewingDate?: string;

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

Inherited from ​

StructureQueryOptions.viewingDate


StructureMapRule ​

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

Properties ​

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

Optional regional scope [west, south, east, north], WGS84 degrees.

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

Ground-relative model dimensions in meters, +X,+Y,+Z. Attachment plane is Y=0; footings may extend below.

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[];
names? ​
ts
optional names?: 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]. Ground-opening models stay whole; others clip per tile.

buildingCutout? ​
ts
optional buildingCutout?: object;

Remove only this native X/Z area from mapped buildings; overrides whole-footprint replacement.

basis? ​
ts
optional basis?: string;
minimumCoverage? ​
ts
optional minimumCoverage?: number;
outline ​
ts
outline: [number, number][];
outlines? ​
ts
optional outlines?: [number, number][][];
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.

additionalOutlines? ​
ts
optional additionalOutlines?: [number, number][][];
basis? ​
ts
optional basis?: string;
minHeight? ​
ts
optional minHeight?: number;
outline ​
ts
outline: [number, number][];
outlines? ​
ts
optional outlines?: [number, number][][];
pavingOutlines? ​
ts
optional pavingOutlines?: [number, number][][];
preservePaving? ​
ts
optional preservePaving?: boolean;
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?: StructureRoadReplacement & object;

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

Type Declaration ​
additionalDecks? ​
ts
optional additionalDecks?: StructureRoadReplacement[];

Separate decks of this model with their own mask and connection profile.

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.

surfacePassageIds? ​
ts
optional surfacePassageIds?: number[];

Exact map transportation IDs that run at grade through an authored structure.

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
optional basis?: string;
modelHeight ​
ts
modelHeight: number;
title ​
ts
title: string;
waterCutout? ​
ts
optional waterCutout?: object;

Replace only native water in these model-local X/Z polygons while the model is resident.

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

StructureQueryOptions ​

Extended by ​

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.


StructureRoadReplacement ​

Properties ​

bridgeFeatureIds? ​
ts
optional bridgeFeatureIds?: (string | number)[];

When present, only replace bridge centerlines with these source tile feature IDs.

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

Actual native X/Z road ends, ordered negative-X then positive-X, for curved crossings.

deckHeight? ​
ts
optional deckHeight?: number;

Uniform native deck Y, or separate native Y values at negative-X / positive-X ends.

deckHeights? ​
ts
optional deckHeights?: [number, number];
deckProfile? ​
ts
optional deckProfile?: [number, number, number][];

Native [X,Y,Z] centerline samples, ordered by X; height at intermediate side connections.

includeConnectedApproaches? ​
ts
optional includeConnectedApproaches?: boolean;

Also clip longitudinal road approaches and turning footways sharing a covered bridge endpoint.

includeTransverseBridges? ​
ts
optional includeTransverseBridges?: boolean;

Also replace transverse bridge-tagged segments inside the exact authored outline.

length ​
ts
length: number;
outline? ​
ts
optional outline?: [number, number][];

Optional exact native X/Z footprint; supersedes the rectangle for road suppression.

pavingAreaIds? ​
ts
optional pavingAreaIds?: (string | number)[];

IDs of mapped paving areas represented by the authored deck.

width ​
ts
width: number;

StructureShard ​

Properties ​

bytes ​
ts
bytes: number;
count ​
ts
count: number;
minLevel ​
ts
minLevel: number;
path ​
ts
path: string;

Pack-relative path; independently readable in a ZIP or directory pack.


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;

WildlifeRangeResolver ​

Methods ​

country() ​
ts
country(x, z): string | undefined;
Parameters ​
x ​

number

z ​

number

Returns ​

string | undefined

countryAt() ​
ts
countryAt(longitude, latitude): string | undefined;
Parameters ​
longitude ​

number

latitude ​

number

Returns ​

string | undefined

includes() ​
ts
includes(
   taxon, 
   x, 
   z
): boolean;
Parameters ​
taxon ​

string

x ​

number

z ​

number

Returns ​

boolean


WildlifeRangesDoc ​

Properties ​

cellDegrees ​
ts
cellDegrees: number;
countries ​
ts
countries: object[];
code ​
ts
code: string;
name ​
ts
name: string;
format ​
ts
format: "molen/wildlife-ranges@1";
id ​
ts
id: string;
rows ​
ts
rows: number[][];

North-to-south rows of [run length, country index + 1] pairs; 0 is uncovered.

sources ​
ts
sources: object[];
interpretation ​
ts
interpretation: string;
license ​
ts
license: string;
sha256 ​
ts
sha256: string;
title ​
ts
title: string;
url ​
ts
url: string;
taxa ​
ts
taxa: object[];
countries ​
ts
countries: string[];
id ​
ts
id: string;
name ​
ts
name: string;
sourceId ​
ts
sourceId: string;
title ​
ts
title: string;
version ​
ts
version: 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

buildingInfill? ​
ts
optional buildingInfill?: boolean | BuildingInfillOptions;

Synthetic homes in dense streets with missing outlines; opt in with true or seed/density.

Inherited from ​

SemanticAdapterOptions.buildingInfill

buildingInfillExclusions? ​
ts
optional buildingInfillExclusions?: TerrainSemanticPolygon[];

Additional occupied map polygons, e.g. original footprints replaced by landmarks.

Inherited from ​

SemanticAdapterOptions.buildingInfillExclusions

environment? ​
ts
optional environment?: RegionalEnvironment;

Independent ecological geography and composable regional channels.

Inherited from ​

SemanticAdapterOptions.environment

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

SemanticAdapterOptions.features

focus? ​
ts
optional focus?: readonly [number, number];

Where a viewer stands on the ground, in world X/Z. At the finest level the buildings within BUILDING_FOCUS_RADIUS of it take the tile's detail budget first, nearest first: the ones a walker can reach get their facades, entrances and interiors before the largest in the tile.

Inherited from ​

SemanticAdapterOptions.focus

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

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

hashOutput? ​
ts
optional hashOutput?: boolean;

See WorldgenBatchInput.hashOutput.

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. Empty when the input set hashOutput: false.

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
regional? ​
ts
optional regional?: object;
ecoregions ​
ts
ecoregions: number[];
profileAtCenter? ​
ts
optional profileAtCenter?: string;
uncovered ​
ts
uncovered: boolean;
regionId? ​
ts
optional regionId?: string;
scatterId? ​
ts
optional scatterId?: string;
signs? ​
ts
optional signs?: SignMeshBuffers;

Named storefront signs as one mesh; drawn with the glyph atlas's texture.

Inherited from ​
ts
WorldgenBatchOutput.signs
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;
environment? ​
ts
optional environment?: RegionalEnvironmentDocs;
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>;
buildingInfill? ​
ts
optional buildingInfill?: boolean | BuildingInfillOptions;
buildingInfillExclusions? ​
ts
optional buildingInfillExclusions?: TerrainSemanticPolygon[];
features? ​
ts
optional features?: object;
buildings? ​
ts
optional buildings?: boolean;
interiors? ​
ts
optional interiors?: boolean;
scatter? ​
ts
optional scatter?: boolean;
focus? ​
ts
optional focus?: readonly [number, number];
geom ​
ts
geom: TileGeometry;
ground ​
ts
ground: HeightGrid;

Tile ground as a plain grid (transferable).

id ​
ts
id: number;
keep? ​
ts
optional keep?: number;
kind ​
ts
kind: "generate";
packedInfillExclusions? ​
ts
optional packedInfillExclusions?: PackedPolygons;

The exclusions packed (see packPolygons), as a host thread sends them.

packet? ​
ts
optional packet?: TerrainSemanticTilePacket;
renderCellsOnly? ​
ts
optional renderCellsOnly?: boolean;
tierOffset? ​
ts
optional tierOffset?: number;
tile? ​
ts
optional tile?: TerrainSemanticTile;

The tile, or (from a host thread) its packet: cloning a town tile whole cost the host's main thread 5-10 ms (see terrainSemanticTilePacket).


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";
};

MapOverrideArea ​

ts
type MapOverrideArea = 
  | {
  center: [number, number];
  heading?: number;
  size: [number, number];
}
  | {
  bounds: [number, number, number, number];
};

The rectangle an override replaces.

Union Members ​

Type Literal ​
ts
{
  center: [number, number];
  heading?: number;
  size: [number, number];
}
center ​
ts
center: [number, number];

[longitude, latitude] of the rectangle's center, the origin of the override's frame.

heading? ​
ts
optional heading?: number;
size ​
ts
size: [number, number];

Type Literal ​
ts
{
  bounds: [number, number, number, number];
}
bounds ​
ts
bounds: [number, number, number, number];

WGS84 [west, south, east, north], at most 2000 m a side; the frame is north up.


MapOverridePoint ​

ts
type MapOverridePoint = [number, number];

A point in an override's frame: meters from the area's center, +x east and +z south at heading 0.


MapOverrideProp ​

ts
type MapOverrideProp = object & 
  | {
  crownDiameter?: number;
  height?: number;
  kind: "tree";
  leafType?: "broadleaved" | "needleleaved";
  species?: string;
}
  | {
  height?: number;
  kind: "street_lamp";
}
  | {
  kind: "bench" | "bike_rack" | "charger";
}
  | {
  color?: string;
  model: string;
  scale?: number | [number, number, number];
};

A small object drawn many at a time with the tile: street furniture, a tree, or a named model.

Type Declaration ​

heading? ​
ts
optional heading?: number;
id ​
ts
id: string;

Unique among the override's props.

position ​
ts
position: MapOverridePoint;

MapOverrideSurface ​

ts
type MapOverrideSurface = "ground" | "grass" | "paved" | "plaza" | "gravel" | "bare" | "sand";

The ground of a cleared rectangle.


WorldBounds ​

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

WorldgenQualityPreset ​

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

WorldgenWorkerRequest ​

ts
type WorldgenWorkerRequest = 
  | WorldgenWorkerConfigure
  | WorldgenWorkerGenerate
  | WorldgenWorkerCancel;

Variables ​

ATTACHED_LABEL ​

ts
const ATTACHED_LABEL: "attached" = "attached";

Label added (last) to a mapped building that shares a good part of its outline with its neighbours: a house in a row, a block in an old town. Style rules name it like any class.


ECOLOGY_ATLAS_EXAMPLE ​

ts
const ECOLOGY_ATLAS_EXAMPLE: EcologyAtlasDoc;

LAND_SITE_COLORS ​

ts
const LAND_SITE_COLORS: Readonly<Record<string, string>>;

Ground colors of the classes this module adds, for palettes that do not name them. Irrigated turf keeps one green in every habitat: a desert course is green fairways in tan rough.


MAP_OVERRIDE_COLOR_TAG ​

ts
const MAP_OVERRIDE_COLOR_TAG: "molen:color" = "molen:color";

On a MAP_OVERRIDE_PROP_CLASS POI: a tint, #rrggbb.


MAP_OVERRIDE_COVER_CLASS ​

ts
const MAP_OVERRIDE_COVER_CLASS: "cleared" = "cleared";

Land cover class of the ground a map override cleared. Its look is the feature's subclass and its density is 0: no plants are scattered on it, no parking, home canopy or synthetic homes are inferred across it.


MAP_OVERRIDE_HOST_MODEL_MIN_LEVEL ​

ts
const MAP_OVERRIDE_HOST_MODEL_MIN_LEVEL: 13 = 13;

Coarsest tile level a host's own model is drawn at by default: it has one detail level.


MAP_OVERRIDE_ID_PREFIX ​

ts
const MAP_OVERRIDE_ID_PREFIX: "override:" = "override:";

Feature id prefix: override:<override id>:<local id>.


MAP_OVERRIDE_LIMITS ​

ts
const MAP_OVERRIDE_LIMITS: object;

Limits a map override is validated against.

Type Declaration ​

areaSide ​
ts
readonly areaSide: readonly [number, number];
buildings ​
ts
readonly buildings: number;
buildingSide ​
ts
readonly buildingSide: number;
models ​
ts
readonly models: number;
outlinePoints ​
ts
readonly outlinePoints: number;
props ​
ts
readonly props: number;

MAP_OVERRIDE_MIN_LEVEL ​

ts
const MAP_OVERRIDE_MIN_LEVEL: 11 = 11;

Coarsest tile level an override edits by default, as landmarks appear.


MAP_OVERRIDE_MODEL_TAG ​

ts
const MAP_OVERRIDE_MODEL_TAG: "molen:model" = "molen:model";

On a MAP_OVERRIDE_PROP_CLASS POI: the model ref to place.


MAP_OVERRIDE_PROP_CLASS ​

ts
const MAP_OVERRIDE_PROP_CLASS: "molen_prop" = "molen_prop";

POI class of a host prop that names its own model (see MAP_OVERRIDE_MODEL_TAG).


MAP_OVERRIDE_SCALE_TAG ​

ts
const MAP_OVERRIDE_SCALE_TAG: "molen:scale" = "molen:scale";

On a MAP_OVERRIDE_PROP_CLASS POI: its scale, "sx,sy,sz" (default 1,1,1).


MAP_OVERRIDE_STYLE_TAG ​

ts
const MAP_OVERRIDE_STYLE_TAG: "molen:style" = "molen:style";

On a host building: an archstyle id of the style pack, used when the pack has it.


MAP_OVERRIDE_TAG ​

ts
const MAP_OVERRIDE_TAG: "molen:override" = "molen:override";

On every feature a map override injects; the value is the override's id.


MAP_OVERRIDE_TRIM_TAG ​

ts
const MAP_OVERRIDE_TRIM_TAG: "molen:trim" = "molen:trim";

On a host building: its trim color, #rrggbb.


MAP_OVERRIDE_WALL_TAG ​

ts
const MAP_OVERRIDE_WALL_TAG: "molen:wall" = "molen:wall";

On a host building: its wall color, #rrggbb.


MAX_SIGN_NAME_LENGTH ​

ts
const MAX_SIGN_NAME_LENGTH: 40 = 40;

Longest name a sign shows, in characters; a longer one keeps its category sign.


OPEN_GROUND_LABEL ​

ts
const OPEN_GROUND_LABEL: "open_ground" = "open_ground";

Scatter label for ground that no mapped landcover or land-use polygon covers.


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;

regionalCatalogSchema ​

ts
const regionalCatalogSchema: z.ZodType<RegionalCatalogDoc>;

SHOP_SHELL_CLASS ​

ts
const SHOP_SHELL_CLASS: "shop_shell" = "shop_shell";

Class a regional profile gives a style rule to when its shops are built as single-storey store shells wherever they stand (a North American arterial). Regions without one keep a shop's building, a house in a row or a block of flats, and give it a frontage.


wildlifeRangesSchema ​

ts
const wildlifeRangesSchema: z.ZodType<WildlifeRangesDoc>;

Functions ​

agriculturalPlantPresets() ​

ts
function agriculturalPlantPresets(plants, crops): Record<string, PlantPreset>;

Parameters ​

plants ​

Readonly&lt;Record&lt;string, PlantPreset&gt;&gt;

crops ​

ReadonlyMap&lt;string, AgricultureCrop&gt;

Returns ​

Record&lt;string, PlantPreset&gt;


agricultureStage() ​

ts
function agricultureStage(
   crop, 
   month, 
   z, 
   tropical?, 
   calendar?
): "sown" | "growing" | "mature" | "ripe" | "stubble";

Parameters ​

crop ​

AgricultureCrop

month ​

number | undefined

z ​

number

tropical? ​

boolean

calendar? ​
harvestMonth? ​

number

sowingMonth? ​

number

Returns ​

"sown" | "growing" | "mature" | "ripe" | "stubble"


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


analyzeWholeFootprint() ​

ts
function analyzeWholeFootprint(polygon): EdgeDecision;

Ownership of a footprint every tile holds complete: a map override's building, which is put unclipped into each tile it reaches. The tile holding its bounding box's center renders all of it and the others skip it. analyzeTileEdge cannot judge these: it takes an edge lying on a buffer line for the source's clip, which a north-aligned rectangle may well have, and it gives a footprint wider than a few tiles to no tile at all.

Parameters ​

polygon ​

TerrainSemanticPolygon

Returns ​

EdgeDecision


applyMapOverrides() ​

ts
function applyMapOverrides(
   tile, 
   geom, 
   overrides
): TerrainSemanticTile;

tile as the overrides leave it: mapped buildings, land cover, street furniture, parking and (when asked) roads removed from each rectangle, and the host's buildings and props added. overrides are those of MapOverrideSet.forTile(geom); ones that do not reach the tile or need a finer level are skipped. Returns tile itself when nothing changes.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

overrides ​

readonly ResolvedMapOverride[]

Returns ​

TerrainSemanticTile


associateBusinesses() ​

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

Parameters ​

tile ​

TerrainSemanticTile

pieces ​

readonly BuildingPiece[]

catalog ​

BusinessCatalog

Returns ​

BuildingOccupants


associatePartyWalls() ​

ts
function associatePartyWalls(pieces, tileSize): Map<BuildingPiece, PartyWalls>;

Party walls of every ground-standing piece. Pieces of one building (its mapped parts and what remains around them) are not each other's neighbours, and neither a host's building nor an inferred one takes part: those were placed, not surveyed.

Parameters ​

pieces ​

readonly BuildingPiece[]

tileSize ​

number

Returns ​

Map&lt;BuildingPiece, PartyWalls&gt;


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[]


checkEcologyAtlas() ​

ts
function checkEcologyAtlas(doc): void;

Check structural bounds before indexing or allocating any lookup tables.

Parameters ​

doc ​

EcologyAtlasDoc

Returns ​

void


cleanBusinessName() ​

ts
function cleanBusinessName(value): string | undefined;

A mapped name as a sign shows it, or undefined when nothing sign-worthy is left. NFKC folds full-width letters and brackets; decorative symbols and emoji (☆, ♪) go; a trailing store number (#1234), a trailing parenthesized qualifier ((Downtown), (阪急嵐山駅前)) and a Japanese branch name after a space (ローソン 京都駅前店) are dropped, as a storefront does not carry them. A name longer than MAX_SIGN_NAME_LENGTH is not shortened: it is returned undefined, and the place keeps its category sign.

Parameters ​

value ​

string

Returns ​

string | undefined


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


createEcologyResolver() ​

ts
function createEcologyResolver(atlas, metersPerUnit?): EcologyResolver;

Retains compressed rows and indexes run endpoints. A global grid never expands into millions of JS numbers. Mercator latitude boundaries are projected once, not once per plant.

Parameters ​

atlas ​

EcologyAtlasDoc

metersPerUnit? ​

number

Returns ​

EcologyResolver


createMapOverrideSet() ​

ts
function createMapOverrideSet<T>(initial?): MapOverrideSet<T>;

An empty set of map overrides, or one holding initial. Throws when any of those is invalid.

Type Parameters ​

T ​

T extends MapOverride = MapOverride

Parameters ​

initial? ​

readonly T[]

Returns ​

MapOverrideSet&lt;T&gt;


createPlacesContent() ​

ts
function createPlacesContent(docs): PlacesContent;

Validate places documents and build the libraries generation reads.

Parameters ​

docs ​

PlacesContentDocs

Returns ​

PlacesContent


createRegionalEnvironment() ​

ts
function createRegionalEnvironment(
   docs, 
   metersPerUnit, 
   regions?
): RegionalEnvironment;

Parameters ​

docs ​

RegionalEnvironmentDocs

metersPerUnit ​

number

regions? ​

RegionResolver

Returns ​

RegionalEnvironment


createRegionalLibrary() ​

ts
function createRegionalLibrary(catalogs, stylePack?): RegionalLibrary;

Resolve in dependency order, independent of pack load order. Reject accidental replacement.

Parameters ​

catalogs ​

readonly RegionalCatalogDoc[]

stylePack? ​

Pick&lt;ResolvedStylePack, "id" | "archstyles"&gt;

Returns ​

RegionalLibrary


createRegionResolver() ​

ts
function createRegionResolver(atlas, options): RegionResolver;

Parameters ​

atlas ​

RegionAtlasDoc

options ​

RegionResolverOptions

Returns ​

RegionResolver


createSignNamer() ​

ts
function createSignNamer(
   looksDoc, 
   glyphs, 
   catalog, 
   definitions
): SignNamer;

Parameters ​

looksDoc ​

unknown

glyphs ​

GlyphAtlasSet

catalog ​

BusinessCatalog

definitions ​

LandmarkDefinitions

Returns ​

SignNamer


createStructureIndex() ​

ts
function createStructureIndex(doc): StructureIndex;

Parameters ​

doc ​

StructureCatalogDoc

Returns ​

StructureIndex


createWildlifeRangeResolver() ​

ts
function createWildlifeRangeResolver(doc, metersPerUnit?): WildlifeRangeResolver;

Parameters ​

doc ​

WildlifeRangesDoc

metersPerUnit? ​

number

Returns ​

WildlifeRangeResolver


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;


inferBuildingFootprints() ​

ts
function inferBuildingFootprints(
   tile, 
   geom, 
   settings, 
   ground?, 
   excluded?, 
   styleAt?
): InferredBuildingFeature[];

Entire lots, including driveways, stay clear of occupied ground and have one public frontage.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

settings ​

boolean | BuildingInfillOptions

ground? ​

HeightSampler

excluded? ​

readonly TerrainSemanticPolygon[]

styleAt? ​

InfillStyleAt

Returns ​

InferredBuildingFeature[]


isAttached() ​

ts
function isAttached(walls, areaM2?): boolean;

Whether a building's party walls make it one of a row or a block.

Parameters ​

walls ​

PartyWalls | undefined

areaM2? ​

number

Returns ​

boolean


isHistoricalStructureAppearance() ​

ts
function isHistoricalStructureAppearance(value): value is HistoricalStructureAppearance;

Parameters ​

value ​

unknown

Returns ​

value is HistoricalStructureAppearance


isLatinText() ​

ts
function isLatinText(value): boolean;

Whether text is written in Latin letters (with digits, punctuation and accents).

Parameters ​

value ​

string

Returns ​

boolean


isMapOverrideFeature() ​

ts
function isMapOverrideFeature(feature): boolean;

Whether a tile feature was injected by a map override.

Parameters ​

feature ​
tags? ​

Readonly&lt;Record&lt;string, string&gt;&gt;

Returns ​

boolean


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


landSiteProps() ​

ts
function landSiteProps(
   tile, 
   geom, 
   settings?
): ModelPlacementRequest[];

Headstones for the cemeteries of a finest-level tile, as box placements for the batch. Rows and sections sit on a world grid, so a cemetery cut by a tile edge keeps its rows across it, and every stone belongs to the one tile its base is in.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

settings? ​

boolean | LandSiteOptions

Returns ​

ModelPlacementRequest[]


mapOverrideContains() ​

ts
function mapOverrideContains(
   override, 
   x, 
   z, 
   margin?
): boolean;

Whether a Web Mercator point is in an override's rectangle, grown by margin meters.

Parameters ​

override ​

ResolvedMapOverride

x ​

number

z ​

number

margin? ​

number

Returns ​

boolean


mapOverrideFeatureId() ​

ts
function mapOverrideFeatureId(overrideId, localId): string;

The id a map override gives the tile feature for one of its buildings, props or its ground.

Parameters ​

overrideId ​

string

localId ​

string

Returns ​

string


mapOverrideFrame() ​

ts
function mapOverrideFrame(area): MapOverrideFrame;

The frame an area lays its contents out in. Throws for an invalid area.

Parameters ​

area ​

MapOverrideArea

Returns ​

MapOverrideFrame


mapOverridePoint() ​

ts
function mapOverridePoint(frame, local): [number, number];

A point of an override's frame as [longitude, latitude]: the one conversion its buildings, props, models and whatever a host stands beside them (people, vehicles) all go through, so they line up. Meters are true at the frame's origin.

Parameters ​

frame ​

MapOverrideFrame

local ​

readonly [number, number]

Returns ​

[number, number]


mapOverrideTileKey() ​

ts
function mapOverrideTileKey(geom, overrides): string;

The key of an edit: the tile's geometry and each override reaching it, by content. Two edits of one tile with equal keys are equal.

Parameters ​

geom ​

TileGeometry

overrides ​

readonly ResolvedMapOverride[]

Returns ​

string


mappedPropExclusions() ​

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

Exclude around mapped crowns (including neighbors' buffered records) before scattering. With hostOnly, around a host's (map overrides) alone: the ones a coarser tile still places.

Parameters ​

tile ​

TerrainSemanticTile

size ​

number

hostOnly? ​

boolean

Returns ​

ScatterExclusion[]


mappedPropRequests() ​

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

Mapped trees (when trees) and street furniture. Furniture is placed only for landmark models the furniture library holds; pass undefined for none. Mapped objects are placed on the finest level only; a host's (map overrides) one level coarser too, as a place built on purpose should not lose its trees and lamps the moment its tile coarsens.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

trees ​

boolean

furniture ​

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

environment? ​

RegionalEnvironment

Returns ​

ModelPlacementRequest[]


matchesRegionalProfile() ​

ts
function matchesRegionalProfile(match, context): boolean;

Parameters ​

match ​

RegionalMatch

context ​

RegionalContext

Returns ​

boolean


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[]


normalizeBusinessName() ​

ts
function normalizeBusinessName(value): string;

Comparison form: NFKC, lower case, without apostrophes, spaces and .-_/.

Parameters ​

value ​

string

Returns ​

string


orientMappedStructure() ​

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

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

Parameters ​

entry ​

StructurePlacement

tile ​

TerrainSemanticTile

geometry ​

TileGeometry

identities? ​

TileIdentities

Returns ​

StructurePlacement | undefined


orientMappedStructures() ​

ts
function orientMappedStructures(
   entries, 
   tile, 
   geometry
): StructurePlacement[];

orientMappedStructure for each entry, indexing the tile's identities once. Each mapped structure near a tile looked itself up by scanning, and name-normalizing, all of the tile's buildings, places and roads: a dense city's tile held the main thread 18 ms.

Parameters ​

entries ​

readonly StructurePlacement[]

tile ​

TerrainSemanticTile

geometry ​

TileGeometry

Returns ​

StructurePlacement[]


overridePropRequests() ​

ts
function overridePropRequests(tile, geom): ModelPlacementRequest[];

The models a map override places by ref: its MAP_OVERRIDE_PROP_CLASS POIs, with the model, scale and tint their tags carry. Each tile the point reaches holds the POI, and the one whose unit square holds it places it, on the same levels as a host's other props.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

Returns ​

ModelPlacementRequest[]


parseStructureDirectory() ​

ts
function parseStructureDirectory(value): StructureDirectory;

Parameters ​

value ​

unknown

Returns ​

StructureDirectory


prepareAgricultureTile() ​

ts
function prepareAgricultureTile(
   tile, 
   geom, 
   environment
): object;

Pure and idempotent: workers and the surface renderer call this with identical content.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

environment ​

RegionalEnvironment | undefined

Returns ​

object

rules ​
ts
rules: ScatterRule[];
tile ​
ts
tile: TerrainSemanticTile;

prepareLandSites() ​

ts
function prepareLandSites(
   tile, 
   geom, 
   settings?
): TerrainSemanticTile;

Add the ground a mapped site implies to a tile's land cover. Pure, and the same for every tile a site crosses; the surface renderer and the batch adapter call it with identical content.

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

settings? ​

boolean | LandSiteOptions

Returns ​

TerrainSemanticTile


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


registerEcologyAtlasSchema() ​

ts
function registerEcologyAtlasSchema(): void;

Returns ​

void


registerMapOverridesSchema() ​

ts
function registerMapOverridesSchema(): void;

Register the molen/map-overrides@1 document with the schema registry (idempotent).

Returns ​

void


registerRegionalCatalogSchema() ​

ts
function registerRegionalCatalogSchema(): void;

Returns ​

void


registerRegionAtlasSchema() ​

ts
function registerRegionAtlasSchema(): void;

Returns ​

void


registerSignLooksSchema() ​

ts
function registerSignLooksSchema(): void;

Returns ​

void


registerStructurePlacementsSchema() ​

ts
function registerStructurePlacementsSchema(): void;

Returns ​

void


resolveMapOverride() ​

ts
function resolveMapOverride(override): ResolvedMapOverride;

Validate an override and lay it out on the map. Throws an Error naming the override and what is wrong; fields this module does not know (a host's own bundles) are ignored.

Parameters ​

override ​

MapOverride

Returns ​

ResolvedMapOverride


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, 
   ground?
): SemanticBatch;

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

Parameters ​

tile ​

TerrainSemanticTile

geom ​

TileGeometry

options ​

SemanticAdapterOptions

ground? ​

HeightSampler

Returns ​

SemanticBatch


structurePlacementBounds() ​

ts
function structurePlacementBounds(entry): GeographicBox[];

Parameters ​

entry ​

StructurePlacement

Returns ​

GeographicBox[]


structureRegionBounds() ​

ts
function structureRegionBounds(cell): [number, number, number, number];

Geohash2 cell bounds, independent of the current camera or loaded records.

Parameters ​

cell ​

string

Returns ​

[number, number, number, number]


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


unprojectMercator() ​

ts
function unprojectMercator(x, z): Vec2;

Web Mercator X/Z meters (+X east, +Z south) back to WGS84 [longitude, latitude] degrees: the inverse of projectWgs84, through dmath for the same reason.

Parameters ​

x ​

number

z ​

number

Returns ​

Vec2


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[]


validateSignLooks() ​

ts
function validateSignLooks(data, profiles): SignLooksDoc;

Validate a sign looks document; chains must name identities profiles knows.

Parameters ​

data ​

unknown

profiles ​

ReadonlySet&lt;string&gt;

Returns ​

SignLooksDoc


withMapOverrideStructures() ​

ts
function withMapOverrideStructures<T>(
   index, 
   set, 
   options?
): StructureIndex;

index as a view's map overrides leave it: without the catalogued landmarks anchored in a rectangle that clears them, and with the overrides' own models, which come first so a distant tile's cap on landmarks never drops them. It reads the set on every query, so a change to the set shows the next time a tile is built. The base index stays the content's to dispose.

Type Parameters ​

T ​

T extends MapOverride

Parameters ​

index ​

StructureIndex

set ​

MapOverrideSet&lt;T&gt;

options? ​

MapOverrideStructureOptions

Returns ​

StructureIndex


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, 
   options?
): 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

options? ​
compactBuildings? ​

boolean

Returns ​

WorldgenBudgets


worshipCrowns() ​

ts
function worshipCrowns(
   religion, 
   regionId, 
   areaM2
): BuildingCrown[];

Crowns for a place of worship of religion (the map's own word: christian, muslim, hindu, ...) in an architectural region, on a footprint of areaM2. Empty for traditions whose halls are told by their roof and materials alone, and for an unknown religion.

Parameters ​

religion ​

string | undefined

regionId ​

string | undefined

areaM2 ​

number

Returns ​

BuildingCrown[]

50 guides · 44 schema formats · 51 API entry points · 11 samples. API, CLI and schema pages are generated from the shipped build.