Skip to main content
Solved

write gml with all featureclasses of xsd-schema

  • February 11, 2016
  • 3 replies
  • 130 views

vki
Contributor
Forum|alt.badge.img+7
  • Contributor

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

Best answer by fmelizard

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
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

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.


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • February 16, 2016

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


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • Best Answer
  • February 23, 2016

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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings