FME can't read my GML geometries

Liz Sanderson
Liz Sanderson
  • Updated

Symptom

Sometimes when you try to read a GML file, FME doesn't seem to pick up any of the geometries.

Cause

According to: C:\apps\FME\xfmap\gml_geometry_replacer_xfmap.xml The gml geometries FME recognizes are:

gml:MultiGeometry
gml:MultiPoint
gml:MultiCurve
gml:MultiLineString
gml:MultiSurface
gml:MultiPolygon
gml:Point
gml:LineString
gml:Curve
gml:CompositeCurve
gml:Polygon
gml:Surface
gml:Envelope
gml:Box

If it isn't in this list, it isn't GML. So:

<gml:Polygon gml:id="PolyID2460_1870_245642_142714">
<gml:exterior>
<gml:LinearRing gml:id="PolyID2460_1870_245642_14432_0">
<gml:pos>144420.306 336728.769 0 </gml:pos>
<gml:pos>133833.921 336645.546 0 </gml:pos>
<gml:pos>145420.306 356728.769 0 </gml:pos>
<gml:pos>135833.921 366645.546 0 </gml:pos>
</gml:LinearRing></gml:Polygon>

Is a valid GML geometry, but:

<MyLine>
<gml:pos>146820.30683951682 416728.76918510743 0 </gml:pos>
<gml:pos>146833.9218338043 416645.54686288186 0 </gml:pos>
</MyLine>

Is not, because <MyLine> is not a valid geometry element type.

Just because some of the tags look like gml (<gml:pos>), doesn't mean it is gml, because the whole construct has to belong to and comply with the structure of one of the geometry element types mentioned above.

One problematic area can be foreign language datasets where the geometry element names have been translated, not just the data content. For example, <gml:Point> is valid but <gml:Punkt> is not.

Resolution

If your data contains elements that are not valid GML geometry types, you have these options:

  • Specify an additional application schema to help FME interpret your data. This is a setting within the GML reader and often required for data associated with a particular national or domain standard.
  • Use the XML reader with flattening enabled to read it, followed by processing transformers such as VertexCreator etc to generate the geometries.
  • Use xfmaps (very advanced FME users only).
  • If you believe it is valid GML that contains geometry types FME does not yet support, send an enhancement request to support along with some sample data and we can evaluate whether it is something that would be appropriate for us to support.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.