span8
span4
span8
span4
With FME, it is possible to obtain INSPIRE compliant GML within one small workspace.For this demo, a single feature is created with polygon geometry and attributes.该 feature is then structured to match the INSPIRE Natural Risk Zones Core schema.Finally, the INSPIRE GML Writer is used to write a Hazard Area feature, part of Annex III's Natural Risk Zones theme.该 demo exemplifies the ease of creating valid INSPIRE GML based on the application schemas.This workflow can be adapted to suit other INSPIRE themes, since workspaces to write INSPIRE GML usually contain similar steps.
Source data is read with the appropriate reader.In this example, for simplicity, a polygon is created to represent a sample feature, in this case a flood risk area, using the Creator transformer.This is also a good way to create a reproduction case when reporting bugs to support.
Unique IDs are generated, as required by INSPIRE.Sometimes data will contain unique identifiers and those can be used and formatted as required.If no unique IDs are available they can be generated with FME as we do here using the UUIDGenerator transformer.Remember to validate the INSPIRE GML which will ensure uniqueness of IDs, or use a DuplicateRemover to detect them.Note that some IDs such as GML IDs must begin with a letter, not a number, so a prefix is added in the AttributeCreator ( U_@Value(_uuid) ).
Necessary attributes are created, populated and schema is mapped.Source data will likely contain attributes which can be renamed to match the INSPIRE destination attributes, a process referred to as schema mapping.However, certain attributes required by the INSPIRE data specifications are often lacking in the source data, for example date and area information.该se attributes can be given default values, generated, or obtained from schema mapping.一种 variety of transformers may be involved in attribute addition and modification, including一种ttributeCreator,一种ttributeCopier,SchemaMapper,as well as a number of calculator transformers.
该 AttributeCreator structures data to meet the INSPIRE data model requirements:
Data is reprojected to the INSPIRE specified coordinate system.该 INSPIRE Directive requires that data be published in ETRS89 (EPSG:4258), or for systems outside of ETRS89, in the ITRS reference system.
Source geometry is named to match the appropriate xml_geometry name(s) in the destination feature type.通常情况下,多xml_geometry名字会存在,但往往是可以接受的只是写出一个xml_geometry。对于本演示中,填充我们想要的形状被命名为“几何体”。其他几何形状xml_geometry是可选的,如gml_boundedBy或gml_location。几何变换也可以由合并,重组,概括或简化的几何形状。在FME,最常用于该变压器包括GeometryPropertySetter命名几何形状和定义特征,一种ggregator嵌套的几何形状,和GeometryCoercer改变几何类型。
该GeometryPropertySetter用于几何名称设置为“几何体”,以符合危险区域的xml_geometry类型之一:
该INSPIRE GML作家来写的危险区域目标要素类型。XML模式文件(XSD)可以通过选择的INSPIRE主题,或通过指定XSD文件路径来指定。在这个例子中,内置的应用模式中自然风险区核心被利用。来源具有相同名称的属性作为目标属性隐含直接映射到目标字段。需要注意的是,即使几何本身已经映射xml_geometry领域保持红色。
下面笔者设置用于:
写INSPIRE GML后,一定要对其进行验证以确保其符合XML语法和XSD标准的要求是很重要的。您可以使用XMLValidator变压器检查GML对语法和架构。如果XML是无效的,在记录错误或错误会简要汇报,包括细节,如行,列号和错误的简要说明。对于INSPIRE数据,错误往往是缺少的属性或值的结果。一旦错误被纠正,可将数据再次验证,以检查是否修复工作。
XML错误似乎有些误导。For example, an error such as the following may be reported: “element 'namespace' is not allowed for content model '(localId,namespace,versionId?)’” In fact, this is often caused by a missing element which is expected earlier, since order matters.在这种情况下,“inspireId.Identifier.localId”必须命名空间元素之前被定义,尽管两者都需要。尝试删除“inspireId.Identifier.localId”现场重现上述验证错误。您也可以得到类似的错误,如果模式预计一个元素包含父之内,你还没有定义的正确gml_parent_id。其它常见错误包括失踪的ID,格式不正确的日期字段,空值没有按规定xsi_nil设置为“真”,和值无效或不当的情况下与限制领域,比如nilReason设置为“未知”领域。
需要注意的是验证可以开始产生许多错误的列表。通过您的输出限制到几个典型的特征,然后通过一个在错误一个工作简化诊断过程。此外,漂亮的印刷和记事本等一个良好的XML编辑器中查看输出GML ++将使其更容易发现问题,因为错误列表包含行和行号。
验证 workspace using the XML Validator transformer:
也可以验证与INSPIRE作家XML输出。在导航窗口中,输出文件的验证可以在作家参数来指定。需要注意的是,一旦你是幸福的输出,关闭验证可以帮助提高写作性能。
在导航,它包括以验证输出文件的选项INSPIRE GML作家参数:
FME服务器可以用来提供通过类似于上面所示的一个工作区驱动的在线INSPIRE数据验证服务。一种demo可在这里你可以上传对应的任何附件一主题的数据和验证模式。在此演示中使用的源代码和工作空间可以从下载site和修改部署自己的FME Server上。如使用FME变压器需要,您可以在其他验证测试添加。
在数据检查器,查看使用INSPIRE GML阅读器INSPIRE GML结果。更快的显示时间,下读取器参数选择由主题特征类型,以选择无INSPIRE主题或仅NaturalRiskZonesCore主题选择的。
在数据检查,选择由主题特征类型,没有INSPIRE主题精选,或仅NaturalRiskZonesCore:
Note: This example is for demonstration purposes only.该 resulting data is not to be used for any operational purposes.*为空间信息;激励或基础设施n in Europe, is a European Union directive that aims to create a spatial data infrastructure of EU data, which would be used for policy making.该 directive also aims to improve public access to spatial information.For more information please visit theINSPIRE website.
© 2020 Safe Software Inc |Legal