c# - Programmatically set transformer parameters in FME2015 -


i trying upgrade application fme2009 fme2015. problem i'm running seems parameters set not being used in actual transformer. instead, default values transformer definition being used. specifically, source , destination coordinate system names not being applied.

setting parameters in way worked when application linked against fme2009.

code excerpt:

stringcollection directives = new stringcollection(); directives.add(safe.fmeobjects.constants.transformermanager.createtransformerdirectives.serializationstring); parameters = string.format("\"source_coordsys,{0},xformer_name,spinecliptransformer,dest_coordsys,{1}\"", sourcecsys, destcsys); directives.add(string.format("name,spinecliptransformer,version,0,parameter_values,{0},input_feature_types,,input_filters,,input_attrs,,output_feature_types,,output_functions,", parameters));  transformer = fme.transformermanager().createtransformer(directives); 

when execute code can see logs default values being used.

log excerpt:

coordinate system named tom_price_mine_mga not exist. badnews: no definition found coordinate system `tom_price_mine_mga(tom_price_mine_mga)' (crdsysmn.cpp:1074) coordinate system named tom_price_mine_mga not exist. badnews: unknown coordinate system 'tom_price_mine_mga' specified - aborting (crdsysmn.cpp:1628) unknown coordinate system 'tom_price_mine_mga' specified - aborting badnews: reprojector: not create reprojection engine (fmereprojector.cpp:404) reprojector: not create reprojection engine

transformer excerpt:

<global_parameters> <global_parameter gui_line="gui coordsys dest_coordsys destination coordinate system:" default_value="epsg:28350" is_stand_alone="false" /> <global_parameter gui_line="gui coordsys source_coordsys source coordinate system:" default_value="tom_price_mine_mga" is_stand_alone="false" /> </global_parameters>  ...  default_macro dest_coordsys epsg:28350 default_macro source_coordsys tom_price_mine_mga 

edit 1

i found ifmeotransformer.serialize method , ran after instantiated transformer.

my directive: name,spinecliptransformer,version,0,parameter_values,"source_coordsys,ll-gda94,xformer_name,spinecliptransformer,dest_coordsys,mga94-50",input_feature_types,,input_filters,,input_attrs,,output_feature_types,,output_functions,

ifmeotransformer.serialize() output: name,spinecliptransformer,version,1,parameter_values,"__compound_parameters,,xformer_name,spinecliptransformer,transformer_group,",input_feature_types,,input_filters,,input_attrs,,output_feature_types,,output_functions,

attempting follow format (without knowing it), changed directive to: name,spinecliptransformer,version,1,parameter_values,"__compound_parameters,source_coordsys,ll-gda94,xformer_name,spinecliptransformer,dest_coordsys,mga94-50,transformer_group,",input_feature_types,,input_filters,,input_attrs,,output_feature_types,,output_functions,

new ifmeotransformer.serialize() output: name,spinecliptransformer,version,1,parameter_values,"__compound_parameters,source_coordsys,xformer_name,spinecliptransformer,transformer_group,",input_feature_types,,input_filters,,input_attrs,,output_feature_types,,output_functions,


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -