a/gdal_rasterize

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.

https://gdal.org/programs/gdal_rasterize.html

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.

Returns:
Type:
Promise.<TypeDefs.FilePath>

"Promise" returns paths of created files.

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