Skip to main content

I want my workbench to automatically create a value in an attribute table depending on the type of polygon it is. For example, if the value in autocad_layer is KVARTERSM_CENTRUM, I want it to automatically classify the attribute as "KC".

I have multiple attributes I want to automatically classify. The problem is that when I'm searching for transformers and choosing a layer, only "autocad_layer" is available.

Reader must be based on single merged feature type.
I attach an image with my workbench. The first choice I made is that I chose the reader dwg and single merger feature type. I will add an image with my choices in parameters. I also have added "autocad_layer" in the "feature attributes"

In areabuilder have chosen to use "autocad_layer" in the "group by" option. The rest I have not made any choices in. Then I create writer OGC geopackage and select "feature option: insert", "table action: create if needed" Uses automatic in "attribute defintion" and then creates autocad_layer.

I have also tried tested fme_basename and fme_feature_type. But it will be the same result.

Can anyone help me out how to read unique values from "autocad_layer" and automatically add a class to the attribute?

I am not sure to understand. You want to create a different ogc layer per type of polygon?

 

 


Hi @flugan87, if you have an external table that defines mapping rule between layer name (e.g. 'KVARTERSM_CENTRUM') and the new attribute value (e.g. 'KC'), you can merge the table to the polygon features with a FeatureMerger or DatabaseJoiner.


Hi @flugan87, if you have an external table that defines mapping rule between layer name (e.g. 'KVARTERSM_CENTRUM') and the new attribute value (e.g. 'KC'), you can merge the table to the polygon features with a FeatureMerger or DatabaseJoiner.

Sorry for late answer but I tried it and it worked! Thank you Takashi!

 

 


Another way to solve this is by using a AttributeValueMapper transformer. In the end, it works the same as a FeatureMerger or DatabaseJoiner, but you do not to store your mapping table in an external file. You can just configure it in the AttributeValueMapper and keep all your logic in one workspace.


Another way to solve this is by using a AttributeValueMapper transformer. In the end, it works the same as a FeatureMerger or DatabaseJoiner, but you do not to store your mapping table in an external file. You can just configure it in the AttributeValueMapper and keep all your logic in one workspace.

Ok, when I encounter similar problem I will try the AttributeValuemapper. Thank you jneujens
!

 

 


Reply