Class: 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 Source

The datasource to read from

Source:

Methods

getBoundingBox() → {Array}

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

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() → {Object}

Returns the parsed GDAL metadata items.

Source:
Returns:
Type
Object

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}

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

getResolution(referenceImageopt) → {Array}

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

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) → {Promise.<ArrayBuffer>}

Returns the decoded strip or tile.

Parameters:
Name Type 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 Pool | AbstractDecoder

the decoder or decoder pool

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, poolopt, widthopt, heightopt, resampleMethodopt, fillValueopt) → {Promise.<(TypedArray|Array.<TypedArray>)>}

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 Object <optional>

optional parameters

Properties
Name Type Attributes Default Description
window Array <optional>
whole image

the subset to read data from.

samples Array <optional>
all samples

the selection of samples to read from.

interleave Boolean <optional>
false

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

pool Number <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.

fillValue number | Array.<number> <optional>

The value to use for parts of the image outside of the images extent. When multiple samples are requested, an array of fill values can be passed.

Source:
Returns:

the decoded arrays as a promise

Type
Promise.<(TypedArray|Array.<TypedArray>)>

(async) readRGB(optionsopt, poolopt, widthopt, heightopt, resampleMethodopt) → {Promise.<(TypedArray|Array.<TypedArray>)>}

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 Default Description
options Object <optional>

optional parameters

Properties
Name Type Attributes Default Description
window Array <optional>
whole image

the subset to read data from.

pool Number <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.

Source:
Returns:

the RGB array as a Promise

Type
Promise.<(TypedArray|Array.<TypedArray>)>