关于“GML翻译需要帮助”的回答 https://knowledge.亚搏在线safe.com/questions/85650/need-help-with-gml-translation.html “GML翻译需要帮助”问题的最新答案 答案由deanatsafe亚搏在线 https://knowledge.亚搏在线safe.com/answers/85753/view.html GeoNamesGMLwriter2018。邮政< / >。我们仍然欢迎您通过支持系统对特定于您的数据集和模式的问题进行跟踪。问题1:如何公开、保存或修改featurecall属性。

默认情况下,fme&#;s GML写入器倾向于隐藏featumemory容器对象。但是,下面的方法将允许您根据需要公开、保留或修改它。

首先,确保将GML设置为GML,或者在本例中,将INSPIRE reader参数GML: featurecall设置为GML。

接下来,您需要导入读写器上的featurecall特性类型。您可能需要从模式not dataset设置import featureType。一旦您拥有了featurecall特性类型,那么在写入器上,您将需要设置这些GML写入器参数:

featurecall

featurecall ID: at . hrit。0

featuns URI: http://www.opengis.net/gml/3.2

在我的例子中,我使用地理名称。xsd应用程序模式没有任何额外的featumemory属性,因此我启用了映射预定义属性到Yes,这样我就可以将gml_description字段的值添加到featumemory对象中。注意,每个NamedPlace特性如何将它们的gml_parent_id设置为AT.HR.IT。问题2:如何在输出中压制空元素

>目前,GML写入器还没有压制空输出的设置。 FME does support nillable, so if an attribute is nillable then FME will set xsi:nil=true for null values.

To suppress null writing <gml:name/> in this case, there are 2 possible workarounds. You can use the GMLFeatureComposer to generate the GML, then pass it through the XMLFormatter and set it to 'remove empty elements to Yes. You would then need to use the TextFileWriter to write out your GML.

My preferred approach is to stick with the GML writer, and use a NullAttributeMapper to detect null attributes and map them to 'missing'. This effectively removes the field from the FME feature schema. In the attached example I use the NullAttributeMapper to scan all attributes and map any empty or null attributes to missing. This picks up the gml_name{2} list element and effectively removes it from the list.

Question 3: How to set the default namespace to remove namespace prefix from the element names

In your case, you have <eczr:FeatureMember> and you want this to show up as just <FeatureMember >. To do that you need to make eczr the default namespace.

In my case I have <gn:NamedPlace>. If I want to remove the gn namespace prefix, I need to make the namespace associated with gn the default namespace. Looking at the namespace header of my output I see that:

xmlns:gn="urn:x-inspire:specification:gmlas:GeographicalNames:3.0"

So to remove this namespace we need to set:

Override XSD and Use Namespace Declarations to:

xmlns="urn:x-inspire:specification:gmlas:GeographicalNames:3.0"

Thereafter, the output will have <NamedPlace> not <gn:NamedPlace>

Hopefully this gives you a few things to try. Because you can't share your application schema, I thought it might be useful to have a basic example of GML writing to play with. The above example is based on the INSPIRE GeoNames article. Feel free to edit this workspace for testing purposes and send back your modified version if you run into trouble, or manage to reproduce a problem with it.

If you have questions specific to your data feel free to follow up via the support system.

Dean

2019年1月23日星期三02:50:15 GMT deanat亚搏在线safe
答案由deanatsafe亚搏在线 https://knowledge.亚搏在线safe.com/answers/85746/view.html

Hi Radek,

谢谢你的问题。考虑到你问题的深度,我们最好通过我们的支持系统来跟进。我创建了一个新的支持案例,所以你应该会收到一封电子邮件很快。

同时,由于您对GML相当陌生,我将在这里发布一些支持资源的链接,以防您还没有看到它们。虽然我们还没有一个通用的GML教程,但是我们有一些针对AIXM和INSPIRE的相关教程。由于这些读写器/编写器基于GML读写器/编写器,所以基本原则是相同的。因此,这些示例应该有助于学习如何配置GML写入器。例如,AIXM文章展示了如何编写数据集容器——本例中是AIXMBasicMessage,以及如何使用父-子gml id嵌套特性。< / p > < p > < rel = " noopener noreferrer " href = " https亚搏在线://knowledge.safe.com/articles/1312/aixm-xml-and-gml-formats-eu-airports-demo.html " target = "平等" > https://knowledge.safe.com/articles/1312/aixm-xml-and-gml-formats-eu-airports-demo.html < / > < / p > < p > https://knowledge.safe.com/articles/573/inspire-gml-reading-writing-and-validation-basics.html < / p > < p > < rel = " noopener noreferrer " href = " https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/gml/GML_writer.htm "目标= "平等" > https://docs.safe.亚搏在线com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/gml/GML_writer.htm < / > < / p > < p > < / p > < / div >院长 2019年1月22日星期二23:26:07 GMT deanat亚搏在线safe