@@ -825,7 +825,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
825
825
<< " AS_XYZ"
826
826
<< " AS_XY"
827
827
<< " AS_YX" ,
828
- " AS_XY " , // Default value
828
+ " " , // Default value
829
829
true // Allow None
830
830
) );
831
831
@@ -868,9 +868,21 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
868
868
QObject::tr ( " Override the type of shapefile created. "
869
869
" Can be one of NULL for a simple .dbf file with no .shp file, POINT, "
870
870
" ARC, POLYGON or MULTIPOINT for 2D, or POINTZ, ARCZ, POLYGONZ or "
871
- " MULTIPOINTZ for 3D. Shapefiles with measure values are not supported, "
872
- " nor are MULTIPATCH files." ),
873
- QStringList ()
871
+ " MULTIPOINTZ for 3D;" ) +
872
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,1,0)
873
+ QObject::tr ( " Shapefiles with measure values are not supported,"
874
+ " nor are MULTIPATCH files." ) +
875
+ #endif
876
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
877
+ QObject::tr ( " POINTM, ARCM, POLYGONM or MULTIPOINTM for measured geometries"
878
+ " and POINTZM, ARCZM, POLYGONZM or MULTIPOINTZM for 3D measured"
879
+ " geometries." ) +
880
+ #endif
881
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
882
+ QObject::tr ( " MULTIPATCH files are supported since GDAL 2.2." ) +
883
+ #endif
884
+ " "
885
+ , QStringList ()
874
886
<< " NULL"
875
887
<< " POINT"
876
888
<< " ARC"
@@ -879,7 +891,21 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
879
891
<< " POINTZ"
880
892
<< " ARCZ"
881
893
<< " POLYGONZ"
882
- << " MULTIPOINTZ" ,
894
+ << " MULTIPOINTZ"
895
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
896
+ << " POINTM"
897
+ << " ARCM"
898
+ << " POLYGONM"
899
+ << " MULTIPOINTM"
900
+ << " POINTZM"
901
+ << " ARCZM"
902
+ << " POLYGONZM"
903
+ << " MULTIPOINTZM"
904
+ #endif
905
+ #if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
906
+ << " MULTIPATCH"
907
+ #endif
908
+ << " " ,
883
909
QString (), // Default value
884
910
true // Allow None
885
911
) );
@@ -1001,7 +1027,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1001
1027
" the foo_bar pattern, foo will be considered as the namespace "
1002
1028
" of the element, and a <foo:bar> element will be written. "
1003
1029
" Otherwise, elements will be written in the <ogr:> namespace." ),
1004
- true // Default value
1030
+ false // Default value
1005
1031
) );
1006
1032
1007
1033
datasetOptions.insert ( " WRITE_HEADER_AND_FOOTER" , new BoolOption (
@@ -1177,7 +1203,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1177
1203
1178
1204
layerOptions.insert ( " GEOMETRY_NAME" , new StringOption (
1179
1205
QObject::tr ( " Name for the geometry column" ),
1180
- " geometry " // Default value
1206
+ " geom " // Default value
1181
1207
) );
1182
1208
1183
1209
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,0)
@@ -1238,7 +1264,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1238
1264
datasetOptions.insert ( " GPX_USE_EXTENSIONS" , new BoolOption (
1239
1265
QObject::tr ( " If GPX_USE_EXTENSIONS=YES is specified, "
1240
1266
" extra fields will be written inside the <extensions> tag." ),
1241
- true // Default value
1267
+ false // Default value
1242
1268
) );
1243
1269
1244
1270
datasetOptions.insert ( " GPX_EXTENSIONS_NS" , new StringOption (
@@ -1329,8 +1355,16 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1329
1355
<< " clampToGround"
1330
1356
<< " relativeToGround"
1331
1357
<< " absolute" ,
1332
- " clampToGround" // Default value
1358
+ " relativeToGround" // Default value
1359
+ ) );
1360
+
1361
+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
1362
+ datasetOptions.insert ( " DOCUMENT_ID" , new StringOption (
1363
+ QObject::tr ( " The DOCUMENT_ID datasource creation option can be used to specified "
1364
+ " the id of the root <Document> node. The default value is root_doc." ),
1365
+ " root_doc" // Default value
1333
1366
) );
1367
+ #endif
1334
1368
1335
1369
driverMetadata.insert ( " KML" ,
1336
1370
MetaData (
@@ -1348,15 +1382,34 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1348
1382
datasetOptions.clear ();
1349
1383
layerOptions.clear ();
1350
1384
1351
- layerOptions.insert ( " SPATIAL_INDEX_MODE" , new SetOption (
1352
- QObject::tr ( " Use this to turn on 'quick spatial index mode'. "
1353
- " In this mode writing files can be about 5 times faster, "
1354
- " but spatial queries can be up to 30 times slower." ),
1355
- QStringList ()
1356
- << " QUICK" ,
1357
- " " , // Default value
1358
- true // Allow None
1385
+ datasetOptions.insert ( " SPATIAL_INDEX_MODE" , new SetOption (
1386
+ QObject::tr ( " Use this to turn on 'quick spatial index mode'. "
1387
+ " In this mode writing files can be about 5 times faster, "
1388
+ " but spatial queries can be up to 30 times slower." ),
1389
+ QStringList ()
1390
+ << " QUICK"
1391
+ << " OPTIMIZED" ,
1392
+ " QUICK" , // Default value
1393
+ true // Allow None
1394
+ ) );
1395
+
1396
+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,2)
1397
+ datasetOptions.insert ( " BLOCK_SIZE" , new IntOption (
1398
+ QObject::tr ( " (multiples of 512): Block size for .map files. Defaults "
1399
+ " to 512. MapInfo 15.2 and above creates .tab files with a "
1400
+ " blocksize of 16384 bytes. Any MapInfo version should be "
1401
+ " able to handle block sizes from 512 to 32256." ),
1402
+ 512
1403
+ ) );
1404
+ #endif
1405
+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,0)
1406
+ layerOptions.insert ( " BOUNDS" , new StringOption (
1407
+ QObject::tr ( " xmin,ymin,xmax,ymax: Define custom layer bounds to increase the "
1408
+ " accuracy of the coordinates. Note: the geometry of written "
1409
+ " features must be within the defined box." ),
1410
+ " " // Default value
1359
1411
) );
1412
+ #endif
1360
1413
1361
1414
driverMetadata.insert ( " MapInfo File" ,
1362
1415
MetaData (
@@ -1478,7 +1531,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1478
1531
datasetOptions.insert ( " RETURN_PRIMITIVES" , new BoolOption (
1479
1532
QObject::tr ( " Should all the low level geometry primitives be returned as special "
1480
1533
" IsolatedNode, ConnectedNode, Edge and Face layers." ),
1481
- true // Default value
1534
+ false // Default value
1482
1535
) );
1483
1536
1484
1537
datasetOptions.insert ( " PRESERVE_EMPTY_NUMBERS" , new BoolOption (
@@ -1498,7 +1551,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1498
1551
QObject::tr ( " Should additional attributes relating features to their underlying "
1499
1552
" geometric primitives be attached. These are the values of the FSPT group, "
1500
1553
" and are primarily needed when doing S-57 to S-57 translations." ),
1501
- true // Default value
1554
+ false // Default value
1502
1555
) );
1503
1556
1504
1557
datasetOptions.insert ( " RECODE_BY_DSSI" , new BoolOption (
@@ -1695,17 +1748,15 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1695
1748
datasetOptions.clear ();
1696
1749
layerOptions.clear ();
1697
1750
1698
- #if 0
1699
1751
datasetOptions.insert ( " HEADER" , new StringOption (
1700
1752
QObject::tr ( " Override the header file used - in place of header.dxf." ),
1701
- "" // Default value
1753
+ QLatin1String ( " " ) // Default value
1702
1754
) );
1703
1755
1704
1756
datasetOptions.insert ( " TRAILER" , new StringOption (
1705
1757
QObject::tr ( " Override the trailer file used - in place of trailer.dxf." ),
1706
- "" // Default value
1758
+ QLatin1String ( " " ) // Default value
1707
1759
) );
1708
- #endif
1709
1760
1710
1761
driverMetadata.insert ( " DXF" ,
1711
1762
MetaData (
@@ -1731,14 +1782,20 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1731
1782
" GXT" // Default value
1732
1783
) );
1733
1784
1734
- #if 0
1735
1785
datasetOptions.insert ( " CONFIG" , new StringOption (
1736
1786
QObject::tr ( " path to the GCT : the GCT file describe the GeoConcept types definitions: "
1737
1787
" In this file, every line must start with //# followed by a keyword. "
1738
1788
" Lines starting with // are comments." ),
1739
- "" // Default value
1789
+ QLatin1String ( " " ) // Default value
1790
+ ) );
1791
+
1792
+ datasetOptions.insert ( " FEATURETYPE" , new StringOption (
1793
+ QObject::tr ( " defines the feature to be created. The TYPE corresponds to one of the Name "
1794
+ " found in the GCT file for a type section. The SUBTYPE corresponds to one of "
1795
+ " the Name found in the GCT file for a sub-type section within the previous "
1796
+ " type section." ),
1797
+ QLatin1String ( " " ) // Default value
1740
1798
) );
1741
- #endif
1742
1799
1743
1800
driverMetadata.insert ( " Geoconcept" ,
1744
1801
MetaData (
@@ -1766,7 +1823,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1766
1823
" SHAPE" // Default value
1767
1824
) );
1768
1825
1769
- layerOptions.insert ( " OID_NAME " , new StringOption (
1826
+ layerOptions.insert ( " FID " , new StringOption (
1770
1827
QObject::tr ( " Name of the OID column to create. Defaults to 'OBJECTID'." ),
1771
1828
" OBJECTID" // Default value
1772
1829
) );
@@ -1797,6 +1854,18 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1797
1854
false // Allow None
1798
1855
) );
1799
1856
1857
+ layerOptions.insert ( " OGR_XLSX_HEADERS" , new SetOption (
1858
+ QObject::tr ( " By default, the driver will read the first lines of each sheet to detect "
1859
+ " if the first line might be the name of columns. If set to FORCE, the "
1860
+ " driver will consider the first default" ),
1861
+ QStringList ()
1862
+ << " FORCE"
1863
+ << " DISABLE"
1864
+ << " AUTO" ,
1865
+ " AUTO" , // Default value
1866
+ false // Allow None
1867
+ ) );
1868
+
1800
1869
driverMetadata.insert ( " XLSX" ,
1801
1870
MetaData (
1802
1871
" MS Office Open XML spreadsheet" ,
@@ -1823,6 +1892,18 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
1823
1892
false // Allow None
1824
1893
) );
1825
1894
1895
+ layerOptions.insert ( " OGR_ODS_HEADERS" , new SetOption (
1896
+ QObject::tr ( " By default, the driver will read the first lines of each sheet to detect "
1897
+ " if the first line might be the name of columns. If set to FORCE, the "
1898
+ " driver will consider the first default" ),
1899
+ QStringList ()
1900
+ << " FORCE"
1901
+ << " DISABLE"
1902
+ << " AUTO" ,
1903
+ " AUTO" , // Default value
1904
+ false // Allow None
1905
+ ) );
1906
+
1826
1907
driverMetadata.insert ( " ODS" ,
1827
1908
MetaData (
1828
1909
" Open Document Spreadsheet" ,
0 commit comments