node-gdal
node-gdal copied to clipboard
Create gdal.Driver tests
#130 Showed that the documentation of the driver.createCopy()
method didn't match up with the implementation. The strict
option is missing. Tests are also needed.
Also related to issue #130. Hello, First of all, I'd like to say I have found issue trail #130 very helpful. I'm wondering, could someone indicate how to properly form the options object that is passed into the driver.createCopy function, please? What I need to do is translate a .tif file into a bin file (UInt16 type), and as well as into a png file (also UInt16 type); following all of your comments, as well as the help from gdal_convert, this is the piece of code I wrote: var gdal = require("gdal"); var dataset = gdal.open("path_to_tif_file/" + "MyFile.tif"); var copyOptions ={ "TYPE": "UInt16" }; try { var driver = gdal.drivers.get("ENVI"); driver.createCopy("path_to_saving_bin_file/" + "bin_filename", dataset, copyOptions); driver = gdal.drivers.get("PNG"); driver.createCopy("path_to_saving_png_file/" + "png_filename", dataset, copyOptions); } catch (err) { return console.log(err); } The issue I'm experiencing is: MyTif.tif file is ~18Mb, after executing this code, the converted bin and png files are 1Kb and 8Kb in size, which obviously leads me to believe nothing is being translated properly. I'm thinking I'm missing arguments in the copyOptions object? or maybe I built the copyOptions object is wrong? Any guidance is greatly appreciated. Thanks, M.