gdal_translate function can be used to convert raster data between different formats, potentially performing some operations like subsettings, resampling, and rescaling pixels in the process.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dataset |
TypeDefs.Dataset
|
Dataset to be converted. |
|
options |
Array
|
<optional> |
Options (https://gdal.org/programs/gdal_translate.html#description) |
outputName |
string
|
<optional> |
Destination file name without extension. |
Example
const Gdal = await initGdalJs();
const dataset = (await Gdal.open('data.tif')).datasets[0];
const options = [
'-of', 'PNG'
];
const filePath = await Gdal.gdal_translate(dataset, options);