GeoPNG

GeoPNG

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

Source:

Methods

(static) convertToGeoJSON(arg0_file_path, arg1_file_path, arg2_options)

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

Source:
Parameters:
Name Type Description
arg0_file_path string

Input PNG file path

arg1_file_path string

Output GeoJSON file path

arg2_options Object

Options object

Name Type Description
ignore_colours Array.<Array.<number>>

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

(static) getImageSum(arg0_file_pathopt) → {number}

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

Source:
Parameters:
Name Type Attributes Description
arg0_file_path String <optional>

The file path to the image to fetch the sum of.

Returns:
Type:
number

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

getRGBAFromPixel() - Fetches the RGBA value of a pixel based on its index.

Source:
Parameters:
Name Type Description
arg0_image_object Object
arg1_index number
Returns:
Type:
Array.<number>

(static) kNNBin(arg0_input_path, arg1_output_path, arg2_options)

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

Source:
Parameters:
Name Type Description
arg0_input_path string
arg1_output_path string
arg2_options Object
Name Type Description
bin_colours Array.<Array.<number>>

Colours to be destroyed.

ignore_colours Array.<Array.<number>>

Colours to leave untouched.

(static) loadImage(arg0_file_path) → {Object}

loadImage() - Loads an image into the assigned variable.

Source:
Parameters:
Name Type Description
arg0_file_path String
Returns:
Type:
Object

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

loadNumberFromPixel() - Loads an int value from a pixel based on its index.

Source:
Parameters:
Name Type Description
arg0_image_object Object
arg1_index number
Returns:
Type:
number

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

loadNumberRasterImage() - Loads a number raster image into the assigned variable.

Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_options Object <optional>
Name Type Attributes Default Description
type string <optional>
"32bit_int_positive"

Either '32bit_int_positive'/'greyscale'.

Returns:
Type:
Object | string

(static) operateNumberRasterImage(arg0_optionsopt)

operateNumberRasterImage() - Runs an operation on a raster image for a file.

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

The file path to load from.

function function <optional>

(arg0_index, arg1_number)

(static) saveNumberRasterImage(arg0_optionsopt)

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

type string <optional>
"32bit_int_positive"

How to save colours to the end image. Either '32bit_int_positive'/'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) saveNumberToPixel(arg0_image_object, arg1_index, arg2_number, arg3_typeopt) → {Array.<number>}

saveNumberToPixel() - Saves an int value to a pixel based on the corresponding index.

Source:
Parameters:
Name Type Attributes Default Description
arg0_image_object string

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_type string <optional>
"32bit_int_positive"

Either '32bit_int_positive'/'greyscale'.

Returns:
Type:
Array.<number>

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

savePercentageRasterImage() - Saves a percentage raster image to a file based on a number raster image.

Source:
Parameters:
Name Type 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.

Returns:
Type:
Object