mmomtchev / node-gdal-async

Node.js bindings for GDAL (Geospatial Data Abstraction Library) with full async support
https://mmomtchev.github.io/node-gdal-async/
Apache License 2.0
130 stars 26 forks source link

Create DXF file #55

Open infokartasplit opened 1 year ago

infokartasplit commented 1 year ago

can someone please give me an example how to create dxf file i have working code to open it in gdal: const buff = new Buffer.from(JSON.stringify(geojson)); console.log(buff); const dataset = await gdal.open(buff); how do i save it as DXF and send it to frontend?

mmomtchev commented 1 year ago

Here is the code for writing a DXF file to disk. I don't know how do you send files to your frontend.

const dsIn = gdal.open('input.json');
const dxf = gdal.drivers.get('dxf');
const dsOut = dxf.createCopy('output.dxf', dsIn);
dsOut.close();