Class: GeoTIFFImage

geotiffimage~GeoTIFFImage(fileDirectory, geoKeys, dataView, littleEndian, cache, source)

GeoTIFF sub-file image.

Constructor

new GeoTIFFImage(fileDirectory, geoKeys, dataView, littleEndian, cache, source)

Parameters:
Name Type Description
fileDirectory Object

The parsed file directory

geoKeys Object

The parsed geo-keys

dataView DataView

The DataView for the underlying file.

littleEndian Boolean

Whether the file is encoded in little or big endian

cache Boolean

Whether or not decoded tiles shall be cached

source module:source/basesource.BaseSource

The datasource to read from

Source:

Methods

getBoundingBox() → {Array.<number>}

Returns the image bounding box as an array of 4 values: min-x, min-y, max-x and max-y. When the image has no affine transformation, then an exception is thrown.

Source:
Returns:

The bounding box

Type
Array.<number>

getBytesPerPixel() → {Number}

Calculates the number of bytes for each pixel across all samples. Only full bytes are supported, an exception is thrown when this is not the case.

Source:
Returns:

the bytes per pixel

Type
Number

getFileDirectory() → {Object}

Returns the associated parsed file directory.

Source:
Returns:

the parsed file directory

Type
Object

getGDALMetadata(sampleopt) → {Object}

Returns the parsed GDAL metadata items.

If sample is passed to null, dataset-level metadata will be returned. Otherwise only metadata specific to the provided sample will be returned.

Parameters:
Name Type Attributes Default Description
sample number <optional>
null

The sample index.

Source:
Returns:
Type
Object

getGDALNoData() → {number|null}

Returns the GDAL nodata value

Source:
Returns:
Type
number | null

getGeoKeys() → {Object}

Returns the associated parsed geo keys.

Source:
Returns:

the parsed geo keys

Type
Object

getHeight() → {Number}

Returns the height of the image.

Source:
Returns:

the height of the image

Type
Number

getOrigin() → {Array.<number>}

Returns the image origin as a XYZ-vector. When the image has no affine transformation, then an exception is thrown.

Source:
Returns:

The origin as a vector

Type
Array.<number>

getResolution(referenceImageopt) → {Array.<number>}

Returns the image resolution as a XYZ-vector. When the image has no affine transformation, then an exception is thrown.

Parameters:
Name Type Attributes Default Description
referenceImage module:geotiffimage~GeoTIFFImage <optional>
null

A reference image to calculate the resolution from in cases when the current image does not have the required tags on its own.

Source:
Returns:

The resolution as a vector

Type
Array.<number>

getSamplesPerPixel() → {Number}

Returns the number of samples per pixel.

Source:
Returns:

the number of samples per pixel

Type
Number

getTiePoints() → {Array.<Object>}

Returns an array of tiepoints.

Source:
Returns:
Type
Array.<Object>

getTileHeight() → {Number}

Returns the height of each tile.

Source:
Returns:

the height of each tile

Type
Number

(async) getTileOrStrip(x, y, sample, poolOrDecoder, signalopt) → {Promise.<ArrayBuffer>}

Returns the decoded strip or tile.

Parameters:
Name Type Attributes Description
x Number

the strip or tile x-offset

y Number

the tile y-offset (0 for stripped images)

sample Number

the sample to get for separated samples

poolOrDecoder module:geotiff~Pool | module:geotiff~BaseDecoder

the decoder or decoder pool

signal AbortSignal <optional>

An AbortSignal that may be signalled if the request is to be aborted

Source:
Returns:
Type
Promise.<ArrayBuffer>

getTileWidth() → {Number}

Returns the width of each tile.

Source:
Returns:

the width of each tile

Type
Number

getWidth() → {Number}

Returns the width of the image.

Source:
Returns:

the width of the image

Type
Number

pixelIsArea() → {Boolean}

Returns whether or not the pixels of the image depict an area (or point).

Source:
Returns:

Whether the pixels are a point

Type
Boolean

(async) readRasters(optionsopt) → {Promise.<module:geotiffimage~ReadRasterResult>}

Reads raster data from the image. This function reads all selected samples into separate arrays of the correct type for that sample or into a single combined array when interleave is set. When provided, only a subset of the raster is read for each sample.

Parameters:
Name Type Attributes Default Description
options module:geotiffimage~ReadRasterOptions <optional>
{}

optional parameters

Source:
Returns:

the decoded arrays as a promise

Type
Promise.<module:geotiffimage~ReadRasterResult>

(async) readRGB(optionsopt) → {Promise.<module:geotiffimage~ReadRasterResult>}

Reads raster data from the image as RGB. The result is always an interleaved typed array. Colorspaces other than RGB will be transformed to RGB, color maps expanded. When no other method is applicable, the first sample is used to produce a greayscale image. When provided, only a subset of the raster is read for each sample.

Parameters:
Name Type Attributes Description
options Object <optional>

optional parameters

Properties
Name Type Attributes Default Description
window Array.<number> <optional>

the subset to read data from in pixels.

interleave boolean <optional>
true

whether the data shall be read in one single array or separate arrays.

pool module:geotiff~Pool <optional>
null

The optional decoder pool to use.

width number <optional>

The desired width of the output. When the width is no the same as the images, resampling will be performed.

height number <optional>

The desired height of the output. When the width is no the same as the images, resampling will be performed.

resampleMethod string <optional>
'nearest'

The desired resampling method.

enableAlpha boolean <optional>
false

Enable reading alpha channel if present.

signal AbortSignal <optional>

An AbortSignal that may be signalled if the request is to be aborted

Source:
Returns:

the RGB array as a Promise

Type
Promise.<module:geotiffimage~ReadRasterResult>