GeoPNG

GeoPNG

Analogous to a GeoTIFF file format, but in PNG form for easier editing. Single variable. Part of Geospatiale III.

Source:

Methods

(static) applyArealClamping(arg0_options) → {Float64Array}

Applies areal scaling or non-linear constraint clamping to a raster surface. Supports linear proportional scaling as well as variance-preserving logit adjustments.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

mask_pixel_indices Object

Pre-indexed pixels per region key.

mask_areas Object <optional>

Pre-indexed land areas per region key.

mode string <optional>
"linear"

'linear' | 'variance_preserving_logit'.

targets Object

Map of region key to target values.

weights Float64Array | Array.<number> <optional>

Pixel weights (e.g. population or GDP) for weighted aggregations.

max_iterations number <optional>
50

Binary search iterations for logit shift.

Returns:
Type:
Float64Array

Clamped pixel data.

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_optionsopt)

Transforms a PNG raster map to GeoJSON MultiPolygons, ignoring specified colours.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_file_path string
arg2_options Object <optional>
Name Type Attributes Description
ignore_colours Array.<Array.<number>> <optional>

List of [R, G, B, A] colours to skip.

(static) dasymetricBlur(arg0_optionsopt)

Dasymetrically blurs border regions where ushc regions are artificial/statistical artefacts.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
mask_data Array.<number> <optional>
pop_data Float64Array | Array.<number> <optional>

Data referencing population, alternatively any utility in which low values contribute to higher spread of the target variable.

target_data Float64Array | Array.<number> <optional>
height number <optional>
2160
width number <optional>
4320
radius number <optional>
64

The default brush radius/tolerance.

(static) dasymetricBlurTimeseries(arg0_options) → {Promise.<void>}

Blurs artificial administrative boundaries into smooth spatial population gradients across a timeseries sequence in parallel.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>
4
mask_raster string | Object
pop_path_function function

(year: number) => string.

radius number <optional>
64
target_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

Sequence of years to process.

Returns:
Type:
Promise.<void>

(static) dasymetricCohortScale(arg0_options) → {Promise.<void>}

Proportionally redistributes multiple demographic/economic cohort rasters to reconcile with an anchor population raster. Supports national fallback injection for coastline and spatial boundary mismatches.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Description
anchor_raster Object | string

Anchor total population raster (e.g. Stadestér).

cohort_keys Array.<string>

Keys identifying cohort surfaces.

cohort_path_function function

(cohort_key: string) => string.

geocode_obj Object <optional>

Map of RGB colour keys to ISO codes.

geocode_raster Object | string <optional>

Administrative geocode raster.

national_fractions Object <optional>

Map of ISO -> { [cohort_key]: fraction }.

output_path_function function

(cohort_key: string) => string.

Returns:
Type:
Promise.<void>

(static) dasymetricScale(arg0_options) → {Float64Array}

Scales an auxiliary surface to match target regional aggregates per spatial zone. Formula: V_i_new = V_i * (T_target / sum(V_k)).

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Description
data Float64Array | Array.<number>

Pixel data buffer to scale in-place or copy.

mask_pixel_indices Object

Map of region_key -> Array<pixel_index>.

targets Object

Map of region_key -> target total number.

Returns:
Type:
Float64Array

Dasymetrically scaled pixel buffer.

(static) executeParallelRaster(arg0_options) → {Promise.<Float64Array>}

Executes a raster calculation over a 2D domain in parallel using WebGL GPU shaders if available, or chunked multi-threaded asynchronous processing with cooperative yielding.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
chunk_size number <optional>
500

Rows per chunk for CPU yielding.

height number

Canvas height.

width number

Canvas width.

pixel_function function

(local_index: number) => number.

gpu_shader string <optional>

Optional WebGL fragment shader source for GPU acceleration.

Returns:
Type:
Promise.<Float64Array>

Resulting pixel data buffer.

(static) executeWorkerTask(arg0_task, arg1_optionsopt) → {Promise.<any>}

Dispatches a single task to the next available worker in the pool.

Source:
Parameters:
Name Type Attributes Description
arg0_task Object
arg1_options Object <optional>
Returns:
Type:
Promise.<any>

(static) generateDeltaSeries(arg0_output_folder_path, arg1_optionsopt) → {Promise.<void>}

Generates a delta series for a specific timeseries, used for later covariates.

Source:
Parameters:
Name Type Attributes Description
arg0_output_folder_path string
arg1_options Object <optional>
Name Type Attributes Default Description
input_format string <optional>
"int32"
input_format_function function <optional>

(arg0_year:number). Returns string representing the file path for the given year.

years Array.<number> <optional>
Returns:
Type:
Promise.<void>

(static) getCoastalWaterMask(arg0_land_area, arg1_buffer_distanceopt, arg2_optionsopt) → {Uint8Array}

Generates or retrieves from cache a boolean mask of continental coastal water cells. Water cells (land_area === 0) within buffer_distance of continental land (land_area > 0) are marked as 1, while open ocean island nations and interior water remain 0.

Source:
Parameters:
Name Type Attributes Default Description
arg0_land_area Object | string

Land area raster object or file path.

arg1_buffer_distance number <optional>
5

Coastal buffer radius in pixels.

arg2_options Object <optional>
Returns:
Type:
Uint8Array

(static) getImageSum(arg0_file_pathopt, arg1_optionsopt) → {number}

Fetches the total sum of all int/float values within an image.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object <optional>

The file path to the image or loaded raster image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) getLandwardBufferMask()

Alias for backwards compatibility.

Source:

(static) getPolygonCentroid(arg0_pixels) → {Array.<number>|null}

Returns the centroid of a given polygon, given its pixels.

Source:
Parameters:
Name Type Description
arg0_pixels Array.<Array.<number>>
Returns:
Type:
Array.<number> | null

(static) getRGBAFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {Array.<number>}

Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) getRasterNeighbourAverage(arg0_geopng_array, arg1_x, arg2_y, arg3_height, arg4_width) → {number}

Returns the average (assuming a number-formatted GeoPNG) of the Moore neighbourhood surrounding a pixel.

Source:
Parameters:
Name Type Description
arg0_geopng_array Array.<number>
arg1_x number
arg2_y number
arg3_height number
arg4_width number
Returns:
Type:
number

(static) getWorkerPool(arg0_optionsopt) → {Array.<Worker>}

Initialises and retrieves the persistent worker thread pool for geoprocessing.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Description
concurrency number <optional>

Custom worker thread count.

Returns:
Type:
Array.<Worker>

(static) indexArealMasks(arg0_options) → {Object}

Pre-indexes pixel indices and calculates total land area for each partition defined in areal_masks. Caches spatial topology to avoid redundant O(N) pixel loops across multi-year timeseries.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_masks Object

Metadata dictionary defining masks and colour keys.

land_area_raster Object | string

Land area raster object or file path.

mask_rasters Array.<(Object|string)>

Array of raster objects or file paths.

ignore_zero_land boolean <optional>
true

Skip pixels with zero or negative land area.

Returns:
Type:
Object

{ mask_areas: Object, mask_pixel_indices: Object, total_pixels: number, width: number, height: number }

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_optionsopt)

Robustly eliminates specific colours by binning them to the nearest available non-binned colour.

Source:
Parameters:
Name Type Attributes Description
arg0_input_path string
arg1_output_path string
arg2_options Object <optional>
Name Type Attributes Default Description
bin_colours Array.<(Array.<number>|Object)>

Colours to be destroyed (supports [r,g,b,a], [r,g,b,a,tol], or { colour, tolerance }).

ignore_colours Array.<(Array.<number>|Object)>

Colours to leave untouched.

bin_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for bin_colours.

ignore_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for ignore_colours.

(static) linearInterpolation(arg0_from_file_path, arg1_to_file_path, arg2_output_file_path, arg3_optionsopt) → {Object}

Interpolates between two number raster images based on a fraction.

Source:
Parameters:
Name Type Attributes Description
arg0_from_file_path string | Object
arg1_to_file_path string | Object
arg2_output_file_path string
arg3_options Object <optional>
Name Type Attributes Default Description
buffer_distance number <optional>
5

Pixel radius for coastal water buffer classification.

format string <optional>
"int32"

Either 'int32'/'float32'.

fraction number <optional>
0.5

The fraction to interpolate between the two images.

land_area_file Object | string <optional>

Land area raster path or object for landward/seaward masking.

land_area_raster Object | string <optional>

Alternative alias for land area input.

lower_value_threshold number <optional>

Lower-bound values that should not be interpolated (from raster).

upper_value_threshold number <optional>

Upper-bound values that should not be interpolated (to raster).

threshold_fraction number <optional>
0

2nd-order fraction to interpolate for values exceeding thresholds.

Returns:
Type:
Object

(static) loadImage(arg0_file_path, arg1_optionsopt) → {Object}

Loads an image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String

Input PNG file path.

arg1_options Object <optional>
Returns:
Type:
Object

(static) loadNumberFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {number}

Loads an int or float value from a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) loadNumberRasterImage(arg0_file_path, arg1_optionsopt) → {Object|Object}

Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

The file path to load or image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object | Object

(static) loadNumberRasterImageAsync(arg0_file_path, arg1_optionsopt) → {Promise.<{width: number, height: number, data: Float64Array}>}

Asynchronously loads a number raster image from a PNG file without blocking the event loop.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

File path or already-parsed raster object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

Returns:
Type:
Promise.<{width: number, height: number, data: Float64Array}>

(static) operateNumberRasterImage(arg0_optionsopt)

Runs an operation on a raster image for a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to load from.

format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

function function <optional>

(arg0_index, arg1_number)

(static) processArealTimeseries(arg0_options) → {Promise.<void>}

Concurrently processes a timeseries of rasters with areal constraint clamping.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_indexing Object

Pre-indexed geometry from GeoPNG.indexArealMasks.

concurrency number <optional>
4
mode string <optional>
"linear"
target_function function

(year: number) => Object mapping region_key -> target.

input_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

List of years to process.

Returns:
Type:
Promise.<void>

(static) processTimeseriesParallel(arg0_options) → {Promise.<Array.<any>>}

Concurrently processes an array of timeseries steps (e.g. years) with true multithreading / multiprocessing.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>

Max concurrent worker tasks. Defaults to optimal core allocation.

context Object <optional>

Optional shared context passed to worker handlers.

handler function <optional>

async (local_item: any, local_index: number, local_context: Object) => Promise.

items Array.<any>

Array of years or items to process.

name string <optional>
"Task"

Task name for logging.

