Skip to content

Commit

Permalink
Removed some GDAL version ifdefs
Browse files Browse the repository at this point in the history
Now that 2.1 is required
  • Loading branch information
elpaso committed Aug 28, 2017
1 parent 4f967e4 commit 487adb4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
15 changes: 0 additions & 15 deletions src/core/qgsvectorfilewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,15 +808,9 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
"Can be one of NULL for a simple .dbf file with no .shp file, POINT, "
"ARC, POLYGON or MULTIPOINT for 2D, or POINTZ, ARCZ, POLYGONZ or "
"MULTIPOINTZ for 3D;" ) +
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,1,0)
QObject::tr( " Shapefiles with measure values are not supported,"
" nor are MULTIPATCH files." ) +
#endif
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
QObject::tr( " POINTM, ARCM, POLYGONM or MULTIPOINTM for measured geometries"
" and POINTZM, ARCZM, POLYGONZM or MULTIPOINTZM for 3D measured"
" geometries." ) +
#endif
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
QObject::tr( " MULTIPATCH files are supported since GDAL 2.2." ) +
#endif
Expand All @@ -831,7 +825,6 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
<< QStringLiteral( "ARCZ" )
<< QStringLiteral( "POLYGONZ" )
<< QStringLiteral( "MULTIPOINTZ" )
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
<< QStringLiteral( "POINTM" )
<< QStringLiteral( "ARCM" )
<< QStringLiteral( "POLYGONM" )
Expand All @@ -840,7 +833,6 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
<< QStringLiteral( "ARCZM" )
<< QStringLiteral( "POLYGONZM" )
<< QStringLiteral( "MULTIPOINTZM" )
#endif
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
<< QStringLiteral( "MULTIPATCH" )
#endif
Expand Down Expand Up @@ -1330,23 +1322,19 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
true // Allow None
) );

#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,2)
datasetOptions.insert( QStringLiteral( "BLOCK_SIZE" ), new IntOption(
QObject::tr( "(multiples of 512): Block size for .map files. Defaults "
"to 512. MapInfo 15.2 and above creates .tab files with a "
"blocksize of 16384 bytes. Any MapInfo version should be "
"able to handle block sizes from 512 to 32256." ),
512
) );
#endif
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,0,0)
layerOptions.insert( QStringLiteral( "BOUNDS" ), new StringOption(
QObject::tr( "xmin,ymin,xmax,ymax: Define custom layer bounds to increase the "
"accuracy of the coordinates. Note: the geometry of written "
"features must be within the defined box." ),
QLatin1String( "" ) // Default value
) );
#endif

driverMetadata.insert( QStringLiteral( "MapInfo File" ),
MetaData(
Expand Down Expand Up @@ -1894,9 +1882,6 @@ QStringList QgsVectorFileWriter::defaultLayerOptions( const QString &driverName

OGRwkbGeometryType QgsVectorFileWriter::ogrTypeFromWkbType( QgsWkbTypes::Type type )
{
#if GDAL_VERSION_NUM < GDAL_COMPUTE_VERSION(2,1,0)
type = QgsWkbTypes::dropM( type );
#endif

OGRwkbGeometryType ogrType = static_cast<OGRwkbGeometryType>( type );

Expand Down
2 changes: 0 additions & 2 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ QString QgsOgrProvider::ogrWkbGeometryTypeName( OGRwkbGeometryType type ) const
QString geom;

// GDAL 2.1 can return M/ZM geometries
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
if ( wkbHasM( type ) )
{
geom = ogrWkbGeometryTypeName( wkbFlatten( type ) );
Expand All @@ -579,7 +578,6 @@ QString QgsOgrProvider::ogrWkbGeometryTypeName( OGRwkbGeometryType type ) const
geom += "M";
return geom;
}
#endif

switch ( ( long )type )
{
Expand Down

0 comments on commit 487adb4

Please sign in to comment.