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

xr.readFileSync is not a function #55

Closed bertday closed 1 year ago

bertday commented 1 year ago

Hello! Thank you for this awesome project @bugra9 👋

I am trying to bring gdal3.js into a new Node project. This is my code so far:

import initGdalJs from 'gdal3.js';

(async () => {
  const Gdal = await initGdalJs();
})();

I'm getting an error:

Uncaught TypeError TypeError: xr.readFileSync is not a function

I'm using Node v18.13.0 and gdal3.js 2.4.0.

Thank you for any tips on what I might be doing wrong here!

bertday commented 1 year ago

The example gave me a clue... it should be:

import initGdalJs from 'gdal3.js/node.js';

with a /node.js at the end!