mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[OGR provider] Workaround bug in OGR GML driver
This commit is contained in:
parent
c26584cc13
commit
0ee9d66511
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user