Question

Passing schemas from XML/GML


Badge +14
  • Contributor
  • 117 replies

I am trying to convert a set of GML files (KuntaGML) to Shape but am slowly developing a head ache. The source files are each covering a part of the total area, lets call them blocks. Within these "XML-blocks" are a number of features/tables. I want to convert everything to Shape with one shape file for each feature .

What is causing me problems is passing on the schema for each feature/table to the shape file, they are all different and there is upwards of 90 of them. The dynamic writer will pick the first schema it encounters and then run with that, but I need it to update for the subsequent files being written.

I tried inserting a feature reader to detect the schema, but that was incredibly slow so I gave up. There is no .xsd-file so I can not go that route.

Any ideas on how to solve this?


3 replies

Userlevel 2
Badge +17

Hi @aron,

Please try using the Feature Type Fanout, as described in this article: Fanout

If you fan out by the attribute fme_feature_type, the source KuntaGML schema will be used for the Shape output.

Badge +14

Hi @DaveAtSafe,

 

Thanks for the suggestion. Unfortunately when using the fanout i get a folder for each layer, but this folder is empty. What am I doing wrong? finland-gml-2-shape.fmw

I attached my workspace if that helps.

 

Userlevel 2
Badge +17

Hi @aron,

The separate folders are due to the Dataset Fanout in the workspace. You can disable this, and just use Feature Type Fanout to write to separate Shape files.

Reply