Skip to content
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

Closed
qgib opened this issue Apr 10, 2019 · 8 comments
Closed

GML_ATTRIBUTES_TO_OGR_FIELDS=YES by default when loading GML #29641

qgib opened this issue Apr 10, 2019 · 8 comments
Assignees
Labels
Data Provider Related to specific vector, raster or mesh data providers Feature Request Feedback Waiting on the submitter for answers stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@qgib
Copy link
Contributor

qgib commented Apr 10, 2019

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


@qgib
Copy link
Contributor Author

qgib commented Apr 10, 2019

Author Name: Giovanni Manghi (@gioman)


I also think that this would be very useful.


  • easy_fix was changed from 1 to 0
  • priority_id was changed from High to Normal

@qgib qgib added Feature Request Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@timlinux
Copy link
Member

@Samweli Here are the validation images:

image

Uploading image.png…

@timlinux
Copy link
Member

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   }

@alexbruy
Copy link
Contributor

Probably duplicates #27888.

@gioman gioman added the Feedback Waiting on the submitter for answers label Aug 13, 2020
@github-actions
Copy link

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".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 21, 2021
@heidivanparys
Copy link
Contributor

Probably duplicates #27888.

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:

image

indeterminatePosition attribute:

saying that something happened in April 2019 is not the same as saying the something happened after April 2019

image

srsDimension attribute for elevation:

the vertical coordinate reference system for an elevation is important to know

image

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 22, 2021
@github-actions
Copy link

github-actions bot commented Feb 6, 2021

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".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Feb 6, 2021
@github-actions
Copy link

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.
Or, if you have any further questions, there are also further support channels that can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Provider Related to specific vector, raster or mesh data providers Feature Request Feedback Waiting on the submitter for answers stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

6 participants