task_generator function <optional>

(local_item: any, local_index: number) => task_object for worker.

use_workers boolean <optional>
true

Whether to use worker threads.

Returns:
Type:
Promise.<Array.<any>>

Array of task results matching items order.

(static) regulariseLogTail(arg0_options) → {Float64Array|Object}

Applies C1-continuous log-tail regularisation and robust IQR outlier management to a raster surface. Prevents explosive statistical boundaries while preserving local variance.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

fraction_only boolean <optional>
false

If true, outputs normalised [0, 1] fractions.

iqr_multiplier number <optional>
1.5

Multiplier on IQR to set outlier thresholds.

return_metadata boolean <optional>
false

If true, returns { data, reg_min, reg_max, reg_range, regularise }.

target_max number <optional>

Target maximum value to map regularised range to.

target_min number <optional>

Target minimum value to map regularised range to.

valid_filter function <optional>

(index: number) => boolean. If provided, restricts distribution analysis.

Returns:
Type:
Float64Array | Object

Regularised pixel data buffer or metadata object if return_metadata is true.

(static) saveNumberRasterImage(arg0_optionsopt)

Saves a number raster image to a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to save the image to.

format string <optional>
"int32"

How to save colours to the end image. Either 'int32'/'float32'/'greyscale'.

height number <optional>
1

The height of the image to save.

width number <optional>
1

The width of the image to save.

function function <optional>

(arg0_index) - The function to apply to each pixel. Must return a number. [0, 0, 0, 0] if undefined.

(static) saveNumberRasterImageAsync(arg0_options) → {Promise.<{width: number, height: number, data: Buffer}>}

Asynchronously encodes and writes a number raster image to disk.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Float32Array <optional>

Pre-evaluated buffer.

file_path string

Destination file path.

format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

function function <optional>

(local_index: number) => number.

height number <optional>
1
width number <optional>
1
Returns:
Type:
Promise.<{width: number, height: number, data: Buffer}>

(static) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_optionsopt) → {Array.<number>}

Saves an int/float value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object string | Object

The image object to use.

arg1_index number

The index of the pixel to save the number to.

arg2_number number | string

The number to save to the pixel.

arg3_options Object | string <optional>

Options object or format string ('int32', 'float32', 'greyscale').

Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) savePercentageRasterImage(arg0_input_file_path, arg1_output_file_path, arg2_optionsopt) → {Object}

Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type Attributes Description
arg0_input_file_path string

The file path to the number raster image to save the percentage raster image from.

arg1_output_file_path string

The file path to save the percentage raster image to.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object

(static) shatter(arg0_input_prefix, arg1_output_prefix, arg2_optionsopt) → {Promise.<(Object|undefined)>}

Shatters a temporal series of rasters into a combined unique areal mask raster and records its historical lineage.

Source:
Parameters:
Name Type Attributes Description
arg0_input_prefix string

The path prefix of the input PNG files (e.g. "path/to/gini_").

arg1_output_prefix string

The path prefix for output files (saves to ${prefix}_masks.png and ${prefix}_metadata.json).

arg2_options Object <optional>

Configuration options.

Name Type Attributes Default Description
years Array.<number> <optional>
[]

The temporal sequence of years to evaluate.

Returns:
Type:
Promise.<(Object|undefined)>

Traced lineage mapping RGBA pixel representations to chronological value paths.

(static) terminateAllWorkers()

Safely terminates all active background geoprocessing worker threads.

Source:

GeoPNG

Analogous to a GeoTIFF file format, but in PNG form for easier editing. Single variable. Part of Geospatiale III.

Source:

Methods

(static) applyArealClamping(arg0_options) → {Float64Array}

Applies areal scaling or non-linear constraint clamping to a raster surface. Supports linear proportional scaling as well as variance-preserving logit adjustments.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

mask_pixel_indices Object

Pre-indexed pixels per region key.

mask_areas Object <optional>

Pre-indexed land areas per region key.

mode string <optional>
"linear"

'linear' | 'variance_preserving_logit'.

targets Object

Map of region key to target values.

weights Float64Array | Array.<number> <optional>

Pixel weights (e.g. population or GDP) for weighted aggregations.

max_iterations number <optional>
50

Binary search iterations for logit shift.

Returns:
Type:
Float64Array

Clamped pixel data.

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_optionsopt)

Transforms a PNG raster map to GeoJSON MultiPolygons, ignoring specified colours.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_file_path string
arg2_options Object <optional>
Name Type Attributes Description
ignore_colours Array.<Array.<number>> <optional>

List of [R, G, B, A] colours to skip.

(static) dasymetricBlur(arg0_optionsopt)

Dasymetrically blurs border regions where ushc regions are artificial/statistical artefacts.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
mask_data Array.<number> <optional>
pop_data Float64Array | Array.<number> <optional>

Data referencing population, alternatively any utility in which low values contribute to higher spread of the target variable.

target_data Float64Array | Array.<number> <optional>
height number <optional>
2160
width number <optional>
4320
radius number <optional>
64

The default brush radius/tolerance.

(static) dasymetricBlurTimeseries(arg0_options) → {Promise.<void>}

Blurs artificial administrative boundaries into smooth spatial population gradients across a timeseries sequence in parallel.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>
4
mask_raster string | Object
pop_path_function function

(year: number) => string.

radius number <optional>
64
target_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

Sequence of years to process.

Returns:
Type:
Promise.<void>

(static) dasymetricCohortScale(arg0_options) → {Promise.<void>}

Proportionally redistributes multiple demographic/economic cohort rasters to reconcile with an anchor population raster. Supports national fallback injection for coastline and spatial boundary mismatches.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Description
anchor_raster Object | string

Anchor total population raster (e.g. Stadestér).

cohort_keys Array.<string>

Keys identifying cohort surfaces.

cohort_path_function function

(cohort_key: string) => string.

geocode_obj Object <optional>

Map of RGB colour keys to ISO codes.

geocode_raster Object | string <optional>

Administrative geocode raster.

national_fractions Object <optional>

Map of ISO -> { [cohort_key]: fraction }.

output_path_function function

(cohort_key: string) => string.

Returns:
Type:
Promise.<void>

(static) dasymetricScale(arg0_options) → {Float64Array}

Scales an auxiliary surface to match target regional aggregates per spatial zone. Formula: V_i_new = V_i * (T_target / sum(V_k)).

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Description
data Float64Array | Array.<number>

Pixel data buffer to scale in-place or copy.

mask_pixel_indices Object

Map of region_key -> Array<pixel_index>.

targets Object

Map of region_key -> target total number.

Returns:
Type:
Float64Array

Dasymetrically scaled pixel buffer.

(static) executeParallelRaster(arg0_options) → {Promise.<Float64Array>}

Executes a raster calculation over a 2D domain in parallel using WebGL GPU shaders if available, or chunked multi-threaded asynchronous processing with cooperative yielding.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
chunk_size number <optional>
500

Rows per chunk for CPU yielding.

height number

Canvas height.

width number

Canvas width.

pixel_function function

(local_index: number) => number.

gpu_shader string <optional>

Optional WebGL fragment shader source for GPU acceleration.

Returns:
Type:
Promise.<Float64Array>

Resulting pixel data buffer.

(static) executeWorkerTask(arg0_task, arg1_optionsopt) → {Promise.<any>}

Dispatches a single task to the next available worker in the pool.

Source:
Parameters:
Name Type Attributes Description
arg0_task Object
arg1_options Object <optional>
Returns:
Type:
Promise.<any>

(static) generateDeltaSeries(arg0_output_folder_path, arg1_optionsopt) → {Promise.<void>}

Generates a delta series for a specific timeseries, used for later covariates.

Source:
Parameters:
Name Type Attributes Description
arg0_output_folder_path string
arg1_options Object <optional>
Name Type Attributes Default Description
input_format string <optional>
"int32"
input_format_function function <optional>

(arg0_year:number). Returns string representing the file path for the given year.

years Array.<number> <optional>
Returns:
Type:
Promise.<void>

(static) getCoastalWaterMask(arg0_land_area, arg1_buffer_distanceopt, arg2_optionsopt) → {Uint8Array}

Generates or retrieves from cache a boolean mask of continental coastal water cells. Water cells (land_area === 0) within buffer_distance of continental land (land_area > 0) are marked as 1, while open ocean island nations and interior water remain 0.

Source:
Parameters:
Name Type Attributes Default Description
arg0_land_area Object | string

Land area raster object or file path.

arg1_buffer_distance number <optional>
5

Coastal buffer radius in pixels.

arg2_options Object <optional>
Returns:
Type:
Uint8Array

(static) getImageSum(arg0_file_pathopt, arg1_optionsopt) → {number}

Fetches the total sum of all int/float values within an image.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object <optional>

The file path to the image or loaded raster image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) getLandwardBufferMask()

Alias for backwards compatibility.

Source:

(static) getPolygonCentroid(arg0_pixels) → {Array.<number>|null}

Returns the centroid of a given polygon, given its pixels.

Source:
Parameters:
Name Type Description
arg0_pixels Array.<Array.<number>>
Returns:
Type:
Array.<number> | null

(static) getRGBAFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {Array.<number>}

Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) getRasterNeighbourAverage(arg0_geopng_array, arg1_x, arg2_y, arg3_height, arg4_width) → {number}

Returns the average (assuming a number-formatted GeoPNG) of the Moore neighbourhood surrounding a pixel.

Source:
Parameters:
Name Type Description
arg0_geopng_array Array.<number>
arg1_x number
arg2_y number
arg3_height number
arg4_width number
Returns:
Type:
number

(static) getWorkerPool(arg0_optionsopt) → {Array.<Worker>}

Initialises and retrieves the persistent worker thread pool for geoprocessing.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Description
concurrency number <optional>

Custom worker thread count.

Returns:
Type:
Array.<Worker>

(static) indexArealMasks(arg0_options) → {Object}

Pre-indexes pixel indices and calculates total land area for each partition defined in areal_masks. Caches spatial topology to avoid redundant O(N) pixel loops across multi-year timeseries.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_masks Object

Metadata dictionary defining masks and colour keys.

land_area_raster Object | string

Land area raster object or file path.

mask_rasters Array.<(Object|string)>

Array of raster objects or file paths.

ignore_zero_land boolean <optional>
true

Skip pixels with zero or negative land area.

Returns:
Type:
Object

{ mask_areas: Object, mask_pixel_indices: Object, total_pixels: number, width: number, height: number }

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_optionsopt)

Robustly eliminates specific colours by binning them to the nearest available non-binned colour.

Source:
Parameters:
Name Type Attributes Description
arg0_input_path string
arg1_output_path string
arg2_options Object <optional>
Name Type Attributes Default Description
bin_colours Array.<(Array.<number>|Object)>

Colours to be destroyed (supports [r,g,b,a], [r,g,b,a,tol], or { colour, tolerance }).

ignore_colours Array.<(Array.<number>|Object)>

Colours to leave untouched.

bin_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for bin_colours.

ignore_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for ignore_colours.

(static) linearInterpolation(arg0_from_file_path, arg1_to_file_path, arg2_output_file_path, arg3_optionsopt) → {Object}

Interpolates between two number raster images based on a fraction.

Source:
Parameters:
Name Type Attributes Description
arg0_from_file_path string | Object
arg1_to_file_path string | Object
arg2_output_file_path string
arg3_options Object <optional>
Name Type Attributes Default Description
buffer_distance number <optional>
5

Pixel radius for coastal water buffer classification.

format string <optional>
"int32"

Either 'int32'/'float32'.

fraction number <optional>
0.5

The fraction to interpolate between the two images.

land_area_file Object | string <optional>

Land area raster path or object for landward/seaward masking.

land_area_raster Object | string <optional>

Alternative alias for land area input.

lower_value_threshold number <optional>

Lower-bound values that should not be interpolated (from raster).

upper_value_threshold number <optional>

Upper-bound values that should not be interpolated (to raster).

threshold_fraction number <optional>
0

2nd-order fraction to interpolate for values exceeding thresholds.

Returns:
Type:
Object

(static) loadImage(arg0_file_path, arg1_optionsopt) → {Object}

Loads an image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String

Input PNG file path.

arg1_options Object <optional>
Returns:
Type:
Object

(static) loadNumberFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {number}

Loads an int or float value from a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) loadNumberRasterImage(arg0_file_path, arg1_optionsopt) → {Object|Object}

Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

The file path to load or image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object | Object

(static) loadNumberRasterImageAsync(arg0_file_path, arg1_optionsopt) → {Promise.<{width: number, height: number, data: Float64Array}>}

Asynchronously loads a number raster image from a PNG file without blocking the event loop.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

File path or already-parsed raster object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

Returns:
Type:
Promise.<{width: number, height: number, data: Float64Array}>

(static) operateNumberRasterImage(arg0_optionsopt)

Runs an operation on a raster image for a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to load from.

format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

function function <optional>

(arg0_index, arg1_number)

(static) processArealTimeseries(arg0_options) → {Promise.<void>}

Concurrently processes a timeseries of rasters with areal constraint clamping.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_indexing Object

Pre-indexed geometry from GeoPNG.indexArealMasks.

concurrency number <optional>
4
mode string <optional>
"linear"
target_function function

(year: number) => Object mapping region_key -> target.

input_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

List of years to process.

Returns:
Type:
Promise.<void>

(static) processTimeseriesParallel(arg0_options) → {Promise.<Array.<any>>}

Concurrently processes an array of timeseries steps (e.g. years) with true multithreading / multiprocessing.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>

Max concurrent worker tasks. Defaults to optimal core allocation.

context Object <optional>

Optional shared context passed to worker handlers.

handler function <optional>

async (local_item: any, local_index: number, local_context: Object) => Promise.

items Array.<any>

Array of years or items to process.

name string <optional>
"Task"

Task name for logging.

task_generator function <optional>

(local_item: any, local_index: number) => task_object for worker.

use_workers boolean <optional>
true

Whether to use worker threads.

Returns:
Type:
Promise.<Array.<any>>

Array of task results matching items order.

(static) regulariseLogTail(arg0_options) → {Float64Array|Object}

Applies C1-continuous log-tail regularisation and robust IQR outlier management to a raster surface. Prevents explosive statistical boundaries while preserving local variance.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

fraction_only boolean <optional>
false

If true, outputs normalised [0, 1] fractions.

iqr_multiplier number <optional>
1.5

Multiplier on IQR to set outlier thresholds.

return_metadata boolean <optional>
false

If true, returns { data, reg_min, reg_max, reg_range, regularise }.

target_max number <optional>

Target maximum value to map regularised range to.

target_min number <optional>

Target minimum value to map regularised range to.

valid_filter function <optional>

(index: number) => boolean. If provided, restricts distribution analysis.

Returns:
Type:
Float64Array | Object

Regularised pixel data buffer or metadata object if return_metadata is true.

(static) saveNumberRasterImage(arg0_optionsopt)

Saves a number raster image to a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to save the image to.

format string <optional>
"int32"

How to save colours to the end image. Either 'int32'/'float32'/'greyscale'.

height number <optional>
1

The height of the image to save.

width number <optional>
1

The width of the image to save.

function function <optional>

(arg0_index) - The function to apply to each pixel. Must return a number. [0, 0, 0, 0] if undefined.

(static) saveNumberRasterImageAsync(arg0_options) → {Promise.<{width: number, height: number, data: Buffer}>}

Asynchronously encodes and writes a number raster image to disk.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Float32Array <optional>

Pre-evaluated buffer.

file_path string

Destination file path.

format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

function function <optional>

(local_index: number) => number.

height number <optional>
1
width number <optional>
1
Returns:
Type:
Promise.<{width: number, height: number, data: Buffer}>

(static) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_optionsopt) → {Array.<number>}

Saves an int/float value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object string | Object

The image object to use.

arg1_index number

The index of the pixel to save the number to.

arg2_number number | string

The number to save to the pixel.

arg3_options Object | string <optional>

Options object or format string ('int32', 'float32', 'greyscale').

Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) savePercentageRasterImage(arg0_input_file_path, arg1_output_file_path, arg2_optionsopt) → {Object}

Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type Attributes Description
arg0_input_file_path string

The file path to the number raster image to save the percentage raster image from.

arg1_output_file_path string

The file path to save the percentage raster image to.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object

(static) shatter(arg0_input_prefix, arg1_output_prefix, arg2_optionsopt) → {Promise.<(Object|undefined)>}

Shatters a temporal series of rasters into a combined unique areal mask raster and records its historical lineage.

Source:
Parameters:
Name Type Attributes Description
arg0_input_prefix string

The path prefix of the input PNG files (e.g. "path/to/gini_").

arg1_output_prefix string

The path prefix for output files (saves to ${prefix}_masks.png and ${prefix}_metadata.json).

arg2_options Object <optional>

Configuration options.

Name Type Attributes Default Description
years Array.<number> <optional>
[]

The temporal sequence of years to evaluate.

Returns:
Type:
Promise.<(Object|undefined)>

Traced lineage mapping RGBA pixel representations to chronological value paths.

(static) terminateAllWorkers()

Safely terminates all active background geoprocessing worker threads.

Source:

GeoPNG

Analogous to a GeoTIFF file format, but in PNG form for easier editing. Single variable. Part of Geospatiale III.

Source:

Methods

(static) applyArealClamping(arg0_options) → {Float64Array}

Applies areal scaling or non-linear constraint clamping to a raster surface. Supports linear proportional scaling as well as variance-preserving logit adjustments.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

mask_pixel_indices Object

Pre-indexed pixels per region key.

mask_areas Object <optional>

Pre-indexed land areas per region key.

mode string <optional>
"linear"

'linear' | 'variance_preserving_logit'.

targets Object

Map of region key to target values.

weights Float64Array | Array.<number> <optional>

Pixel weights (e.g. population or GDP) for weighted aggregations.

max_iterations number <optional>
50

Binary search iterations for logit shift.

Returns:
Type:
Float64Array

Clamped pixel data.

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_optionsopt)

Transforms a PNG raster map to GeoJSON MultiPolygons, ignoring specified colours.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_file_path string
arg2_options Object <optional>
Name Type Attributes Description
ignore_colours Array.<Array.<number>> <optional>

List of [R, G, B, A] colours to skip.

(static) dasymetricBlur(arg0_optionsopt)

Dasymetrically blurs border regions where ushc regions are artificial/statistical artefacts.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
mask_data Array.<number> <optional>
pop_data Float64Array | Array.<number> <optional>

Data referencing population, alternatively any utility in which low values contribute to higher spread of the target variable.

target_data Float64Array | Array.<number> <optional>
height number <optional>
2160
width number <optional>
4320
radius number <optional>
64

The default brush radius/tolerance.

(static) dasymetricBlurTimeseries(arg0_options) → {Promise.<void>}

Blurs artificial administrative boundaries into smooth spatial population gradients across a timeseries sequence in parallel.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>
4
mask_raster string | Object
pop_path_function function

(year: number) => string.

radius number <optional>
64
target_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

Sequence of years to process.

Returns:
Type:
Promise.<void>

(static) dasymetricCohortScale(arg0_options) → {Promise.<void>}

Proportionally redistributes multiple demographic/economic cohort rasters to reconcile with an anchor population raster. Supports national fallback injection for coastline and spatial boundary mismatches.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Description
anchor_raster Object | string

Anchor total population raster (e.g. Stadestér).

cohort_keys Array.<string>

Keys identifying cohort surfaces.

cohort_path_function function

(cohort_key: string) => string.

geocode_obj Object <optional>

Map of RGB colour keys to ISO codes.

geocode_raster Object | string <optional>

Administrative geocode raster.

national_fractions Object <optional>

Map of ISO -> { [cohort_key]: fraction }.

output_path_function function

(cohort_key: string) => string.

Returns:
Type:
Promise.<void>

(static) dasymetricScale(arg0_options) → {Float64Array}

Scales an auxiliary surface to match target regional aggregates per spatial zone. Formula: V_i_new = V_i * (T_target / sum(V_k)).

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Description
data Float64Array | Array.<number>

Pixel data buffer to scale in-place or copy.

mask_pixel_indices Object

Map of region_key -> Array<pixel_index>.

targets Object

Map of region_key -> target total number.

Returns:
Type:
Float64Array

Dasymetrically scaled pixel buffer.

(static) executeParallelRaster(arg0_options) → {Promise.<Float64Array>}

Executes a raster calculation over a 2D domain in parallel using WebGL GPU shaders if available, or chunked multi-threaded asynchronous processing with cooperative yielding.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
chunk_size number <optional>
500

Rows per chunk for CPU yielding.

height number

Canvas height.

width number

Canvas width.

pixel_function function

(local_index: number) => number.

gpu_shader string <optional>

Optional WebGL fragment shader source for GPU acceleration.

Returns:
Type:
Promise.<Float64Array>

Resulting pixel data buffer.

(static) executeWorkerTask(arg0_task, arg1_optionsopt) → {Promise.<any>}

Dispatches a single task to the next available worker in the pool.

Source:
Parameters:
Name Type Attributes Description
arg0_task Object
arg1_options Object <optional>
Returns:
Type:
Promise.<any>

(static) generateDeltaSeries(arg0_output_folder_path, arg1_optionsopt) → {Promise.<void>}

Generates a delta series for a specific timeseries, used for later covariates.

Source:
Parameters:
Name Type Attributes Description
arg0_output_folder_path string
arg1_options Object <optional>
Name Type Attributes Default Description
input_format string <optional>
"int32"
input_format_function function <optional>

(arg0_year:number). Returns string representing the file path for the given year.

years Array.<number> <optional>
Returns:
Type:
Promise.<void>

(static) getCoastalWaterMask(arg0_land_area, arg1_buffer_distanceopt, arg2_optionsopt) → {Uint8Array}

Generates or retrieves from cache a boolean mask of continental coastal water cells. Water cells (land_area === 0) within buffer_distance of continental land (land_area > 0) are marked as 1, while open ocean island nations and interior water remain 0.

Source:
Parameters:
Name Type Attributes Default Description
arg0_land_area Object | string

Land area raster object or file path.

arg1_buffer_distance number <optional>
5

Coastal buffer radius in pixels.

arg2_options Object <optional>
Returns:
Type:
Uint8Array

(static) getImageSum(arg0_file_pathopt, arg1_optionsopt) → {number}

Fetches the total sum of all int/float values within an image.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object <optional>

The file path to the image or loaded raster image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) getLandwardBufferMask()

Alias for backwards compatibility.

Source:

(static) getPolygonCentroid(arg0_pixels) → {Array.<number>|null}

Returns the centroid of a given polygon, given its pixels.

Source:
Parameters:
Name Type Description
arg0_pixels Array.<Array.<number>>
Returns:
Type:
Array.<number> | null

(static) getRGBAFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {Array.<number>}

Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) getRasterNeighbourAverage(arg0_geopng_array, arg1_x, arg2_y, arg3_height, arg4_width) → {number}

Returns the average (assuming a number-formatted GeoPNG) of the Moore neighbourhood surrounding a pixel.

Source:
Parameters:
Name Type Description
arg0_geopng_array Array.<number>
arg1_x number
arg2_y number
arg3_height number
arg4_width number
Returns:
Type:
number

(static) getWorkerPool(arg0_optionsopt) → {Array.<Worker>}

Initialises and retrieves the persistent worker thread pool for geoprocessing.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Description
concurrency number <optional>

Custom worker thread count.

Returns:
Type:
Array.<Worker>

(static) indexArealMasks(arg0_options) → {Object}

Pre-indexes pixel indices and calculates total land area for each partition defined in areal_masks. Caches spatial topology to avoid redundant O(N) pixel loops across multi-year timeseries.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_masks Object

Metadata dictionary defining masks and colour keys.

land_area_raster Object | string

Land area raster object or file path.

mask_rasters Array.<(Object|string)>

Array of raster objects or file paths.

ignore_zero_land boolean <optional>
true

Skip pixels with zero or negative land area.

Returns:
Type:
Object

{ mask_areas: Object, mask_pixel_indices: Object, total_pixels: number, width: number, height: number }

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_optionsopt)

Robustly eliminates specific colours by binning them to the nearest available non-binned colour.

Source:
Parameters:
Name Type Attributes Description
arg0_input_path string
arg1_output_path string
arg2_options Object <optional>
Name Type Attributes Default Description
bin_colours Array.<(Array.<number>|Object)>

Colours to be destroyed (supports [r,g,b,a], [r,g,b,a,tol], or { colour, tolerance }).

ignore_colours Array.<(Array.<number>|Object)>

Colours to leave untouched.

bin_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for bin_colours.

ignore_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for ignore_colours.

(static) linearInterpolation(arg0_from_file_path, arg1_to_file_path, arg2_output_file_path, arg3_optionsopt) → {Object}

Interpolates between two number raster images based on a fraction.

Source:
Parameters:
Name Type Attributes Description
arg0_from_file_path string | Object
arg1_to_file_path string | Object
arg2_output_file_path string
arg3_options Object <optional>
Name Type Attributes Default Description
buffer_distance number <optional>
5

Pixel radius for coastal water buffer classification.

format string <optional>
"int32"

Either 'int32'/'float32'.

fraction number <optional>
0.5

The fraction to interpolate between the two images.

land_area_file Object | string <optional>

Land area raster path or object for landward/seaward masking.

land_area_raster Object | string <optional>

Alternative alias for land area input.

lower_value_threshold number <optional>

Lower-bound values that should not be interpolated (from raster).

upper_value_threshold number <optional>

Upper-bound values that should not be interpolated (to raster).

threshold_fraction number <optional>
0

2nd-order fraction to interpolate for values exceeding thresholds.

Returns:
Type:
Object

(static) loadImage(arg0_file_path, arg1_optionsopt) → {Object}

Loads an image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String

Input PNG file path.

arg1_options Object <optional>
Returns:
Type:
Object

(static) loadNumberFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {number}

Loads an int or float value from a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) loadNumberRasterImage(arg0_file_path, arg1_optionsopt) → {Object|Object}

Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

The file path to load or image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object | Object

(static) loadNumberRasterImageAsync(arg0_file_path, arg1_optionsopt) → {Promise.<{width: number, height: number, data: Float64Array}>}

Asynchronously loads a number raster image from a PNG file without blocking the event loop.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

File path or already-parsed raster object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

Returns:
Type:
Promise.<{width: number, height: number, data: Float64Array}>

(static) operateNumberRasterImage(arg0_optionsopt)

Runs an operation on a raster image for a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to load from.

format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

function function <optional>

(arg0_index, arg1_number)

(static) processArealTimeseries(arg0_options) → {Promise.<void>}

Concurrently processes a timeseries of rasters with areal constraint clamping.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_indexing Object

Pre-indexed geometry from GeoPNG.indexArealMasks.

concurrency number <optional>
4
mode string <optional>
"linear"
target_function function

(year: number) => Object mapping region_key -> target.

input_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

List of years to process.

Returns:
Type:
Promise.<void>

(static) processTimeseriesParallel(arg0_options) → {Promise.<Array.<any>>}

Concurrently processes an array of timeseries steps (e.g. years) with true multithreading / multiprocessing.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>

Max concurrent worker tasks. Defaults to optimal core allocation.

context Object <optional>

Optional shared context passed to worker handlers.

handler function <optional>

async (local_item: any, local_index: number, local_context: Object) => Promise.

items Array.<any>

Array of years or items to process.

name string <optional>
"Task"

Task name for logging.

task_generator function <optional>

(local_item: any, local_index: number) => task_object for worker.

use_workers boolean <optional>
true

Whether to use worker threads.

Returns:
Type:
Promise.<Array.<any>>

Array of task results matching items order.

(static) regulariseLogTail(arg0_options) → {Float64Array|Object}

Applies C1-continuous log-tail regularisation and robust IQR outlier management to a raster surface. Prevents explosive statistical boundaries while preserving local variance.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

fraction_only boolean <optional>
false

If true, outputs normalised [0, 1] fractions.

iqr_multiplier number <optional>
1.5

Multiplier on IQR to set outlier thresholds.

return_metadata boolean <optional>
false

If true, returns { data, reg_min, reg_max, reg_range, regularise }.

target_max number <optional>

Target maximum value to map regularised range to.

target_min number <optional>

Target minimum value to map regularised range to.

valid_filter function <optional>

(index: number) => boolean. If provided, restricts distribution analysis.

Returns:
Type:
Float64Array | Object

Regularised pixel data buffer or metadata object if return_metadata is true.

(static) saveNumberRasterImage(arg0_optionsopt)

Saves a number raster image to a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to save the image to.

format string <optional>
"int32"

How to save colours to the end image. Either 'int32'/'float32'/'greyscale'.

height number <optional>
1

The height of the image to save.

width number <optional>
1

The width of the image to save.

function function <optional>

(arg0_index) - The function to apply to each pixel. Must return a number. [0, 0, 0, 0] if undefined.

(static) saveNumberRasterImageAsync(arg0_options) → {Promise.<{width: number, height: number, data: Buffer}>}

Asynchronously encodes and writes a number raster image to disk.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Float32Array <optional>

Pre-evaluated buffer.

file_path string

Destination file path.

format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

function function <optional>

(local_index: number) => number.

height number <optional>
1
width number <optional>
1
Returns:
Type:
Promise.<{width: number, height: number, data: Buffer}>

(static) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_optionsopt) → {Array.<number>}

Saves an int/float value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object string | Object

The image object to use.

arg1_index number

The index of the pixel to save the number to.

arg2_number number | string

The number to save to the pixel.

arg3_options Object | string <optional>

Options object or format string ('int32', 'float32', 'greyscale').

Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) savePercentageRasterImage(arg0_input_file_path, arg1_output_file_path, arg2_optionsopt) → {Object}

Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type Attributes Description
arg0_input_file_path string

The file path to the number raster image to save the percentage raster image from.

arg1_output_file_path string

The file path to save the percentage raster image to.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object

(static) shatter(arg0_input_prefix, arg1_output_prefix, arg2_optionsopt) → {Promise.<(Object|undefined)>}

Shatters a temporal series of rasters into a combined unique areal mask raster and records its historical lineage.

Source:
Parameters:
Name Type Attributes Description
arg0_input_prefix string

The path prefix of the input PNG files (e.g. "path/to/gini_").

arg1_output_prefix string

The path prefix for output files (saves to ${prefix}_masks.png and ${prefix}_metadata.json).

arg2_options Object <optional>

Configuration options.

Name Type Attributes Default Description
years Array.<number> <optional>
[]

The temporal sequence of years to evaluate.

Returns:
Type:
Promise.<(Object|undefined)>

Traced lineage mapping RGBA pixel representations to chronological value paths.

(static) terminateAllWorkers()

Safely terminates all active background geoprocessing worker threads.

Source:

GeoPNG

Analogous to a GeoTIFF file format, but in PNG form for easier editing. Single variable. Part of Geospatiale III.

Source:

Methods

(static) applyArealClamping(arg0_options) → {Float64Array}

Applies areal scaling or non-linear constraint clamping to a raster surface. Supports linear proportional scaling as well as variance-preserving logit adjustments.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

mask_pixel_indices Object

Pre-indexed pixels per region key.

mask_areas Object <optional>

Pre-indexed land areas per region key.

mode string <optional>
"linear"

'linear' | 'variance_preserving_logit'.

targets Object

Map of region key to target values.

weights Float64Array | Array.<number> <optional>

Pixel weights (e.g. population or GDP) for weighted aggregations.

max_iterations number <optional>
50

Binary search iterations for logit shift.

Returns:
Type:
Float64Array

Clamped pixel data.

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_optionsopt)

Transforms a PNG raster map to GeoJSON MultiPolygons, ignoring specified colours.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_file_path string
arg2_options Object <optional>
Name Type Attributes Description
ignore_colours Array.<Array.<number>> <optional>

List of [R, G, B, A] colours to skip.

(static) dasymetricBlur(arg0_optionsopt)

Dasymetrically blurs border regions where ushc regions are artificial/statistical artefacts.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
mask_data Array.<number> <optional>
pop_data Float64Array | Array.<number> <optional>

Data referencing population, alternatively any utility in which low values contribute to higher spread of the target variable.

target_data Float64Array | Array.<number> <optional>
height number <optional>
2160
width number <optional>
4320
radius number <optional>
64

The default brush radius/tolerance.

(static) dasymetricBlurTimeseries(arg0_options) → {Promise.<void>}

Blurs artificial administrative boundaries into smooth spatial population gradients across a timeseries sequence in parallel.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>
4
mask_raster string | Object
pop_path_function function

(year: number) => string.

radius number <optional>
64
target_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

Sequence of years to process.

Returns:
Type:
Promise.<void>

(static) dasymetricCohortScale(arg0_options) → {Promise.<void>}

Proportionally redistributes multiple demographic/economic cohort rasters to reconcile with an anchor population raster. Supports national fallback injection for coastline and spatial boundary mismatches.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Description
anchor_raster Object | string

Anchor total population raster (e.g. Stadestér).

cohort_keys Array.<string>

Keys identifying cohort surfaces.

cohort_path_function function

(cohort_key: string) => string.

geocode_obj Object <optional>

Map of RGB colour keys to ISO codes.

geocode_raster Object | string <optional>

Administrative geocode raster.

national_fractions Object <optional>

Map of ISO -> { [cohort_key]: fraction }.

output_path_function function

(cohort_key: string) => string.

Returns:
Type:
Promise.<void>

(static) dasymetricScale(arg0_options) → {Float64Array}

Scales an auxiliary surface to match target regional aggregates per spatial zone. Formula: V_i_new = V_i * (T_target / sum(V_k)).

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Description
data Float64Array | Array.<number>

Pixel data buffer to scale in-place or copy.

mask_pixel_indices Object

Map of region_key -> Array<pixel_index>.

targets Object

Map of region_key -> target total number.

Returns:
Type:
Float64Array

Dasymetrically scaled pixel buffer.

(static) executeParallelRaster(arg0_options) → {Promise.<Float64Array>}

Executes a raster calculation over a 2D domain in parallel using WebGL GPU shaders if available, or chunked multi-threaded asynchronous processing with cooperative yielding.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
chunk_size number <optional>
500

Rows per chunk for CPU yielding.

height number

Canvas height.

width number

Canvas width.

pixel_function function

(local_index: number) => number.

gpu_shader string <optional>

Optional WebGL fragment shader source for GPU acceleration.

Returns:
Type:
Promise.<Float64Array>

Resulting pixel data buffer.

(static) executeWorkerTask(arg0_task, arg1_optionsopt) → {Promise.<any>}

Dispatches a single task to the next available worker in the pool.

Source:
Parameters:
Name Type Attributes Description
arg0_task Object
arg1_options Object <optional>
Returns:
Type:
Promise.<any>

(static) generateDeltaSeries(arg0_output_folder_path, arg1_optionsopt) → {Promise.<void>}

Generates a delta series for a specific timeseries, used for later covariates.

Source:
Parameters:
Name Type Attributes Description
arg0_output_folder_path string
arg1_options Object <optional>
Name Type Attributes Default Description
input_format string <optional>
"int32"
input_format_function function <optional>

(arg0_year:number). Returns string representing the file path for the given year.

years Array.<number> <optional>
Returns:
Type:
Promise.<void>

(static) getCoastalWaterMask(arg0_land_area, arg1_buffer_distanceopt, arg2_optionsopt) → {Uint8Array}

Generates or retrieves from cache a boolean mask of continental coastal water cells. Water cells (land_area === 0) within buffer_distance of continental land (land_area > 0) are marked as 1, while open ocean island nations and interior water remain 0.

Source:
Parameters:
Name Type Attributes Default Description
arg0_land_area Object | string

Land area raster object or file path.

arg1_buffer_distance number <optional>
5

Coastal buffer radius in pixels.

arg2_options Object <optional>
Returns:
Type:
Uint8Array

(static) getImageSum(arg0_file_pathopt, arg1_optionsopt) → {number}

Fetches the total sum of all int/float values within an image.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object <optional>

The file path to the image or loaded raster image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) getLandwardBufferMask()

Alias for backwards compatibility.

Source:

(static) getPolygonCentroid(arg0_pixels) → {Array.<number>|null}

Returns the centroid of a given polygon, given its pixels.

Source:
Parameters:
Name Type Description
arg0_pixels Array.<Array.<number>>
Returns:
Type:
Array.<number> | null

(static) getRGBAFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {Array.<number>}

Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) getRasterNeighbourAverage(arg0_geopng_array, arg1_x, arg2_y, arg3_height, arg4_width) → {number}

Returns the average (assuming a number-formatted GeoPNG) of the Moore neighbourhood surrounding a pixel.

Source:
Parameters:
Name Type Description
arg0_geopng_array Array.<number>
arg1_x number
arg2_y number
arg3_height number
arg4_width number
Returns:
Type:
number

(static) getWorkerPool(arg0_optionsopt) → {Array.<Worker>}

Initialises and retrieves the persistent worker thread pool for geoprocessing.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Description
concurrency number <optional>

Custom worker thread count.

Returns:
Type:
Array.<Worker>

(static) indexArealMasks(arg0_options) → {Object}

Pre-indexes pixel indices and calculates total land area for each partition defined in areal_masks. Caches spatial topology to avoid redundant O(N) pixel loops across multi-year timeseries.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_masks Object

Metadata dictionary defining masks and colour keys.

land_area_raster Object | string

Land area raster object or file path.

mask_rasters Array.<(Object|string)>

Array of raster objects or file paths.

ignore_zero_land boolean <optional>
true

Skip pixels with zero or negative land area.

Returns:
Type:
Object

{ mask_areas: Object, mask_pixel_indices: Object, total_pixels: number, width: number, height: number }

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_optionsopt)

Robustly eliminates specific colours by binning them to the nearest available non-binned colour.

Source:
Parameters:
Name Type Attributes Description
arg0_input_path string
arg1_output_path string
arg2_options Object <optional>
Name Type Attributes Default Description
bin_colours Array.<(Array.<number>|Object)>

Colours to be destroyed (supports [r,g,b,a], [r,g,b,a,tol], or { colour, tolerance }).

ignore_colours Array.<(Array.<number>|Object)>

Colours to leave untouched.

bin_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for bin_colours.

ignore_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for ignore_colours.

(static) linearInterpolation(arg0_from_file_path, arg1_to_file_path, arg2_output_file_path, arg3_optionsopt) → {Object}

Interpolates between two number raster images based on a fraction.

Source:
Parameters:
Name Type Attributes Description
arg0_from_file_path string | Object
arg1_to_file_path string | Object
arg2_output_file_path string
arg3_options Object <optional>
Name Type Attributes Default Description
buffer_distance number <optional>
5

Pixel radius for coastal water buffer classification.

format string <optional>
"int32"

Either 'int32'/'float32'.

fraction number <optional>
0.5

The fraction to interpolate between the two images.

land_area_file Object | string <optional>

Land area raster path or object for landward/seaward masking.

land_area_raster Object | string <optional>

Alternative alias for land area input.

lower_value_threshold number <optional>

Lower-bound values that should not be interpolated (from raster).

upper_value_threshold number <optional>

Upper-bound values that should not be interpolated (to raster).

threshold_fraction number <optional>
0

2nd-order fraction to interpolate for values exceeding thresholds.

Returns:
Type:
Object

(static) loadImage(arg0_file_path, arg1_optionsopt) → {Object}

Loads an image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String

Input PNG file path.

arg1_options Object <optional>
Returns:
Type:
Object

(static) loadNumberFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {number}

Loads an int or float value from a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) loadNumberRasterImage(arg0_file_path, arg1_optionsopt) → {Object|Object}

Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

The file path to load or image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object | Object

(static) loadNumberRasterImageAsync(arg0_file_path, arg1_optionsopt) → {Promise.<{width: number, height: number, data: Float64Array}>}

Asynchronously loads a number raster image from a PNG file without blocking the event loop.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

File path or already-parsed raster object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

Returns:
Type:
Promise.<{width: number, height: number, data: Float64Array}>

(static) operateNumberRasterImage(arg0_optionsopt)

Runs an operation on a raster image for a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to load from.

format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

function function <optional>

(arg0_index, arg1_number)

(static) processArealTimeseries(arg0_options) → {Promise.<void>}

Concurrently processes a timeseries of rasters with areal constraint clamping.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_indexing Object

Pre-indexed geometry from GeoPNG.indexArealMasks.

concurrency number <optional>
4
mode string <optional>
"linear"
target_function function

(year: number) => Object mapping region_key -> target.

input_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

List of years to process.

Returns:
Type:
Promise.<void>

(static) processTimeseriesParallel(arg0_options) → {Promise.<Array.<any>>}

Concurrently processes an array of timeseries steps (e.g. years) with true multithreading / multiprocessing.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>

Max concurrent worker tasks. Defaults to optimal core allocation.

context Object <optional>

Optional shared context passed to worker handlers.

handler function <optional>

async (local_item: any, local_index: number, local_context: Object) => Promise.

items Array.<any>

Array of years or items to process.

name string <optional>
"Task"

Task name for logging.

task_generator function <optional>

(local_item: any, local_index: number) => task_object for worker.

use_workers boolean <optional>
true

Whether to use worker threads.

Returns:
Type:
Promise.<Array.<any>>

Array of task results matching items order.

(static) regulariseLogTail(arg0_options) → {Float64Array|Object}

Applies C1-continuous log-tail regularisation and robust IQR outlier management to a raster surface. Prevents explosive statistical boundaries while preserving local variance.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

