Skip to main content
Solved

Add a new value in attribute table after I convert dwg to polygon.

  • January 8, 2018
  • 5 replies
  • 49 views

Forum|alt.badge.img+1

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?

Best answer by takashi

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

lau
Forum|alt.badge.img+3
  • January 8, 2018
I am not sure to understand. You want to create a different ogc layer per type of polygon?

 

 


takashi
Celebrity
  • Best Answer
  • January 8, 2018

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.


Forum|alt.badge.img+1
  • Author
  • January 17, 2018

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!

 

 


jneujens
Forum|alt.badge.img
  • January 17, 2018

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.


Forum|alt.badge.img+1
  • Author
  • January 17, 2018

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 !