Thank you for this awesome tool! I'm excited to use it in my geodata wrangling :)
I tried following the instructions in README.md and got an error:
Uncaught TypeError TypeError: ogr2ogr is not a function
Here is my code:
import ogr2ogr from 'ogr2ogr';
(async () => {
const { data } = await ogr2ogr('/path/to/a.shp');
console.log(data);
})();
and indeed when I console.log(ogr2ogr) I get an object:
{default: ƒ, __esModule: true}
The following works, if I access that default property by name:
const { data } = await ogr2ogr.default('/path/to/data');
Also, I made sure my package.json has the old "type": "module" to enable ES6 imports.
Is there anything I'm doing that may be causing my install to behave a bit differently than what's in the README? Would appreciate any pointers on this!!!
Thank you for this awesome tool! I'm excited to use it in my geodata wrangling :)
I tried following the instructions in
README.md
and got an error:Here is my code:
and indeed when I
console.log(ogr2ogr)
I get an object:The following works, if I access that
default
property by name:Also, I made sure my
package.json
has the old"type": "module"
to enable ES6 imports.Is there anything I'm doing that may be causing my install to behave a bit differently than what's in the README? Would appreciate any pointers on this!!!