斯潘8
斯潘4
1。创建新工作区。添加一个模式读取器并将其指向您的模式源。
2。使用要保留的名称和提示“要保留的字段”创建新的已发布参数
三。将源模式功能连接到参数蚀刻器。将参数名设置为“keep”,将目标属性设置为“keep”。
4。将参数蚀刻器连接到蟒蛇管。设置python符号以保留\u defs并添加以下python源代码:
从PYFME导入*
def keep-defs(功能):
att_name_list=feature.getListAttribute('attribute.name')
att_type_list=feature.getListAttribute('attribute.native_data_type')
att_ftype_list=feature.getListAttribute('attribute.fme_data_type')
keep_values=feature.getStringAttribute('_to_keep')
keep_list=keep_values.split(',')
如果是收件人名单!无:
feature.removelisattribute('属性.name')
feature.removelisattribute('属性.本机_数据_类型')
feature.removelisattribute('属性.fme_数据_类型')
计数=0
对于范围内的i(len(att_name_list)):
如果(att_name_list[i]在keep_list中):
feature.setStringAttribute(('attribute'+str(count)+'.name'),att_name_list[i])
feature.setStringAttribute(('attribute'+str(count)+'.native _data _type'),att _type _list[i])
feature.setStringAttribute(('attribute'+str(count)+'.fme _data _type'),att _ftype _list[i])
计数=计数+1
if(att_name_list[i]='fme_geometry 0'):
feature.setStringAttribute('fm_geometry 0,att_ftype_list[i])
5。将pythoncaller连接到attributereMover并删除要保留的属性。
6。添加一个FFS编写器并创建一个名为“模式”的输出特性。将attributereMover连接到架构输出,并将工作区保存为名为schemaseubset的自定义格式。
现在,您可以在工作区资源中将格式SchemaSubset添加为模式源。只有在要保留参数的字段中列出的属性将用于生成动态模式。
?2019安全亚搏在线软件公司|合法的