gdal_rasterize function burns vector geometries (points, lines, and polygons) into the raster band(s) of a raster image. Vectors are read from OGR supported vector formats.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dataset |
TypeDefs.Dataset
|
Dataset to be converted. |
|
options |
Array
|
<optional> |
Options (https://gdal.org/programs/gdal_rasterize.html#description) |
outputName |
string
|
<optional> |
Destination file name without extension. |
Example
const Gdal = await initGdalJs();
const dataset = (await Gdal.open('data.geojson')).datasets[0];
const options = [
'-of', 'GTiff',
'-co', 'alpha=yes'
];
const filePath = await Gdal.gdal_rasterize(dataset, options);