Closed sgrellet closed 6 years ago
Regarding http://ressource.brgm-rec.fr/data/EntiteHydroGeol/121AT30
$ ogrinfo GMLAS:test.xml -oo remove_unused_layers=yes mappedfeature
OGRFeature(mappedfeature):1
id (String) = MappedFeature.234
[...]
specification_href (String) = #EntiteHydroGeol.121AT30
[...]
So the GMLAS driver only recognizes the specification link as a generic string.
The reason is that the gsmlb:specification element is defined as such
<element name="specification" type="gml:FeaturePropertyType" minOccurs="0">
<annotation>
<documentation>The specification association links an instance of MappedFeature to the GFI_Feature being mapped. In a geological map, MappedFeatures are used to represent GeologicFeatures, but other features from other domains could be represented.</documentation>
<appinfo>
<targetElement xmlns="http://www.opengis.net/gml/3.2">null:GFI_Feature</targetElement>
</appinfo>
</annotation>
</element>
So there's no direct connection with a gwml2:GW_Aquifer element. To be able to do that connection, that would require adding an initial pass to the driver that would create a map from gml:id to their belonging element, and a map from xlink:href values to their belonging elements, so that you finally you can establish existing relationships between both and feed that into the schema analyzer
Supporting this xlink:href="# pattern is a must have to me as it is often used. Do you see a way to 'patch' this on the client side before having this implemented in the GMLAS driver ?
Implemented in GDAL trunk r40973
$ ogrinfo GMLAS:GWML2.xml -oo remove_unused_layers=yes -oo remove_unused_fields=yes -oo expose_metadata_layers=yes -al | less
[...]
OGRFeature(mappedfeature):1
id (String) = MappedFeature.234
resolutionrepresentativefraction (Integer) = 50000
mappingframe_href (String) = http://resource.geosciml.org/feature/brgm/EarthBedrockSurface
specification_href (String) = #EntiteHydroGeol.121AT30
specification_abstractfeature_gw_aquifer_pkid (String) = EntiteHydroGeol.121AT30
[...]
OGRFeature(_ogr_fields_metadata):2592
layer_name (String) = mappedfeature
field_index (Integer) = 53
field_name (String) = specification_abstractfeature_gw_aquifer_pkid
field_xpath (String) = gsml:MappedFeature/gsml:specification/gwml2:GW_Aquifer
field_type (String) = string
field_is_list (Integer(Boolean)) = 0
field_min_occurs (Integer) = 0
field_max_occurs (Integer) = 1
field_category (String) = PATH_TO_CHILD_ELEMENT_WITH_LINK
field_related_layer (String) = gw_aquifer
[...]
OGRFeature(_ogr_layer_relationships):853
parent_layer (String) = mappedfeature
parent_pkid (String) = id
parent_element_name (String) = specification_abstractfeature_gw_aquifer_pkid
child_layer (String) = gw_aquifer
child_pkid (String) = id
[...]
I'll test it when pushed to gdal-dev in OsGeo4W. Currently I have access to gdal-dev 2.3.0-40977
Importing one of the 3 URIs below http://ressource.brgm-rec.fr/data/EntiteHydroGeol/113AI01 http://ressource.brgm-rec.fr/data/EntiteHydroGeol/121AU http://ressource.brgm-rec.fr/data/EntiteHydroGeol/121AT30
GDAL GMLAS identifies properly the various information elements. However the GUI is not able from the 'identify' action on the mappedfeature the link to the other tables. Is the driver capable of handling the <gsmlb:specification xlink:href="# structure (ex : in the last URI ) ?