yocontra / node-gdal-next

Node.js bindings for GDAL (Geospatial Data Abstraction Library) [Fork]
https://contra.io/node-gdal-next/
Apache License 2.0
75 stars 35 forks source link

Cant open MVT for writing #43

Closed MangoChris closed 3 years ago

MangoChris commented 3 years ago

Package Version: 2.6.0 Node Version: 14.9.0

Command:

var data = gdal.open('/tmp', 'w', 'MVT');

Expected behaviour:

data variable contains Dataset

Actual behaviour:

Uncaught Error: ERROR 6: Only vector creation supported Uncaught Error: Error creating dataset

Notes:

All other file formats 'Esri Shapefile', 'KML' etc work as expected.

mmomtchev commented 3 years ago

@MangoChris are you using gdal-next with your own shared GDAL library? By building with --shared_gdal? MVT write support is not working with the prebuilt binaries If so, try with

var data = gdal.open('/tmp', 'w', 'MVT', 0, 0, 0, 'Unknown');

The default options (datatype GDT_Byte) fool the MVT driver that you want to create a raster dataset which it does not support

yocontra commented 3 years ago

Published as 2.6.1 - thanks @mmomtchev!

MangoChris commented 3 years ago

Thanks for the quick response guys, adding 'Unknown' did the trick!