span8
span4
span8
span4
Reading INSPIRE typically just involves pointing at the source data and choosing the INSPIRE format.You may need to choose axis order if it is not oriented correctly.You may also choose to map complex properties as XML Fragments and then use flattening options (substitute empty string for list braces) to make it easier to map from multiple,nested elements to a relational structure such as in GIS.
Maps name{0}.GeographicalName.spelling{0}.SpellingOfName.text to name0.GeographicalName.spelling.SpellingOfName.text
To preserve the XML structure leave it with the default reader setting of Map Complex Properties as 'Nested Attributes'.For schema Show Feature Types from: 'Dataset only with attributes merged from schema' typically yields the best results.
One of the complexities of INSPIRE is that each feature can contain multiple geometries.For example,in addition to a polygon,a parcel may have a reference point and a bounded by box.By default,FME reads all these geometries.This may require that the geometries be simplified through deaggregation and filtering in a workspace.To eliminate the bounded by boxes,you can simply uncheck the 'read predefined properties' reader setting.The bounding boxes can be a pain since they can completely cover the feature you really want to see,so being able to turn this off is helpful.
If you cannot read your features at all,there may be a problem with your source GML.Sometimes publishers claim that their data is INSPIRE complaint when it is in fact not.To check whether your source data is valid,see the Validation section below.Because there are so many INSPIRE schemas,it is common for publishers to construct their own umbrella schema that invokes all the schemas for the themes they are publishing,If you get data from a source like this,you won't be able to read it without their umbrella schema.To use their schema,in the reader settings under Application Schema,change 'select feature types by' to XSD and then for 'application schema' enter the file or url path to their schema XSD file.For diagnosing other problems with reading INSPIRE data,search FMEpedia for articles related to GML and XML reading diagnostics.
Before FME 2014,typically users needed XMLTemplater with the Text File writer to write INSPIRE GML.Now,all you need to do is add an INSPIRE writer,set 'select feature types' to 'by themes',and select the INSPIRE themes you want to write to.FME places those destination feature types in the workspace,based on the INSPIRE schemas.Then it's just a matter of FME data restructuring and schema mapping to support that destination INSPIRE schema.You still need to understand the INSPIRE schema requirements in terms of required fields,relationships,nillable fields etc.Typically AttributeCopiers are used to do schema field mapping,AttributeCreators are used to define default values,and AttributeValueMapper for value mapping.SchemaMapper can do all of this across multiple feature types using external crosswalk tables stored in csv or excel tables.A workspace that reads INSPIRE data and writes it back out needs exactly 0 transformers - see attached workspace.The INSPIRE reader / writer supports all the complexities required for INSPIRE such as multiple geometries per feature,nested features,repeating elements,nillable elements.We have also streamlined the GUIs and workspace parameters to make them easier to use.Note that this is a good way to get started with writing INSPIRE GML.A round-trip workspace such as the one attached,plus a Logger,will show you exactly what data structure is required in FME in order to write out compliant INSPIRE GML.
A good place to start is thebasic INSPIRE GML writing example.This covers the basics as to how to name your attributes and geometries so that they get written out correctly.The INSPIRE writer also has a setting for pretty-printing.This is very useful when prototyping a workspace to write to a new theme.Pretty-printed XML is a lot easier to troubleshoot with then serialized XML.The default writer parameters should be fine for most of the other settings,since the INSPIRE schemas control the structure of the XML document that many of these parameters relate to.
Note that,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,so the GML reader can be used to read INSPIRE data as well.
There is not much point in writing INSPIRE GML if you can't validate the output.To check this,you can use an XMLValidator to validate your source data against the relevant theme's INSPIRE schemas at the above url.You can also find these schemas locally at FME\xml\schemas\inspire.The XMLValidator 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 to the XSD file of the INSPIRE 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 the INSPIRE schema.Note that XMLValidator also has a syntax only verification mode.See the attached workspace for an example.
FME Server can be used to provide an online validation service driven by a workspace similar to the one shown above.Here is a demonstration INSPIRE GML Validation Service that allows you to upload data corresponding to any of the Annex I themes and validate the schema.The source code and workspace used in this demo can be downloaded from thesiteand modified for deployment on your own FME Server.You can easily add in other validation tests as needed using FME transformers.
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 and 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,for generating INSPIRE GML,you should try the application schema writing approach before attempting to build your own templates.
It's now much easier to publish any INSPIRE GML to the web via OGC WFS.In fact,you can publish a web service hosting workspace to the data streaming service that handles the HTTP OGC message traffic as well as the GML responses.The GetCapabilities and DescribeFeatureType requests are just workspace inputs that are parsed and used to generate the appropriate GetCapabilities XML and DescribeFeatureType XSD responses via the Text File writer.GetFeature requests are processed to generate INSPIRE GML responses.Once published to FME Server the inputs are hosted by the data streaming service.This allows you to configure virtually any web service you wish,and can be readily configured to support XML filters,WFS 2.0,WPS,WMTS etc,all by configuring your workspace and without writing a line of code.For more on this see theINSPIRE WFS Demo.
Test this yourself by taking any INSPIRE GML dataset of your choice set up a workspace that reads and writes it.A good example of this is attached GeoNamesGMLwriter_FME2014.zip.Open the GML output in Data Inspector to see that the it has everything that the input has.Then check to make sure the result validates against the relevant INSPIRE schema.Note that if your output doesnt 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 particular INSPIRE theme,a good first step still is to get ahold of some sample data.Then you can make an INSPIRE to INSPIRE workspace and log the result.This will show you the structure of the FME feature you need to generate in order to drive your INSPIRE GML writer.Its also a good idea to look at your GML in an xml editor such as Notepad++ to make sure everything is there and structured as you would expect.
If you have any questions,pleasecontact support..
Example INSPIRE GeographicalNames feature in XML:
2013-01-01T12:00:00 36.715000152587891 15.090000152587891 8756d185-ef24-4352-974b-82c263b43d69IT.IMA.GNRegione Italian endonym standardised PACHINO Administrative unit
Example INSPIRE GeographicalNames feature from FME workspace log:
Feature Type: `NamedPlace_LOGGED'Attribute(encoded: utf-16) : `beginLifespanVersion' has value `2013-01-01T12:00:00'Attribute(string) : `fme_feature_type' has value `NamedPlace'Attribute(string) : `fme_geometry' has value `fme_point'Attribute(entangled: string): `fme_type' has value `fme_point'%|-1440964106_36|%Attribute(encoded: utf-16) : `gml_id' has value `IT.IMA.GN.8756d185-ef24-4352-974b-82c263b43d69'Attribute(encoded: utf-16) : `gml_original_coordinate_system' has value `urn:ogc:def:crs:EPSG::4326'Attribute(encoded: utf-16) : `inspireId.Identifier.localId' has value `8756d185-ef24-4352-974b-82c263b43d69'Attribute(encoded: utf-16) : `inspireId.Identifier.namespace' has value `IT.IMA.GN'Attribute(encoded: utf-16) : `localType{0}.LocalisedCharacterString' has value `Regione'Attribute(encoded: utf-16) : `localType{0}.LocalisedCharacterString.locale' has value `it-IT'Attribute(encoded: utf-16) : `name{0}.GeographicalName.language' has value `Italian'Attribute(encoded: utf-16) : `name{0}.GeographicalName.nameStatus' has value `standardised'Attribute(encoded: utf-16) : `name{0}.GeographicalName.nativeness' has value `endonym'Attribute(encoded: utf-16) : `name{0}.GeographicalName.sourceOfName' isAttribute(encoded: utf-16) : `name{0}.GeographicalName.sourceOfName.nilReason' has value `unknown'Attribute(encoded: utf-16) : `name{0}.GeographicalName.spelling{0}.SpellingOfName.script' has value `Latn'Attribute(encoded: utf-16) : `name{0}.GeographicalName.spelling{0}.SpellingOfName.text' has value `PACHINO'Attribute(encoded: utf-16) : `type{0}' has value `Administrative unit'Attribute(string) : `xml_type' has value `xml_point'Coordinate System: `EPSG:4326'Geometry Type: IFMEPointName(utf-16): `geometry'Number of Geometry Traits: 1GeometryTrait(encoded: utf-16): `gml_id' has value `IT.IMA.GN.P8756d185-ef24-4352-974b-82c263b43d69'Coordinate Dimension: 2(36.7150001525879,15.0900001525879)
© 2019 亚搏在线Safe Software Inc |Legal