Consideration
Sometimes when you try to read a GML file, FME doesn't seem to pick up any of the geometries.
Why This Happens
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:BoxIf 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 is in 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.
How to Resolve It
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 in the GML reader and is often required for data conforming to a particular national or domain standard.
- Use the XML reader with flattening enabled to read it, then process transformers such as VertexCreator to generate the geometries.
- Use xfmaps (advanced FME users only).