Skip to main content
Question

Easiest way to create attributes in shapefile based on attributes from autocad dwg?


Currently I run a testfilter that checks the name of a fme_feature_type which has layer names from the drawing.

So basically my testfilter is full of if statements like

"if @value(fme_feature_type) LIKE %P-STM-MH" and output each if statement to its own output port (Ie 'Manholes' or 'Storm Mainline'). from there i run an attribute creator on each output. the attributecreator looks at the field_name and i add it to a field in my shapefile but named differently. So if field_name is STM-MH its added as an attribute in my shapefile as 'Storm Manhole'

Is there a more efficient way of doing this vs what im doing? I feel like I'll have a lot of layers and there for a lot of outputs where I might need to run 10+ attribute creators.

If theres a better way of doing this I'd love to know it. Thanks

testfilter 

2 replies

connecter
Forum|alt.badge.img+4
  • March 13, 2022

Hi @traviss​ ,

you can try the AttributeValueMapper (disadvantage -> you can only choose one source attribute) or you can do all in one AttributeCreator/AttributeManager with conditional values (filter + new attribute). You get lesser Transformers, but also lesser overview of what you are doing in the workflow. Maybe you can combine fme_feature_type + field_name to a new column and then use the AttributeValueMapper.


david_r
Evangelist
  • March 14, 2022

You can use conditionals directly in the AttributeManager or AttributeCreator, see https://s3.amazonaws.com/gitbook/Desktop-Advanced-2019/DesktopAdvanced1Attributes/1.04.ConditionalValues.html

That way you'd only need a single AttributeManager/Creator and no TestFilter.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings