Skip to content
Permalink
Browse files

[OGR provider] Workaround bug in OGR GML driver

  • Loading branch information
rouault committed Sep 15, 2017
1 parent c26584c commit 0ee9d6651183992e209fb2d4cedddb70e7831df1
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/providers/ogr/qgsogrprovider.cpp
@@ -3179,7 +3179,16 @@ GDALDatasetH QgsOgrProviderUtils::GDALOpenWrapper( const char *pszPath, bool bUp
if ( hIdentifiedDriver &&
strcmp( GDALGetDriverShortName( hIdentifiedDriver ), "GML" ) == 0 )
{
papszOpenOptions = CSLSetNameValue( papszOpenOptions, "FORCE_SRS_DETECTION", "YES" );
// There's currently a bug in the OGR GML driver. If a .gfs file exists
// and FORCE_SRS_DETECTION is set, then OGR_L_GetFeatureCount() returns
// twice the number of features. And as, the .gfs contains the SRS, there
// is no need to turn this option on.
// https://trac.osgeo.org/gdal/ticket/7046
VSIStatBufL sStat;
if ( VSIStatL( CPLResetExtension( pszPath, "gfs" ), &sStat ) != 0 )
{
papszOpenOptions = CSLSetNameValue( papszOpenOptions, "FORCE_SRS_DETECTION", "YES" );
}
}

const int nOpenFlags = GDAL_OF_VECTOR | ( bUpdate ? GDAL_OF_UPDATE : 0 );

0 comments on commit 0ee9d66

Please sign in to comment.
You can’t perform that action at this time.