-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GML_ATTRIBUTES_TO_OGR_FIELDS=YES by default when loading GML #29641
Comments
Author Name: Giovanni Manghi (@gioman) I also think that this would be very useful.
|
@Samweli Here are the validation images: |
vim src/core/providers/ogr/qgsogrprovider.cpp 3978 GDALDatasetH QgsOgrProviderUtils::GDALOpenWrapper( const char *pszPath, bool bUpdate, char **papszOpenOptionsIn, GDALDriverH *phDriver )
3979 {
3980 CPLErrorReset();
3981
3982 char **papszOpenOptions = CSLDuplicate( papszOpenOptionsIn );
3983 #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,2,0)
3984 const char *apszAllowedDrivers[] = { "GML", nullptr };
3985 GDALDriverH hIdentifiedDriver =
3986 GDALIdentifyDriverEx( pszPath, GDAL_OF_VECTOR, apszAllowedDrivers, nullptr );
3987 #else
3988 GDALDriverH hIdentifiedDriver =
3989 GDALIdentifyDriver( pszPath, nullptr );
3990 #endif
3991 if ( hIdentifiedDriver &&
3992 strcmp( GDALGetDriverShortName( hIdentifiedDriver ), "GML" ) == 0 )
3993 {
3994 // There's currently a bug in the OGR GML driver. If a .gfs file exists
3995 // and FORCE_SRS_DETECTION is set, then OGR_L_GetFeatureCount() returns
3996 // twice the number of features. And as, the .gfs contains the SRS, there
3997 // is no need to turn this option on.
3998 // https://trac.osgeo.org/gdal/ticket/7046
3999 VSIStatBufL sStat;
4000 if ( VSIStatL( CPLResetExtension( pszPath, "gfs" ), &sStat ) != 0 )
4001 {
4002 papszOpenOptions = CSLSetNameValue( papszOpenOptions, "FORCE_SRS_DETECTION", "YES" );
4003 }
4004 } |
Probably duplicates #27888. |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
That issue is not a duplication, this issue is not about INSPIRE, it is about having GML attributes shown by default in QGIS, by requesting GML_ATTRIBUTES_TO_OGR_FIELDS=YES set as the default in QGIS. Some examples of GML attributes (from test file example_gml_attributes.txt, which provides some dummy data that comply to the data model used in version 2.0 of this register). xlink:href attribute for link: indeterminatePosition attribute: saying that something happened in April 2019 is not the same as saying the something happened after April 2019 srsDimension attribute for elevation: the vertical coordinate reference system for an elevation is important to know |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. |
Author Name: Alexander Kotsev (Alexander Kotsev)
Original Redmine Issue: 21826
Redmine category:data_provider/ogr
We work in Europe for the Joint Research Centre (European Commission) as technical coordinator of the EU INSPIRE Directive implementation. Within the context of INSPIRE, an increasing number of datasets are made available by European Union Member States as GML [1]. Application schemas (*.xsd) for INSPIRE are available at [2]. Most, if not all of the GML instances that are made available use attributes of GML elements such as xlink:href pointing to a registry with persistent uri [3]. The default behaviour of QGIS ignores those attributes which is inherited from the default OGR/GDAL logic for creating a *.gfs on first load of a GML instance. As a consequence, a significant portion of the available attribute content is 'invisible' in QGIS.
The issue is described in [4], and the solution is already available there. In a nutshell, when first loading the GML, the open option 'GML_ATTRIBUTES_TO_OGR_FIELDS' should be set to 'YES'. This would allow the generation of a fully-blown *.gfs correctly showing all GML attributes in QGIS (which would make the life of a lot of European data providers a lot easier). Sample GML instances are attached.
Addressing this issue would be very much appreciated.
Marco Minghini and Alex Kotsev
[1] http://inspire-geoportal.ec.europa.eu/
[2] http://inspire.ec.europa.eu/schemas/
[3] http://inspire.ec.europa.eu/registry/
[4] INSPIRE-MIF/caniuse#3
The text was updated successfully, but these errors were encountered: