Closed disarticulate closed 7 months ago
Hi @disarticulate,
I added the "outputName" param to ogr2ogr, gdal_translate, gdalwarp and gdal_rasterize. https://gdal3.js.org/docs/module-a_ogr2ogr.html https://gdal3.js.org/docs/module-a_gdal_translate.html https://gdal3.js.org/docs/module-a_gdal_rasterize.html https://gdal3.js.org/docs/module-a_gdalwarp.html
Will it work?
So ogr2ogr is generally:
ogr2ogr [options] dst_datasource_name src_datasource_name [layers]
and the current api is:
For certain conversions or operations, a
dst_datasource_name
can be updated with option switches like -append/-overwrite/-update.Current behavior appears to directly create the output name as the input name, which prevents a one to many relationship, particularly when using the
-sql
switch which operates and generates a layer.I'd recommend the following api if it can be mapped easily to the current:
Gdal.ogr2ogr(dataset, options, [output_name])
I think the substantial API dillema is whether that output_name include the /output/* directory prefix but since the return file is the defacto working object, I think just allowing arbitrary output names then returning the location to the dataset fullfills the current contract without breaking how workflow occurs.