fraction_only boolean <optional>
false

If true, outputs normalised [0, 1] fractions.

iqr_multiplier number <optional>
1.5

Multiplier on IQR to set outlier thresholds.

return_metadata boolean <optional>
false

If true, returns { data, reg_min, reg_max, reg_range, regularise }.

target_max number <optional>

Target maximum value to map regularised range to.

target_min number <optional>

Target minimum value to map regularised range to.

valid_filter function <optional>

(index: number) => boolean. If provided, restricts distribution analysis.

Returns:
Type:
Float64Array | Object

Regularised pixel data buffer or metadata object if return_metadata is true.

(static) saveNumberRasterImage(arg0_optionsopt)

Saves a number raster image to a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to save the image to.

format string <optional>
"int32"

How to save colours to the end image. Either 'int32'/'float32'/'greyscale'.

height number <optional>
1

The height of the image to save.

width number <optional>
1

The width of the image to save.

function function <optional>

(arg0_index) - The function to apply to each pixel. Must return a number. [0, 0, 0, 0] if undefined.

(static) saveNumberRasterImageAsync(arg0_options) → {Promise.<{width: number, height: number, data: Buffer}>}

Asynchronously encodes and writes a number raster image to disk.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Float32Array <optional>

Pre-evaluated buffer.

file_path string

Destination file path.

format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

function function <optional>

(local_index: number) => number.

height number <optional>
1
width number <optional>
1
Returns:
Type:
Promise.<{width: number, height: number, data: Buffer}>

(static) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_optionsopt) → {Array.<number>}

Saves an int/float value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object string | Object

The image object to use.

arg1_index number

The index of the pixel to save the number to.

arg2_number number | string

The number to save to the pixel.

arg3_options Object | string <optional>

Options object or format string ('int32', 'float32', 'greyscale').

Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) savePercentageRasterImage(arg0_input_file_path, arg1_output_file_path, arg2_optionsopt) → {Object}

Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type Attributes Description
arg0_input_file_path string

The file path to the number raster image to save the percentage raster image from.

arg1_output_file_path string

The file path to save the percentage raster image to.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object

(static) shatter(arg0_input_prefix, arg1_output_prefix, arg2_optionsopt) → {Promise.<(Object|undefined)>}

Shatters a temporal series of rasters into a combined unique areal mask raster and records its historical lineage.

Source:
Parameters:
Name Type Attributes Description
arg0_input_prefix string

The path prefix of the input PNG files (e.g. "path/to/gini_").

arg1_output_prefix string

The path prefix for output files (saves to ${prefix}_masks.png and ${prefix}_metadata.json).

arg2_options Object <optional>

Configuration options.

Name Type Attributes Default Description
years Array.<number> <optional>
[]

The temporal sequence of years to evaluate.

Returns:
Type:
Promise.<(Object|undefined)>

Traced lineage mapping RGBA pixel representations to chronological value paths.

(static) terminateAllWorkers()

Safely terminates all active background geoprocessing worker threads.

Source:

GeoPNG

Analogous to a GeoTIFF file format, but in PNG form for easier editing. Single variable. Part of Geospatiale III.

Source:

Methods

(static) applyArealClamping(arg0_options) → {Float64Array}

Applies areal scaling or non-linear constraint clamping to a raster surface. Supports linear proportional scaling as well as variance-preserving logit adjustments.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

mask_pixel_indices Object

Pre-indexed pixels per region key.

mask_areas Object <optional>

Pre-indexed land areas per region key.

mode string <optional>
"linear"

'linear' | 'variance_preserving_logit'.

targets Object

Map of region key to target values.

weights Float64Array | Array.<number> <optional>

Pixel weights (e.g. population or GDP) for weighted aggregations.

max_iterations number <optional>
50

Binary search iterations for logit shift.

Returns:
Type:
Float64Array

Clamped pixel data.

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_optionsopt)

Transforms a PNG raster map to GeoJSON MultiPolygons, ignoring specified colours.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_file_path string
arg2_options Object <optional>
Name Type Attributes Description
ignore_colours Array.<Array.<number>> <optional>

List of [R, G, B, A] colours to skip.

(static) dasymetricBlur(arg0_optionsopt)

Dasymetrically blurs border regions where ushc regions are artificial/statistical artefacts.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
mask_data Array.<number> <optional>
pop_data Float64Array | Array.<number> <optional>

Data referencing population, alternatively any utility in which low values contribute to higher spread of the target variable.

target_data Float64Array | Array.<number> <optional>
height number <optional>
2160
width number <optional>
4320
radius number <optional>
64

The default brush radius/tolerance.

(static) dasymetricBlurTimeseries(arg0_options) → {Promise.<void>}

Blurs artificial administrative boundaries into smooth spatial population gradients across a timeseries sequence in parallel.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>
4
mask_raster string | Object
pop_path_function function

(year: number) => string.

radius number <optional>
64
target_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

Sequence of years to process.

Returns:
Type:
Promise.<void>

(static) dasymetricCohortScale(arg0_options) → {Promise.<void>}

Proportionally redistributes multiple demographic/economic cohort rasters to reconcile with an anchor population raster. Supports national fallback injection for coastline and spatial boundary mismatches.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Description
anchor_raster Object | string

Anchor total population raster (e.g. Stadestér).

cohort_keys Array.<string>

Keys identifying cohort surfaces.

cohort_path_function function

(cohort_key: string) => string.

geocode_obj Object <optional>

Map of RGB colour keys to ISO codes.

geocode_raster Object | string <optional>

Administrative geocode raster.

national_fractions Object <optional>

Map of ISO -> { [cohort_key]: fraction }.

output_path_function function

(cohort_key: string) => string.

Returns:
Type:
Promise.<void>

(static) dasymetricScale(arg0_options) → {Float64Array}

Scales an auxiliary surface to match target regional aggregates per spatial zone. Formula: V_i_new = V_i * (T_target / sum(V_k)).

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Description
data Float64Array | Array.<number>

Pixel data buffer to scale in-place or copy.

mask_pixel_indices Object

Map of region_key -> Array<pixel_index>.

targets Object

Map of region_key -> target total number.

Returns:
Type:
Float64Array

Dasymetrically scaled pixel buffer.

(static) executeParallelRaster(arg0_options) → {Promise.<Float64Array>}

Executes a raster calculation over a 2D domain in parallel using WebGL GPU shaders if available, or chunked multi-threaded asynchronous processing with cooperative yielding.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
chunk_size number <optional>
500

Rows per chunk for CPU yielding.

height number

Canvas height.

width number

Canvas width.

pixel_function function

(local_index: number) => number.

gpu_shader string <optional>

Optional WebGL fragment shader source for GPU acceleration.

Returns:
Type:
Promise.<Float64Array>

Resulting pixel data buffer.

(static) executeWorkerTask(arg0_task, arg1_optionsopt) → {Promise.<any>}

Dispatches a single task to the next available worker in the pool.

Source:
Parameters:
Name Type Attributes Description
arg0_task Object
arg1_options Object <optional>
Returns:
Type:
Promise.<any>

(static) generateDeltaSeries(arg0_output_folder_path, arg1_optionsopt) → {Promise.<void>}

Generates a delta series for a specific timeseries, used for later covariates.

Source:
Parameters:
Name Type Attributes Description
arg0_output_folder_path string
arg1_options Object <optional>
Name Type Attributes Default Description
input_format string <optional>
"int32"
input_format_function function <optional>

(arg0_year:number). Returns string representing the file path for the given year.

years Array.<number> <optional>
Returns:
Type:
Promise.<void>

(static) getCoastalWaterMask(arg0_land_area, arg1_buffer_distanceopt, arg2_optionsopt) → {Uint8Array}

Generates or retrieves from cache a boolean mask of continental coastal water cells. Water cells (land_area === 0) within buffer_distance of continental land (land_area > 0) are marked as 1, while open ocean island nations and interior water remain 0.

Source:
Parameters:
Name Type Attributes Default Description
arg0_land_area Object | string

Land area raster object or file path.

arg1_buffer_distance number <optional>
5

Coastal buffer radius in pixels.

arg2_options Object <optional>
Returns:
Type:
Uint8Array

(static) getImageSum(arg0_file_pathopt, arg1_optionsopt) → {number}

Fetches the total sum of all int/float values within an image.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object <optional>

The file path to the image or loaded raster image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) getLandwardBufferMask()

Alias for backwards compatibility.

Source:

(static) getPolygonCentroid(arg0_pixels) → {Array.<number>|null}

Returns the centroid of a given polygon, given its pixels.

Source:
Parameters:
Name Type Description
arg0_pixels Array.<Array.<number>>
Returns:
Type:
Array.<number> | null

(static) getRGBAFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {Array.<number>}

Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) getRasterNeighbourAverage(arg0_geopng_array, arg1_x, arg2_y, arg3_height, arg4_width) → {number}

Returns the average (assuming a number-formatted GeoPNG) of the Moore neighbourhood surrounding a pixel.

Source:
Parameters:
Name Type Description
arg0_geopng_array Array.<number>
arg1_x number
arg2_y number
arg3_height number
arg4_width number
Returns:
Type:
number

(static) getWorkerPool(arg0_optionsopt) → {Array.<Worker>}

Initialises and retrieves the persistent worker thread pool for geoprocessing.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Description
concurrency number <optional>

Custom worker thread count.

Returns:
Type:
Array.<Worker>

(static) indexArealMasks(arg0_options) → {Object}

Pre-indexes pixel indices and calculates total land area for each partition defined in areal_masks. Caches spatial topology to avoid redundant O(N) pixel loops across multi-year timeseries.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_masks Object

Metadata dictionary defining masks and colour keys.

land_area_raster Object | string

Land area raster object or file path.

mask_rasters Array.<(Object|string)>

Array of raster objects or file paths.

ignore_zero_land boolean <optional>
true

Skip pixels with zero or negative land area.

Returns:
Type:
Object

{ mask_areas: Object, mask_pixel_indices: Object, total_pixels: number, width: number, height: number }

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_optionsopt)

Robustly eliminates specific colours by binning them to the nearest available non-binned colour.

Source:
Parameters:
Name Type Attributes Description
arg0_input_path string
arg1_output_path string
arg2_options Object <optional>
Name Type Attributes Default Description
bin_colours Array.<(Array.<number>|Object)>

Colours to be destroyed (supports [r,g,b,a], [r,g,b,a,tol], or { colour, tolerance }).

ignore_colours Array.<(Array.<number>|Object)>

Colours to leave untouched.

