toGeoJSON = async (fileOrFiles, params = { opts: [], openOpts: []}) => {
const openOptions = params.openOpts || [];
const input = await Gdal.open(fileOrFiles, openOptions);
const options = [
'-f', 'GeoJSON',
'-t_srs', 'EPSG:4326',
'-lco', 'RFC7946=YES'
].concat(params.opts || []);
const output = await Gdal.ogr2ogr(input.datasets[0], options);
const bytes = await Gdal.getFileBytes(output);
await Gdal.close(input);
return JSON.parse(new TextDecoder().decode(bytes));
}