@@ -306,6 +306,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
306
306
options = new char *[ datasourceOptions.size ()+1 ];
307
307
for ( int i = 0 ; i < datasourceOptions.size (); i++ )
308
308
{
309
+ QgsDebugMsg ( QString ( " -dsco=%1" ).arg ( datasourceOptions[i] ) );
309
310
options[i] = CPLStrdup ( datasourceOptions[i].toLocal8Bit ().constData () );
310
311
}
311
312
options[ datasourceOptions.size ()] = nullptr ;
@@ -410,6 +411,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
410
411
options = new char *[ layerOptions.size ()+1 ];
411
412
for ( int i = 0 ; i < layerOptions.size (); i++ )
412
413
{
414
+ QgsDebugMsg ( QString ( " -lco=%1" ).arg ( layerOptions[i] ) );
413
415
options[i] = CPLStrdup ( layerOptions[i].toLocal8Bit ().constData () );
414
416
}
415
417
options[ layerOptions.size ()] = nullptr ;
@@ -418,10 +420,18 @@ void QgsVectorFileWriter::init( QString vectorFileName,
418
420
// disable encoding conversion of OGR Shapefile layer
419
421
CPLSetConfigOption ( " SHAPE_ENCODING" , " " );
420
422
421
- if ( action == CreateOrOverwriteFile || action == CreateOrOverwriteLayer )
423
+ if ( driverName == " DGN" )
424
+ {
425
+ mLayer = OGR_DS_GetLayerByName ( mDS , " elements" );
426
+ }
427
+ else if ( action == CreateOrOverwriteFile || action == CreateOrOverwriteLayer )
428
+ {
422
429
mLayer = OGR_DS_CreateLayer ( mDS , TO8F ( layerName ), mOgrRef , wkbType, options );
430
+ }
423
431
else
432
+ {
424
433
mLayer = OGR_DS_GetLayerByName ( mDS , TO8F ( layerName ) );
434
+ }
425
435
426
436
if ( options )
427
437
{
@@ -1392,7 +1402,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1392
1402
false // Default value
1393
1403
) );
1394
1404
1395
- datasetOptions.insert ( " COPY_SEED_FILE_COLOR_TABLEE " , new BoolOption (
1405
+ datasetOptions.insert ( " COPY_SEED_FILE_COLOR_TABLE " , new BoolOption (
1396
1406
QObject::tr ( " Indicates whether the color table should be copied from the seed file." ),
1397
1407
false // Default value
1398
1408
) );
@@ -1633,14 +1643,14 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1633
1643
) );
1634
1644
1635
1645
layerOptions.insert ( " SPATIAL_INDEX" , new BoolOption (
1636
- QObject::tr ( " If the database is of the SpatiaLite flavour , and if OGR is linked "
1646
+ QObject::tr ( " If the database is of the SpatiaLite flavor , and if OGR is linked "
1637
1647
" against libspatialite, this option can be used to control if a spatial "
1638
1648
" index must be created." ),
1639
1649
true // Default value
1640
1650
) );
1641
1651
1642
1652
layerOptions.insert ( " COMPRESS_GEOM" , new BoolOption (
1643
- QObject::tr ( " If the format of the geometry BLOB is of the SpatiaLite flavour , "
1653
+ QObject::tr ( " If the format of the geometry BLOB is of the SpatiaLite flavor , "
1644
1654
" this option can be used to control if the compressed format for "
1645
1655
" geometries (LINESTRINGs, POLYGONs) must be used" ),
1646
1656
false // Default value
0 commit comments