bin_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for bin_colours.

ignore_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for ignore_colours.

(static) linearInterpolation(arg0_from_file_path, arg1_to_file_path, arg2_output_file_path, arg3_optionsopt) → {Object}

Interpolates between two number raster images based on a fraction.

Source:
Parameters:
Name Type Attributes Description
arg0_from_file_path string | Object
arg1_to_file_path string | Object
arg2_output_file_path string
arg3_options Object <optional>
Name Type Attributes Default Description
buffer_distance number <optional>
5

Pixel radius for coastal water buffer classification.

format string <optional>
"int32"

Either 'int32'/'float32'.

fraction number <optional>
0.5

The fraction to interpolate between the two images.

land_area_file Object | string <optional>

Land area raster path or object for landward/seaward masking.

land_area_raster Object | string <optional>

Alternative alias for land area input.

lower_value_threshold number <optional>

Lower-bound values that should not be interpolated (from raster).

upper_value_threshold number <optional>

Upper-bound values that should not be interpolated (to raster).

threshold_fraction number <optional>
0

2nd-order fraction to interpolate for values exceeding thresholds.

Returns:
Type:
Object

(static) loadImage(arg0_file_path, arg1_optionsopt) → {Object}

Loads an image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String

Input PNG file path.

arg1_options Object <optional>
Returns:
Type:
Object

(static) loadNumberFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {number}

Loads an int or float value from a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) loadNumberRasterImage(arg0_file_path, arg1_optionsopt) → {Object|Object}

Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

The file path to load or image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object | Object

(static) loadNumberRasterImageAsync(arg0_file_path, arg1_optionsopt) → {Promise.<{width: number, height: number, data: Float64Array}>}

Asynchronously loads a number raster image from a PNG file without blocking the event loop.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

File path or already-parsed raster object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

Returns:
Type:
Promise.<{width: number, height: number, data: Float64Array}>

(static) operateNumberRasterImage(arg0_optionsopt)

Runs an operation on a raster image for a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to load from.

format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

function function <optional>

(arg0_index, arg1_number)

(static) processArealTimeseries(arg0_options) → {Promise.<void>}

Concurrently processes a timeseries of rasters with areal constraint clamping.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_indexing Object

Pre-indexed geometry from GeoPNG.indexArealMasks.

concurrency number <optional>
4
mode string <optional>
"linear"
target_function function

(year: number) => Object mapping region_key -> target.

input_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

List of years to process.

Returns:
Type:
Promise.<void>

(static) processTimeseriesParallel(arg0_options) → {Promise.<Array.<any>>}

Concurrently processes an array of timeseries steps (e.g. years) with true multithreading / multiprocessing.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>

Max concurrent worker tasks. Defaults to optimal core allocation.

context Object <optional>

Optional shared context passed to worker handlers.

handler function <optional>

async (local_item: any, local_index: number, local_context: Object) => Promise.

items Array.<any>

Array of years or items to process.

name string <optional>
"Task"

Task name for logging.

task_generator function <optional>

(local_item: any, local_index: number) => task_object for worker.

use_workers boolean <optional>
true

Whether to use worker threads.

Returns:
Type:
Promise.<Array.<any>>

Array of task results matching items order.

(static) regulariseLogTail(arg0_options) → {Float64Array|Object}

Applies C1-continuous log-tail regularisation and robust IQR outlier management to a raster surface. Prevents explosive statistical boundaries while preserving local variance.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

fraction_only boolean <optional>
false

If true, outputs normalised [0, 1] fractions.

iqr_multiplier number <optional>
1.5

Multiplier on IQR to set outlier thresholds.

return_metadata boolean <optional>
false

If true, returns { data, reg_min, reg_max, reg_range, regularise }.

target_max number <optional>

Target maximum value to map regularised range to.

target_min number <optional>

Target minimum value to map regularised range to.

valid_filter function <optional>

(index: number) => boolean. If provided, restricts distribution analysis.

Returns:
Type:
Float64Array | Object

Regularised pixel data buffer or metadata object if return_metadata is true.

(static) saveNumberRasterImage(arg0_optionsopt)

Saves a number raster image to a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to save the image to.

format string <optional>
"int32"

How to save colours to the end image. Either 'int32'/'float32'/'greyscale'.

height number <optional>
1

The height of the image to save.

width number <optional>
1

The width of the image to save.

function function <optional>

(arg0_index) - The function to apply to each pixel. Must return a number. [0, 0, 0, 0] if undefined.

(static) saveNumberRasterImageAsync(arg0_options) → {Promise.<{width: number, height: number, data: Buffer}>}

Asynchronously encodes and writes a number raster image to disk.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Float32Array <optional>

Pre-evaluated buffer.

file_path string

Destination file path.

format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

function function <optional>

(local_index: number) => number.

height number <optional>
1
width number <optional>
1
Returns:
Type:
Promise.<{width: number, height: number, data: Buffer}>

(static) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_optionsopt) → {Array.<number>}

Saves an int/float value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object string | Object

The image object to use.

arg1_index number

The index of the pixel to save the number to.

arg2_number number | string

The number to save to the pixel.

arg3_options Object | string <optional>

Options object or format string ('int32', 'float32', 'greyscale').

Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) savePercentageRasterImage(arg0_input_file_path, arg1_output_file_path, arg2_optionsopt) → {Object}

Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type Attributes Description
arg0_input_file_path string

The file path to the number raster image to save the percentage raster image from.

arg1_output_file_path string

The file path to save the percentage raster image to.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object

(static) shatter(arg0_input_prefix, arg1_output_prefix, arg2_optionsopt) → {Promise.<(Object|undefined)>}

Shatters a temporal series of rasters into a combined unique areal mask raster and records its historical lineage.

Source:
Parameters:
Name Type Attributes Description
arg0_input_prefix string

The path prefix of the input PNG files (e.g. "path/to/gini_").

arg1_output_prefix string

The path prefix for output files (saves to ${prefix}_masks.png and ${prefix}_metadata.json).

arg2_options Object <optional>

Configuration options.

Name Type Attributes Default Description
years Array.<number> <optional>
[]

The temporal sequence of years to evaluate.

Returns:
Type:
Promise.<(Object|undefined)>

Traced lineage mapping RGBA pixel representations to chronological value paths.

(static) terminateAllWorkers()

Safely terminates all active background geoprocessing worker threads.

Source:

GeoPNG

Analogous to a GeoTIFF file format, but in PNG form for easier editing. Single variable. Part of Geospatiale III.

Source:

Methods

(static) applyArealClamping(arg0_options) → {Float64Array}

Applies areal scaling or non-linear constraint clamping to a raster surface. Supports linear proportional scaling as well as variance-preserving logit adjustments.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

mask_pixel_indices Object

Pre-indexed pixels per region key.

mask_areas Object <optional>

Pre-indexed land areas per region key.

mode string <optional>
"linear"

'linear' | 'variance_preserving_logit'.

targets Object

Map of region key to target values.

weights Float64Array | Array.<number> <optional>

Pixel weights (e.g. population or GDP) for weighted aggregations.

max_iterations number <optional>
50

Binary search iterations for logit shift.

Returns:
Type:
Float64Array

Clamped pixel data.

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_optionsopt)

Transforms a PNG raster map to GeoJSON MultiPolygons, ignoring specified colours.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_file_path string
arg2_options Object <optional>
Name Type Attributes Description
ignore_colours Array.<Array.<number>> <optional>

List of [R, G, B, A] colours to skip.

(static) dasymetricBlur(arg0_optionsopt)

Dasymetrically blurs border regions where ushc regions are artificial/statistical artefacts.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
mask_data Array.<number> <optional>
pop_data Float64Array | Array.<number> <optional>

Data referencing population, alternatively any utility in which low values contribute to higher spread of the target variable.

target_data Float64Array | Array.<number> <optional>
height number <optional>
2160
width number <optional>
4320
radius number <optional>
64

The default brush radius/tolerance.

(static) dasymetricBlurTimeseries(arg0_options) → {Promise.<void>}

Blurs artificial administrative boundaries into smooth spatial population gradients across a timeseries sequence in parallel.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>
4
mask_raster string | Object
pop_path_function function

(year: number) => string.

radius number <optional>
64
target_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

Sequence of years to process.

Returns:
Type:
Promise.<void>

(static) dasymetricCohortScale(arg0_options) → {Promise.<void>}

Proportionally redistributes multiple demographic/economic cohort rasters to reconcile with an anchor population raster. Supports national fallback injection for coastline and spatial boundary mismatches.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Description
anchor_raster Object | string

Anchor total population raster (e.g. Stadestér).

cohort_keys Array.<string>

Keys identifying cohort surfaces.

cohort_path_function function

(cohort_key: string) => string.

geocode_obj Object <optional>

Map of RGB colour keys to ISO codes.

geocode_raster Object | string <optional>

Administrative geocode raster.

national_fractions Object <optional>

Map of ISO -> { [cohort_key]: fraction }.

output_path_function function

(cohort_key: string) => string.

Returns:
Type:
Promise.<void>

(static) dasymetricScale(arg0_options) → {Float64Array}

Scales an auxiliary surface to match target regional aggregates per spatial zone. Formula: V_i_new = V_i * (T_target / sum(V_k)).

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Description
data Float64Array | Array.<number>

Pixel data buffer to scale in-place or copy.

mask_pixel_indices Object

Map of region_key -> Array<pixel_index>.

targets Object

Map of region_key -> target total number.

Returns:
Type:
Float64Array

Dasymetrically scaled pixel buffer.

(static) executeParallelRaster(arg0_options) → {Promise.<Float64Array>}

Executes a raster calculation over a 2D domain in parallel using WebGL GPU shaders if available, or chunked multi-threaded asynchronous processing with cooperative yielding.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
chunk_size number <optional>
500

Rows per chunk for CPU yielding.

height number

Canvas height.

width number

Canvas width.

pixel_function function

(local_index: number) => number.

gpu_shader string <optional>

Optional WebGL fragment shader source for GPU acceleration.

Returns:
Type:
Promise.<Float64Array>

Resulting pixel data buffer.

(static) executeWorkerTask(arg0_task, arg1_optionsopt) → {Promise.<any>}

Dispatches a single task to the next available worker in the pool.

Source:
Parameters:
Name Type Attributes Description
arg0_task Object
arg1_options Object <optional>
Returns:
Type:
Promise.<any>

(static) generateDeltaSeries(arg0_output_folder_path, arg1_optionsopt) → {Promise.<void>}

