@@ -764,7 +764,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
764
764
<< QStringLiteral ( " AS_XYZ" )
765
765
<< QStringLiteral ( " AS_XY" )
766
766
<< QStringLiteral ( " AS_YX" ),
767
- QStringLiteral ( " AS_XY " ), // Default value
767
+ QStringLiteral ( " " ), // Default value
768
768
true // Allow None
769
769
) );
770
770
@@ -807,9 +807,21 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
807
807
QObject::tr ( " Override the type of shapefile created. "
808
808
" Can be one of NULL for a simple .dbf file with no .shp file, POINT, "
809
809
" ARC, POLYGON or MULTIPOINT for 2D, or POINTZ, ARCZ, POLYGONZ or "
810
- " MULTIPOINTZ for 3D. Shapefiles with measure values are not supported, "
811
- " nor are MULTIPATCH files." ),
812
- QStringList ()
810
+ " MULTIPOINTZ for 3D;" ) +
811
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,1,0)
812
+ QObject::tr ( " Shapefiles with measure values are not supported,"
813
+ " nor are MULTIPATCH files." ) +
814
+ #endif
815
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
816
+ QObject::tr ( " POINTM, ARCM, POLYGONM or MULTIPOINTM for measured geometries"
817
+ " and POINTZM, ARCZM, POLYGONZM or MULTIPOINTZM for 3D measured"
818
+ " geometries." ) +
819
+ #endif
820
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
821
+ QObject::tr ( " MULTIPATCH files are supported since GDAL 2.2." ) +
822
+ #endif
823
+ " "
824
+ , QStringList ()
813
825
<< QStringLiteral ( " NULL" )
814
826
<< QStringLiteral ( " POINT" )
815
827
<< QStringLiteral ( " ARC" )
@@ -818,7 +830,21 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
818
830
<< QStringLiteral ( " POINTZ" )
819
831
<< QStringLiteral ( " ARCZ" )
820
832
<< QStringLiteral ( " POLYGONZ" )
821
- << QStringLiteral ( " MULTIPOINTZ" ),
833
+ << QStringLiteral ( " MULTIPOINTZ" )
834
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
835
+ << QStringLiteral ( " POINTM" )
836
+ << QStringLiteral ( " ARCM" )
837
+ << QStringLiteral ( " POLYGONM" )
838
+ << QStringLiteral ( " MULTIPOINTM" )
839
+ << QStringLiteral ( " POINTZM" )
840
+ << QStringLiteral ( " ARCZM" )
841
+ << QStringLiteral ( " POLYGONZM" )
842
+ << QStringLiteral ( " MULTIPOINTZM" )
843
+ #endif
844
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
845
+ << QStringLiteral ( " MULTIPATCH" )
846
+ #endif
847
+ << QStringLiteral ( " " ),
822
848
QString (), // Default value
823
849
true // Allow None
824
850
) );
@@ -940,7 +966,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
940
966
" the foo_bar pattern, foo will be considered as the namespace "
941
967
" of the element, and a <foo:bar> element will be written. "
942
968
" Otherwise, elements will be written in the <ogr:> namespace." ),
943
- true // Default value
969
+ false // Default value
944
970
) );
945
971
946
972
datasetOptions.insert ( QStringLiteral ( " WRITE_HEADER_AND_FOOTER" ), new BoolOption (
@@ -1116,7 +1142,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1116
1142
1117
1143
layerOptions.insert ( QStringLiteral ( " GEOMETRY_NAME" ), new StringOption (
1118
1144
QObject::tr ( " Name for the geometry column" ),
1119
- QStringLiteral ( " geometry " ) // Default value
1145
+ QStringLiteral ( " geom " ) // Default value
1120
1146
) );
1121
1147
1122
1148
layerOptions.insert ( " SPATIAL_INDEX" , new BoolOption (
@@ -1175,7 +1201,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1175
1201
datasetOptions.insert ( QStringLiteral ( " GPX_USE_EXTENSIONS" ), new BoolOption (
1176
1202
QObject::tr ( " If GPX_USE_EXTENSIONS=YES is specified, "
1177
1203
" extra fields will be written inside the <extensions> tag." ),
1178
- true // Default value
1204
+ false // Default value
1179
1205
) );
1180
1206
1181
1207
datasetOptions.insert ( QStringLiteral ( " GPX_EXTENSIONS_NS" ), new StringOption (
@@ -1266,8 +1292,16 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1266
1292
<< QStringLiteral ( " clampToGround" )
1267
1293
<< QStringLiteral ( " relativeToGround" )
1268
1294
<< QStringLiteral ( " absolute" ),
1269
- QStringLiteral ( " clampToGround" ) // Default value
1295
+ QStringLiteral ( " relativeToGround" ) // Default value
1296
+ ) );
1297
+
1298
+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
1299
+ datasetOptions.insert ( QStringLiteral ( " DOCUMENT_ID" ), new StringOption (
1300
+ QObject::tr ( " The DOCUMENT_ID datasource creation option can be used to specified "
1301
+ " the id of the root <Document> node. The default value is root_doc." ),
1302
+ QStringLiteral ( " root_doc" ) // Default value
1270
1303
) );
1304
+ #endif
1271
1305
1272
1306
driverMetadata.insert ( QStringLiteral ( " KML" ),
1273
1307
MetaData (
@@ -1285,15 +1319,34 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1285
1319
datasetOptions.clear ();
1286
1320
layerOptions.clear ();
1287
1321
1288
- layerOptions.insert ( QStringLiteral ( " SPATIAL_INDEX_MODE" ), new SetOption (
1289
- QObject::tr ( " Use this to turn on 'quick spatial index mode'. "
1290
- " In this mode writing files can be about 5 times faster, "
1291
- " but spatial queries can be up to 30 times slower." ),
1292
- QStringList ()
1293
- << QStringLiteral ( " QUICK" ),
1294
- QLatin1String ( " " ), // Default value
1295
- true // Allow None
1322
+ datasetOptions.insert ( QStringLiteral ( " SPATIAL_INDEX_MODE" ), new SetOption (
1323
+ QObject::tr ( " Use this to turn on 'quick spatial index mode'. "
1324
+ " In this mode writing files can be about 5 times faster, "
1325
+ " but spatial queries can be up to 30 times slower." ),
1326
+ QStringList ()
1327
+ << QStringLiteral ( " QUICK" )
1328
+ << QStringLiteral ( " OPTIMIZED" ),
1329
+ QLatin1String ( " QUICK" ), // Default value
1330
+ true // Allow None
1331
+ ) );
1332
+
1333
+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,2)
1334
+ datasetOptions.insert ( QStringLiteral ( " BLOCK_SIZE" ), new IntOption (
1335
+ QObject::tr ( " (multiples of 512): Block size for .map files. Defaults "
1336
+ " to 512. MapInfo 15.2 and above creates .tab files with a "
1337
+ " blocksize of 16384 bytes. Any MapInfo version should be "
1338
+ " able to handle block sizes from 512 to 32256." ),
1339
+ 512
1340
+ ) );
1341
+ #endif
1342
+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,0)
1343
+ layerOptions.insert ( QStringLiteral ( " BOUNDS" ), new StringOption (
1344
+ QObject::tr ( " xmin,ymin,xmax,ymax: Define custom layer bounds to increase the "
1345
+ " accuracy of the coordinates. Note: the geometry of written "
1346
+ " features must be within the defined box." ),
1347
+ QLatin1String ( " " ) // Default value
1296
1348
) );
1349
+ #endif
1297
1350
1298
1351
driverMetadata.insert ( QStringLiteral ( " MapInfo File" ),
1299
1352
MetaData (
@@ -1415,7 +1468,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1415
1468
datasetOptions.insert ( QStringLiteral ( " RETURN_PRIMITIVES" ), new BoolOption (
1416
1469
QObject::tr ( " Should all the low level geometry primitives be returned as special "
1417
1470
" IsolatedNode, ConnectedNode, Edge and Face layers." ),
1418
- true // Default value
1471
+ false // Default value
1419
1472
) );
1420
1473
1421
1474
datasetOptions.insert ( QStringLiteral ( " PRESERVE_EMPTY_NUMBERS" ), new BoolOption (
@@ -1435,7 +1488,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1435
1488
QObject::tr ( " Should additional attributes relating features to their underlying "
1436
1489
" geometric primitives be attached. These are the values of the FSPT group, "
1437
1490
" and are primarily needed when doing S-57 to S-57 translations." ),
1438
- true // Default value
1491
+ false // Default value
1439
1492
) );
1440
1493
1441
1494
datasetOptions.insert ( QStringLiteral ( " RECODE_BY_DSSI" ), new BoolOption (
@@ -1632,17 +1685,15 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1632
1685
datasetOptions.clear ();
1633
1686
layerOptions.clear ();
1634
1687
1635
- #if 0
1636
1688
datasetOptions.insert ( " HEADER" , new StringOption (
1637
1689
QObject::tr ( " Override the header file used - in place of header.dxf." ),
1638
- "" // Default value
1690
+ QLatin1String ( " " ) // Default value
1639
1691
) );
1640
1692
1641
1693
datasetOptions.insert ( " TRAILER" , new StringOption (
1642
1694
QObject::tr ( " Override the trailer file used - in place of trailer.dxf." ),
1643
- "" // Default value
1695
+ QLatin1String ( " " ) // Default value
1644
1696
) );
1645
- #endif
1646
1697
1647
1698
driverMetadata.insert ( QStringLiteral ( " DXF" ),
1648
1699
MetaData (
@@ -1668,14 +1719,20 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1668
1719
QStringLiteral ( " GXT" ) // Default value
1669
1720
) );
1670
1721
1671
- #if 0
1672
1722
datasetOptions.insert ( " CONFIG" , new StringOption (
1673
1723
QObject::tr ( " path to the GCT : the GCT file describe the GeoConcept types definitions: "
1674
1724
" In this file, every line must start with //# followed by a keyword. "
1675
1725
" Lines starting with // are comments." ),
1676
- "" // Default value
1726
+ QLatin1String ( " " ) // Default value
1727
+ ) );
1728
+
1729
+ datasetOptions.insert ( " FEATURETYPE" , new StringOption (
1730
+ QObject::tr ( " defines the feature to be created. The TYPE corresponds to one of the Name "
1731
+ " found in the GCT file for a type section. The SUBTYPE corresponds to one of "
1732
+ " the Name found in the GCT file for a sub-type section within the previous "
1733
+ " type section." ),
1734
+ QLatin1String ( " " ) // Default value
1677
1735
) );
1678
- #endif
1679
1736
1680
1737
driverMetadata.insert ( QStringLiteral ( " Geoconcept" ),
1681
1738
MetaData (
@@ -1703,7 +1760,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1703
1760
QStringLiteral ( " SHAPE" ) // Default value
1704
1761
) );
1705
1762
1706
- layerOptions.insert ( QStringLiteral ( " OID_NAME " ), new StringOption (
1763
+ layerOptions.insert ( QStringLiteral ( " FID " ), new StringOption (
1707
1764
QObject::tr ( " Name of the OID column to create. Defaults to 'OBJECTID'." ),
1708
1765
QStringLiteral ( " OBJECTID" ) // Default value
1709
1766
) );
@@ -1734,6 +1791,18 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1734
1791
false // Allow None
1735
1792
) );
1736
1793
1794
+ layerOptions.insert ( QStringLiteral ( " OGR_XLSX_HEADERS" ), new SetOption (
1795
+ QObject::tr ( " By default, the driver will read the first lines of each sheet to detect "
1796
+ " if the first line might be the name of columns. If set to FORCE, the "
1797
+ " driver will consider the first default" ),
1798
+ QStringList ()
1799
+ << QStringLiteral ( " FORCE" )
1800
+ << QStringLiteral ( " DISABLE" )
1801
+ << QStringLiteral ( " AUTO" ),
1802
+ QStringLiteral ( " AUTO" ), // Default value
1803
+ false // Allow None
1804
+ ) );
1805
+
1737
1806
driverMetadata.insert ( QStringLiteral ( " XLSX" ),
1738
1807
MetaData (
1739
1808
QStringLiteral ( " MS Office Open XML spreadsheet" ),
@@ -1760,6 +1829,18 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1760
1829
false // Allow None
1761
1830
) );
1762
1831
1832
+ layerOptions.insert ( QStringLiteral ( " OGR_ODS_HEADERS" ), new SetOption (
1833
+ QObject::tr ( " By default, the driver will read the first lines of each sheet to detect "
1834
+ " if the first line might be the name of columns. If set to FORCE, the "
1835
+ " driver will consider the first default" ),
1836
+ QStringList ()
1837
+ << QStringLiteral ( " FORCE" )
1838
+ << QStringLiteral ( " DISABLE" )
1839
+ << QStringLiteral ( " AUTO" ),
1840
+ QStringLiteral ( " AUTO" ), // Default value
1841
+ false // Allow None
1842
+ ) );
1843
+
1763
1844
driverMetadata.insert ( QStringLiteral ( " ODS" ),
1764
1845
MetaData (
1765
1846
QStringLiteral ( " Open Document Spreadsheet" ),
0 commit comments