Closed stdavis closed 1 year ago
I met the same problem as yours, did you solve it?
No, I haven't found a solution yet. I'm hoping that one of the maintainers of this library can give us a clue.
No, I haven't found a solution yet. I'm hoping that one of the maintainers of this library can give us a clue.
I found out that the gdal.vectorTranslate method can be used to create a new FileGDB. First create an empty dataset, then convert to FileGDB, and write data on it. But I don't know if this method will have any problems in terms of performance. Below is simple sample code:
const driverShapefile = gdal.drivers.get('ESRI Shapefile');
const datasetShapefile=driverShapefile.create('./data/temp.shp');
const datasetGDB=gdal.vectorTranslate("./data/output.gdb", datasetShapefile,[ '-of', 'OpenFileGDB' ])
datasetShapefile.close()
const layer = datasetGDB.layers.create('jz_cy', gdal.SpatialReference.fromEPSG(4490), gdal.Point);
// next write the data you need
// ......
// save and close the dataset when finished
datasetGDB.flush();
datasetGDB.close();
@mmomtchev In what way is this issue a duplicate of #61? Does the OpenFileGDB driver only support raster?
OpenFileGDB supports only vector files in GDAL 3.6: https://gdal.org/drivers/vector/openfilegdb.html
If you want to copy this dataset, you have to do exactly as described in #61 - by copying all the features from all the layers.
Or you can use gdal.vectorTranslate
.
If you want to copy this dataset, you have to do exactly as described in #61
@mmomtchev I get the "Unhandled error Error: Only vector datasets supported" error message when I try and call driver.create('path/data.gdb')
using the OpenFileGDB driver. How am I supposed to follow the steps in #61 if I can't create an empty file geodatabase?
I've also tried gdal.vectorTranslate
and it outputs the layers as stand-alone tables without any geometry. Can you give me a hint on how to make it output the shapes?
@stdavis Your first question was about createCopy
. In GDAL 3.6, OpenFileGDB supports read-write operations only on vector datasets. In the very recent GDAL 3.7, read-only support for raster files has been added. Creating a new raster file is not currently possible.
I'm not working with rasters; only vector. Sorry if I wasn't clear.
Yes, indeed, because of a bug in the parsing of the type, create
falsely assumes a Byte
type when creating this dataset.
For now, you can use:
gdal.drivers.get('OpenFileGDB').create('test.gdb', 0, 0, 0, 'Unknown')
I get an error when I attempt to create new data using the![image](https://github.com/mmomtchev/node-gdal-async/assets/1326248/5d752c74-d1f5-4773-af02-46ee298a0b5d)
OpenFileGDB
driver. For example:I'd love any suggestions on what I'm doing wrong. Thanks!