new GeoTIFFImage(fileDirectory, geoKeys, dataView, littleEndian, cache)
GeoTIFF sub-file image.
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:
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() → {Array}
Returns the image resolution as a XYZ-vector. When the image has no affine
transformation, then an exception is thrown.
- 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
getTileOrStrip(x, y, plane) → {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array}
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) |
plane |
Number | the planar configuration (1: "chunky", 2: "separate samples") |
- Source:
Returns:
- Type
- Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array
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
readRasters(optionsopt, callbackopt, callbackErroropt) → {TypedArray|Array.<TypedArray>|null}
Reads raster data from the image. This function reads all selected samples
into separate arrays of the correct type for that sample. When provided,
only a subset of the raster is read for each sample.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
optional parameters
Properties
|
||||||||||||||||||||
callback |
GeoTIFFImage~readCallback |
<optional> |
the success callback. this parameter is mandatory for asynchronous decoders (some compression mechanisms). | ||||||||||||||||||||
callbackError |
GeoTIFFImage~readErrorCallback |
<optional> |
the error callback |
- Source:
Returns:
in synchonous cases, the decoded
array(s) is/are returned. In
asynchronous cases, nothing is
returned.
- Type
- TypedArray | Array.<TypedArray> | null
readRGB(optionsopt, callback, callbackErroropt)
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
|
||||||||||
callback |
GeoTIFFImage~readCallback | the success callback. this parameter is mandatory. | |||||||||||
callbackError |
GeoTIFFImage~readErrorCallback |
<optional> |
the error callback |
- Source:
Type Definitions
readCallback(array)
This callback is called upon successful reading of a GeoTIFF image. The
resulting arrays are passed as a single argument.
Parameters:
Name | Type | Description |
---|---|---|
array |
TypedArray | Array.<TypedArray> | the requested data as a either a single typed array or a list of typed arrays, depending on the 'interleave' option. |
- Source:
readErrorCallback(error)
This callback is called upon encountering an error while reading of a
GeoTIFF image
Parameters:
Name | Type | Description |
---|---|---|
error |
Error | the encountered error |
- Source: