Skip to main content

I have to transform various datasets in gml-files which have to have a certain structure (>xsd-schema-file). The gml-files get imported into a subsequent application which checks the structure and throws an error if something is missing.

In my original data though, not all the featureclasses exist in all the datasets, and in the gml-files that are written, those featureclasses are not contained and I get errors afterwards.

I would like FME to write all the featureclasses to the gml that are defined in the schemafile, so that if there is no data for a featureclass, the tags for this featureclass are written into the gml-File, but without data between them.

There's a parameter for the GML-writer "Write all featureclasses", but the tags are still not written for missing featureclasses.

(In the docs it says concerning this parameter:

Every GML writer DEF line is translated to the output GML application
schema document as an XML Schema element declaration and a corresponding
complex type definition.

> what's a DEF line?)

So is there a way I can get gml-files with tags for all the featureclasses in them?

Thanks in advance.

Vera

Perhaps you can use a Creator to create null objects and pass those on to the output feature types. I would imagine that generates at least one feature without geometry and with empty attribute fields. Hopefully that doesn't tick off the next application.


So a DEF line is part of the underlying code we use (the documentation team is working to remove all references to it, since it's not as useful as it used to be). It is basically the definition of a layer and is represented in Workbench by the brown objects on the canvas.

The Write all featureclasses (Write all Feature Types) setting tells FME to write the DEF line objects even if they don't have features - but as far as I can see they are only written to the schema (.xsd) file., not the GML file itself.

I'm wondering if there is an FME transformer that can help (eg the GMLFeatureComposer, XMLTemplater, or XMLSampleGenerator) but I'm not top of the league when it comes to XML/GML. If you could contact our support team (safe.com/support) someone there might be able to provide an answer. Ask for Dean Hintz - he is our XML expert in the team.

Sorry I can't give you a definite answer, but I expect Dean will be able to,

Regards

Mark

Mark Ireland

Product Evangelist

Safe Software



I spoke with one of our XML Developers and learned the following information.


Write All Feature Types, does not apply to situations where XSD application schemas are used, but rather for cases where FME is used to create the .xsd from the workbench feature type definitions, which translates into DEF lines.

 


 


When an Application Schema (XSD) is used to write GML features, you can obtain all features in the XSD schema by importing the desired features from the Application Schema, and routing a Creator to all the feature types you would like to be part of the output GML file, but are otherwise not populated as part of your workflow.

 


1) Add Writer, with Feature Type Definition: Import from Dataset

 


2) Import Writer Feature Types

 


3) Select all desired feature types

 


4) Add a Creator (without modifying the default parameters) and connect to all the desired feature types


Kind regards,

 


Natalie

 


Product Support Specialist

 


Safe Software

Reply