bugra9 / gdal3.js

Convert raster and vector geospatial data to various formats and coordinate systems entirely in the browser.
https://gdal3.js.org
GNU Lesser General Public License v2.1
300 stars 45 forks source link

Add support for 'open options' #42

Closed mthh closed 1 year ago

mthh commented 1 year ago

This PR add support for the dataset open options (which are format-specific and usually used behind the -oo parameter when using ogr2ogr, ogrinfo, gdalinfo, etc.) in order to fix #41.

The options must be given in the 2nd (optional) argument of Gdal.open, in a list of strings, like the following:

// Without options as before
const input = await Gdal.open(file);
// With option
const input = await Gdal.open(file, ['X_POSSIBLE_NAMES=lng', 'Y_POSSIBLE_NAMES=lat']);

I also added a test case using the open options of the CSV driver.

bugra9 commented 1 year ago

@mthh, thank you for developing the new feature, documentation and tests. It looks very nice.

mthh commented 1 year ago

Thank you !