span8
span4
span8
span4
FME took a quantum leap forward with improvements to the GML writer.You can now write to virtually any application schema (XSD) without the need for XMLTemplater,XSLT or any other type of scripting or transformation post process.Just point to the application schema (.xsd file) you want to write to,and make sure you set the GML Version parameter to "Application Schema".Once the dataset is added,you then need to import your destination feature types from the same schema.Then its just a matter of FME data restructuring and schema mapping to support that destination schema.
The implications are wide ranging.Basically,any GML we can read we can now write.For example,a workspace that reads INSPIRE data and writes it back out needs exactly 0 transformers - see attached workspace.The GML writer even supports multiple geometries per feature,nested features,repeating elements,nillable elements,3D geometries etc.We have also streamlined the GUIs and workspace parameters for many of our GML readers and writers to make them easier to use.In addition,this also means it is that much easier to publish any complex GML data stream to the web via OGC WFS.
FME has several new writers including INSPIRE GML and AIXM 5.1 which are built on this capability.Note that these new schema based writers don't require you to specify the application schema since they are standards based and FME is shipped with them.However,if there is a new draft schema you wish to use,you can override the FME shipped one with the updated one,or just use the GML writer.Note that the GML reader will examine the namespaces on any given GML file and use that to determine which reader to use.
There is not much point in writing to a specified schema if you can't validate the output.In FME,we use the XMLValidator transformer to do this.This uses the Apache Xerces library for validation,so you know that the results are objective.The easiest way to do this is create a new workspace,add a Creator,then the XMLValidator.Point the XMLValidator at the XML file you want to test and the XSD file of the application schema you want to validate against.Connect the output of XMLValidator to Loggers.Run the workspace and review the log to see if your XML is valid.If not you will get a full report listing the problems with your XML related to that schema.Note that XMLValidator also has a syntax only verification mode.See the attached workspace for an example of this.
So do we no longer need the XMLTemplater?Not so.XMLTemplater is still very useful for XML writing as we do not have schema based XML writing yet.There are also occasions where you need to generate GML when you have no GML application schema.Also,some schemas are so large,and the parts you want to write to may be so small,that it may be easier to use XMLTemplater.Metadata is a good case in point.A given organization may have a standard metadata template which XMLTemplater can be configured to use.As is often the case,there is usually more than one way to solve any given problem in FME.Still,if you do have a GML application schema,you should try the application schema writing approach before attempting to build your own templates.
Test this yourself by taking any GML dataset of your choice and setting up a workspace that reads and writes it.Check to see that the output has everything in it as the input and still validates against the XSD.Note that if your output doesn't validate,the first thing to check is whether or not your input validates.If your input data is not valid,FME will not automatically fix it.Also note that if you want to write to a particularly complex schema,a good first step still is to get ahold of some sample data.Then you can make a GML to GML workspace and log the result.This will show you the structure of the FME feature you need to generate in order to drive your GML writer.Also note that not all GML application schemas are well-formed.For example some application schemas may depend on imported or included schemas that are not available.Others may have abstract feature type definitions that are not fully defined and so FME can't build complete feature type definitions from them.
INSPIRE Natural Risk Zones Demo (Annex III)
AIXM Airports to INSPIRE Air Transport Networks
INSPIRE GML Basic Writing and Validation Example
INSPIRE GML Reading Writing and Validation Basics
AIXM 4.5 and 5.1 Reading,Writing and Validation - EU Airports Demo
© 2019 亚搏在线Safe Software Inc |Legal