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
311 stars 46 forks source link

Pointer 'hDS' is NULL in 'GDALGetFileList' #77

Open shalini-whiz opened 1 month ago

shalini-whiz commented 1 month ago

Hi, I am trying to convert .osm file into a kml file and then into a shape file using ogr2ogr on the node server. This is the code snippet, but it ends up with the error "Pointer 'hDS' is NULL in 'GDALGetFileList'.

const Gdal = await initGdalJs(); const dataset = (await Gdal.open(filePath)). datasets[0]; const options = ['-f', 'KML','-t_srs', 'EPSG:3819']; const result = await Gdal.ogr2ogr(dataset, options);

bugra9 commented 1 month ago

Hi @shalini-whiz,

Can you share all logs? If there are no other logs, you can create a function to write them to the file and pass them as logHandler and errorHandler as parameters when calling initGdalJs. Thus all logs will be written to the file.

https://gdal3.js.org/docs/global.html#initGdalJs

disarticulate commented 2 weeks ago

one issue I ran into is using the -sql option and extra whitespace on the following command. The error is basically a catchall "failed to create file" seems like