Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[OGR provider] Workaround bug in OGR GML driver
- Loading branch information
Showing
with
10 additions
and
1 deletion.
-
+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 ); |
|
|