a/gdal_location_info

The gdal location info utility converts a latitude and longitude into a pixel and line in the dataset

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

Parameters:
Name Type Description
dataset TypeDefs.Dataset

Dataset to be converted.

coords Array.<Array.<number>>

Coordinates to be converted. Example: [45.5,-108.5] lat/lon -wgs84 ie. this always acts as if -wgs84 was passed to gdalLocationinfo

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

"Promise" returns converted coordinates.

Example
const coords = [45.5,-108.5];
const pixelCoords = await Gdal.gdal_location_info(dataset,coords);
console.log(pixelCoords); // { "pixel": 3256, "line": 8664 }