Constructor
new GeoTIFF(source, littleEndian, bigTiff, firstIFDOffset, optionsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
source |
* | The datasource to read from. |
|
littleEndian |
boolean | Whether the image uses little endian. |
|
bigTiff |
boolean | Whether the image uses bigTIFF conventions. |
|
firstIFDOffset |
number | The numeric byte-offset from the start of the image to the first IFD. |
|
options |
module:geotiff~GeoTIFFOptions |
<optional> |
further options. |
- Source:
Extends
- GeoTIFFBase
- module:geotiff~GeoTIFFBase
Methods
(async, static) fromSource(source, optionsopt, signalopt)
Parse a (Geo)TIFF file from the given source.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
source |
* | The source of data to parse from. |
|
options |
module:geotiff~GeoTIFFOptions |
<optional> |
Additional options. |
signal |
AbortSignal |
<optional> |
An AbortSignal that may be signalled if the request is to be aborted |
- Source:
close()
Closes the underlying file buffer N.B. After the GeoTIFF has been completely processed it needs to be closed but only if it has been constructed from a file.
- Source:
(async) getGhostValues() → {Promise.<Object>}
Get the values of the COG ghost area as a parsed map. See https://gdal.org/drivers/raster/cog.html#header-ghost-area for reference
- Source:
Returns:
the parsed ghost area or null, if no such area was found
- Type
- Promise.<Object>
(async) getImage(indexopt) → {Promise.<module:geotiffimage~GeoTIFFImage>}
Get the n-th internal subfile of an image. By default, the first is returned.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
index |
number |
<optional> |
0 | the index of the image to return. |
- Source:
Returns:
the image at the given index
- Type
- Promise.<module:geotiffimage~GeoTIFFImage>
(async) getImageCount() → {Promise.<number>}
Returns the count of the internal subfiles.
- Source:
Returns:
the number of internal subfile images
- Type
- Promise.<number>
(async) parseFileDirectoryAt(offset) → {Promise.<module:geotiff~ImageFileDirectory>}
Instructs to parse an image file directory at the given file offset. As there is no way to ensure that a location is indeed the start of an IFD, this function must be called with caution (e.g only using the IFD offsets from the headers or other IFDs).
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | the offset to parse the IFD at |
- Source:
Returns:
the parsed IFD
- Type
- Promise.<module:geotiff~ImageFileDirectory>
(async) readRasters(optionsopt) → {Promise.<module:geotiff~ReadRasterResult>}
(experimental) Reads raster data from the best fitting image. This function uses
the image with the lowest resolution that is still a higher resolution than the
requested resolution.
When specified, the bbox
option is translated to the window
option and the
resX
and resY
to width
and height
respectively.
Then, the readRasters method of the selected
image is called and the result returned.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
module:geotiffimage~ReadRasterOptions |
<optional> |
{} | optional parameters |
- Overrides:
- Source:
- See:
-
- GeoTIFFImage.readRasters
Returns:
the decoded array(s), with height
and width
, as a promise
- Type
- Promise.<module:geotiff~ReadRasterResult>