a/gdaltransform

The gdaltransform utility reprojects a list of coordinates into any supported projection.

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

Parameters:
Name Type Description
coords Array.<Array.<number>>

Coordinates to be converted. Example: [[27.143757, 38.4247972, 0]]

options Array

Options (https://gdal.org/programs/gdaltransform.html#description) (-gcp is not supported.)

Returns:
Type:
Promise.<Array.<Array.<number>>>

"Promise" returns converted coordinates.

Example
const coords = [
    [27.143757, 38.4247972],
];
const options = [
    '-s_srs', 'EPSG:4326',
    '-t_srs', 'EPSG:3857',
    '-output_xy',
];
const newCoords = await Gdal.gdaltransform(coords, options);
console.log(newCoords); // [ [ 3021629.2074563554, 4639610.441991095 ] ]