Generates a delta series for a specific timeseries, used for later covariates.

Source:
Parameters:
Name Type Attributes Description
arg0_output_folder_path string
arg1_options Object <optional>
Name Type Attributes Default Description
input_format string <optional>
"int32"
input_format_function function <optional>

(arg0_year:number). Returns string representing the file path for the given year.

years Array.<number> <optional>
Returns:
Type:
Promise.<void>

(static) getCoastalWaterMask(arg0_land_area, arg1_buffer_distanceopt, arg2_optionsopt) → {Uint8Array}

Generates or retrieves from cache a boolean mask of continental coastal water cells. Water cells (land_area === 0) within buffer_distance of continental land (land_area > 0) are marked as 1, while open ocean island nations and interior water remain 0.

Source:
Parameters:
Name Type Attributes Default Description
arg0_land_area Object | string

Land area raster object or file path.

arg1_buffer_distance number <optional>
5

Coastal buffer radius in pixels.

arg2_options Object <optional>
Returns:
Type:
Uint8Array

(static) getImageSum(arg0_file_pathopt, arg1_optionsopt) → {number}

Fetches the total sum of all int/float values within an image.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object <optional>

The file path to the image or loaded raster image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) getLandwardBufferMask()

Alias for backwards compatibility.

Source:

(static) getPolygonCentroid(arg0_pixels) → {Array.<number>|null}

Returns the centroid of a given polygon, given its pixels.

Source:
Parameters:
Name Type Description
arg0_pixels Array.<Array.<number>>
Returns:
Type:
Array.<number> | null

(static) getRGBAFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {Array.<number>}

Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) getRasterNeighbourAverage(arg0_geopng_array, arg1_x, arg2_y, arg3_height, arg4_width) → {number}

Returns the average (assuming a number-formatted GeoPNG) of the Moore neighbourhood surrounding a pixel.

Source:
Parameters:
Name Type Description
arg0_geopng_array Array.<number>
arg1_x number
arg2_y number
arg3_height number
arg4_width number
Returns:
Type:
number

(static) getWorkerPool(arg0_optionsopt) → {Array.<Worker>}

Initialises and retrieves the persistent worker thread pool for geoprocessing.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Description
concurrency number <optional>

Custom worker thread count.

Returns:
Type:
Array.<Worker>

(static) indexArealMasks(arg0_options) → {Object}

Pre-indexes pixel indices and calculates total land area for each partition defined in areal_masks. Caches spatial topology to avoid redundant O(N) pixel loops across multi-year timeseries.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_masks Object

Metadata dictionary defining masks and colour keys.

land_area_raster Object | string

Land area raster object or file path.

mask_rasters Array.<(Object|string)>

Array of raster objects or file paths.

ignore_zero_land boolean <optional>
true

Skip pixels with zero or negative land area.

Returns:
Type:
Object

{ mask_areas: Object, mask_pixel_indices: Object, total_pixels: number, width: number, height: number }

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_optionsopt)

Robustly eliminates specific colours by binning them to the nearest available non-binned colour.

Source:
Parameters:
Name Type Attributes Description
arg0_input_path string
arg1_output_path string
arg2_options Object <optional>
Name Type Attributes Default Description
bin_colours Array.<(Array.<number>|Object)>

Colours to be destroyed (supports [r,g,b,a], [r,g,b,a,tol], or { colour, tolerance }).

ignore_colours Array.<(Array.<number>|Object)>

Colours to leave untouched.

bin_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for bin_colours.

ignore_tolerance number <optional>
0

Default RGBA Euclidean distance tolerance for ignore_colours.

(static) linearInterpolation(arg0_from_file_path, arg1_to_file_path, arg2_output_file_path, arg3_optionsopt) → {Object}

Interpolates between two number raster images based on a fraction.

Source:
Parameters:
Name Type Attributes Description
arg0_from_file_path string | Object
arg1_to_file_path string | Object
arg2_output_file_path string
arg3_options Object <optional>
Name Type Attributes Default Description
buffer_distance number <optional>
5

Pixel radius for coastal water buffer classification.

format string <optional>
"int32"

Either 'int32'/'float32'.

fraction number <optional>
0.5

The fraction to interpolate between the two images.

land_area_file Object | string <optional>

Land area raster path or object for landward/seaward masking.

land_area_raster Object | string <optional>

Alternative alias for land area input.

lower_value_threshold number <optional>

Lower-bound values that should not be interpolated (from raster).

upper_value_threshold number <optional>

Upper-bound values that should not be interpolated (to raster).

threshold_fraction number <optional>
0

2nd-order fraction to interpolate for values exceeding thresholds.

Returns:
Type:
Object

(static) loadImage(arg0_file_path, arg1_optionsopt) → {Object}

Loads an image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String

Input PNG file path.

arg1_options Object <optional>
Returns:
Type:
Object

(static) loadNumberFromPixel(arg0_image_object, arg1_index, arg2_optionsopt) → {number}

Loads an int or float value from a pixel based on its index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object Object | string

Image object or file path.

arg1_index number

Pixel index.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
number

(static) loadNumberRasterImage(arg0_file_path, arg1_optionsopt) → {Object|Object}

Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

The file path to load or image object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object | Object

(static) loadNumberRasterImageAsync(arg0_file_path, arg1_optionsopt) → {Promise.<{width: number, height: number, data: Float64Array}>}

Asynchronously loads a number raster image from a PNG file without blocking the event loop.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string | Object

File path or already-parsed raster object.

arg1_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

Returns:
Type:
Promise.<{width: number, height: number, data: Float64Array}>

(static) operateNumberRasterImage(arg0_optionsopt)

Runs an operation on a raster image for a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to load from.

format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

function function <optional>

(arg0_index, arg1_number)

(static) processArealTimeseries(arg0_options) → {Promise.<void>}

Concurrently processes a timeseries of rasters with areal constraint clamping.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
areal_indexing Object

Pre-indexed geometry from GeoPNG.indexArealMasks.

concurrency number <optional>
4
mode string <optional>
"linear"
target_function function

(year: number) => Object mapping region_key -> target.

input_path_function function

(year: number) => string.

output_path_function function

(year: number) => string.

years Array.<number>

List of years to process.

Returns:
Type:
Promise.<void>

(static) processTimeseriesParallel(arg0_options) → {Promise.<Array.<any>>}

Concurrently processes an array of timeseries steps (e.g. years) with true multithreading / multiprocessing.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
concurrency number <optional>

Max concurrent worker tasks. Defaults to optimal core allocation.

context Object <optional>

Optional shared context passed to worker handlers.

handler function <optional>

async (local_item: any, local_index: number, local_context: Object) => Promise.

items Array.<any>

Array of years or items to process.

name string <optional>
"Task"

Task name for logging.

task_generator function <optional>

(local_item: any, local_index: number) => task_object for worker.

use_workers boolean <optional>
true

Whether to use worker threads.

Returns:
Type:
Promise.<Array.<any>>

Array of task results matching items order.

(static) regulariseLogTail(arg0_options) → {Float64Array|Object}

Applies C1-continuous log-tail regularisation and robust IQR outlier management to a raster surface. Prevents explosive statistical boundaries while preserving local variance.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Array.<number>

Input raster data.

fraction_only boolean <optional>
false

If true, outputs normalised [0, 1] fractions.

iqr_multiplier number <optional>
1.5

Multiplier on IQR to set outlier thresholds.

return_metadata boolean <optional>
false

If true, returns { data, reg_min, reg_max, reg_range, regularise }.

target_max number <optional>

Target maximum value to map regularised range to.

target_min number <optional>

Target minimum value to map regularised range to.

valid_filter function <optional>

(index: number) => boolean. If provided, restricts distribution analysis.

Returns:
Type:
Float64Array | Object

Regularised pixel data buffer or metadata object if return_metadata is true.

(static) saveNumberRasterImage(arg0_optionsopt)

Saves a number raster image to a file.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
file_path string <optional>

The file path to save the image to.

format string <optional>
"int32"

How to save colours to the end image. Either 'int32'/'float32'/'greyscale'.

height number <optional>
1

The height of the image to save.

width number <optional>
1

The width of the image to save.

function function <optional>

(arg0_index) - The function to apply to each pixel. Must return a number. [0, 0, 0, 0] if undefined.

(static) saveNumberRasterImageAsync(arg0_options) → {Promise.<{width: number, height: number, data: Buffer}>}

Asynchronously encodes and writes a number raster image to disk.

Source:
Parameters:
Name Type Description
arg0_options Object
Name Type Attributes Default Description
data Float64Array | Float32Array <optional>

Pre-evaluated buffer.

file_path string

Destination file path.

format string <optional>
"int32"

'int32' | 'float32' | 'greyscale'.

function function <optional>

(local_index: number) => number.

height number <optional>
1
width number <optional>
1
Returns:
Type:
Promise.<{width: number, height: number, data: Buffer}>

(static) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_optionsopt) → {Array.<number>}

Saves an int/float value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Description
arg0_image_object string | Object

The image object to use.

arg1_index number

The index of the pixel to save the number to.

arg2_number number | string

The number to save to the pixel.

arg3_options Object | string <optional>

Options object or format string ('int32', 'float32', 'greyscale').

Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Array.<number>

(static) savePercentageRasterImage(arg0_input_file_path, arg1_output_file_path, arg2_optionsopt) → {Object}

Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type Attributes Description
arg0_input_file_path string

The file path to the number raster image to save the percentage raster image from.

arg1_output_file_path string

The file path to save the percentage raster image to.

arg2_options Object <optional>
Name Type Attributes Default Description
format string <optional>
"int32"

Either 'int32'/'float32'/'greyscale'.

Returns:
Type:
Object

(static) shatter(arg0_input_prefix, arg1_output_prefix, arg2_optionsopt) → {Promise.<(Object|undefined)>}

Shatters a temporal series of rasters into a combined unique areal mask raster and records its historical lineage.

Source:
Parameters:
Name Type Attributes Description
arg0_input_prefix string

The path prefix of the input PNG files (e.g. "path/to/gini_").

arg1_output_prefix string

The path prefix for output files (saves to ${prefix}_masks.png and ${prefix}_metadata.json).

arg2_options Object <optional>

Configuration options.

Name Type Attributes Default Description
years Array.<number> <optional>
[]

The temporal sequence of years to evaluate.

Returns:
Type:
Promise.<(Object|undefined)>

Traced lineage mapping RGBA pixel representations to chronological value paths.

(static) terminateAllWorkers()

Safely terminates all active background geoprocessing worker threads.

Source: