Skip to main content

I’ve tried multiple times to read gml file with feature reader or import that into the workspace using reader. I tried with multiple settings but failed.

The gml file structure seems ok as it is loaded into old QGIS without any problems. 

Any advises or tips how to handle such files are welcome.

Hi ​@mwoj ,

I think you should be able to read the GML dataset with OGC GML reader, if you have set the reader parameters appropriately.

Could you please describe your situation more specifically, including these points?

  • With which reader did you try reading the GML dataset - OGC GML reader or any other one?
  • How did you configure the reader parameters?
  • What messages were shown on the Translation Log when you got failure?

Thank you for suggections. 

I’ve tried reader with OGC GML before posting with multiple settings.

E.g. ignore application shema - Yes - result there is a reader instance in Navigator but NO reader on main canvas. There is no errors but 2 warnings 

 

Generate command line: GENERATE GML NULL "R:\test\20250429_1461_PL.PZGiK.1407_54.gml" "D:\99_TEMP\FME_1749470318093_16284.fmw"  +MERGE_SCHEMAS YES --SourceSUPPORTED_READER_ARCHIVE_EXTENSIONS xml.gz,gml.gz --SourceIGNORE_APPLICATON_SCHEMA yes --SourceXSD_DOC <Unused> --SourceVALIDATE_DATASET <Unused> --SourceFEATURE_TYPES_SCHEMA_MODE <Unused> --SourceSKIP_SCHEMA_LOCATION_IN_DATASET <Unused> --SourceMAP_FEATURE_COLLECTION <Unused> --SourceGML_FEATURE_ELEMENTS "" --SourceSRS_GEOMETRY_PARAMETERS "" --SourceSRS_AXIS_ORDER "" --SourceSRS_ANGLE_DIRECTION "" --SourceENFORCE_PATH_CONTINUITY_BY SNAPPING_END_POINTS --SourcePROCESS_XLINK_GEOMETRIES No --SourceFEATURE_PROPERTIES_READER <Unused> --SourceMAP_EMBEDDED_OBJECTS_AS <Unused> --SourceMAP_PREDEFINED_GML_PROPERTIES <Unused> --SourceMAP_GEOMETRY_COLUMNS <Unused> --SourceMAP_ALL_SUBSTITUTABLE_PROPERTIES <Unused> --SourceADD_NAMESPACE_PREFIX_TO_NAMES <Unused> --SourceQNAMES_FOR_PROPERTIES_TO_IGNORE <Unused> --SourceMAP_COVERAGES_AS_FEATURE_TYPES <Unused> --SourceATTRIBUTE_HANDLING <Unused> --SourceMAP_COMPLEX_PROPERTIES_AS <Unused> --SourceMAX_MULTI_LIST_LEVEL "" --SourceADD_GEOMETRIES_AS_XML_FRAGMENTS <Unused> --SourceXML_FRAGMENTS_AS_DOCUMENTS <Unused> --SourceFLATTEN_XML_FRAGMENTS <Unused> --SourceFLATTEN_XML_FRAGMENTS_OPEN_LIST_BRACE "" --SourceFLATTEN_XML_FRAGMENTS_CLOSE_LIST_BRACE "" --SourceFLATTEN_XML_FRAGMENTS_SEPARATOR "" --SourceGML_READER_GROUP <Unused> --SourceUSE_OLD_READER <Unused> --SourceDISABLE_AUTOMATIC_READER_TYPE_SELECTION <Unused> --SourceDISABLE_XML_NAMESPACE_PROCESSING <Unused> --SourceEXPLORE_XSD_VALUES_GROUP "" --SourceEXPLORE_XSD_VALUES NO --SourceEXPOSE_ATTRS_GROUP "" --SourceGML_EXPOSE_FORMAT_ATTRS "" --SourceUSE_SEARCH_ENVELOPE NO --SourceSEARCH_ENVELOPE_MINX 0 --SourceSEARCH_ENVELOPE_MINY 0 --SourceSEARCH_ENVELOPE_MAXX 0 --SourceSEARCH_ENVELOPE_MAXY 0 --SourceSEARCH_ENVELOPE_COORDINATE_SYSTEM "" --SourceCLIP_TO_ENVELOPE NO --SourceGML_RDR_ADV "" --SourceCONTINUE_ON_GEOM_ERROR yes --SourceREPROJECT_DISPARATE_CRS_IN_MULTIPLE_GEOMETRIES yes --SourceCACHE_XSD yes --SourceCACHE_XSD_EXPIRY_TIME "" --SourceMULTI_VALUE_SIMPLE_PROPERTIES_AS_CSV no --SourceNETWORK_AUTHENTICATION "" FME_PYTHON_VERSION 312 ARCGIS_COMPATIBILITY ARCGIS_AUTO LOG_STANDARDOUT YES FME_DEBUG ALL
Debug logging is enabled (FME_DEBUG MAPPING_FILE BADNEWS UNGROUPED UNCORRELATED DUMP_SCHEMA XSD_VERBOSE HTTP_DEBUG FTP_DEBUG STASH). This may affect performance
 


@mwoj 

Is this an INSPIRE GML?

Have you tried the INSPIRE GML Reader in FME?

SRG


I think the direct reason for the failure is that the GML reader cannot retrieve automatically the schema for XML namespace "http://xsd.geoportal2.pl/ewns". In my observation, the schema location written in the head of the document cannot be accessed for some reason.

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ewns="http://xsd.geoportal2.pl/ewns" timeStamp="2025-06-06T02:03:09" numberMatched="17626" numberReturned="17626" xsi:schemaLocation="http://xsd.geoportal2.pl/ewns http://W0011-VIR-24:83/?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=ewns:dzialki http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd">
<wfs:member>
<ewns:dzialki gml:id="I1225E54C-DD8B-6A85-EF19-3CBE66BE729A">
<gml:boundedBy>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::2178" srsDimension="2">
<gml:lowerCorner>5883718.840 7536898.040</gml:lowerCorner>
<gml:upperCorner>5883742.730 7536911.580</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ewns:ID_DZIALKI>146101_1.0001.10355/3</ewns:ID_DZIALKI>
<ewns:NUMER_DZIALKI>10355/3</ewns:NUMER_DZIALKI>
<ewns:NUMER_OBREBU>0001</ewns:NUMER_OBREBU>
<ewns:NUMER_JEDNOSTKI>146101_1</ewns:NUMER_JEDNOSTKI>
<ewns:NAZWA_OBREBU>0001</ewns:NAZWA_OBREBU>
<ewns:NAZWA_GMINY>MIASTO OSTROŁĘKA</ewns:NAZWA_GMINY>
<ewns:DATA>2025-06-06</ewns:DATA>
<ewns:geometria>
<gml:Polygon srsName="urn:ogc:def:crs:EPSG::2178" srsDimension="2" gml:id="I1225E54C-DD8B-6A85-EF19-3CBE66BE729A_1">
<gml:exterior>
<gml:LinearRing>
<gml:posList>5883718.840 7536900.150 5883741.310 7536911.580 5883742.250 7536910.650 5883742.730 7536910.160 5883720.960 7536898.040 5883718.840 7536900.150 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ewns:geometria>
</ewns:dzialki>
</wfs:member>
...

To avoid the failure, try setting the path of the feature element "ewns:dzialki" to the GML Feature Elements parameter in the OGC GML reader manually when adding the reader to the workspace.

Set Format and Dataset in Add Reader or FeatureReader, open reader parameters dialog from mParameters] button, then you can select desired feature path from the browse button t...].

Hope this helps.


@mwoj ​@takashi rightly pointed out the source for the error: the GML reader cannot retrieve automatically the schema for XML namespace "http://xsd.geoportal2.pl/ewns"

I checked the correctness of the GML file in QGIS and was able to open it!

However in FME, if you set the path of the feature element "ewns:dzialki" to the GML Feature Elements parameter in the OGC GML reader manually as mentioned by ​@takashi you should be able to read the GML file.

Happy FME :-) -ing

Cheers

SRG


@takashi ​@raghavendrans 

thank you. I will use proposed method to other gml files which I used ogr2ogr before