Skip to main content

Morning,

 

 

I have been happily using FME to translate out raw MasterMap GML files into DWG files for our architects. The fan-out by Attribute has been an invaluable tool.

 

 

However, they have now asked if I can get the lines coloured in for them... I have tried everything i can think of but cannot seem to do it. 

 

 

Ill try to explain further... one of the readers is TopograhpicLine. When fanned out by Descriptivegroup our Architects can switch on and off buildings, a road, general features etc. It is these fanned out features they want different colours so for example buildings red, woodland green.

 

 

Any assistance in this would be much appreciated!

Ben

You can use an attributevaluemapper to set the colour depending on the descriptive group
I have triesd this with no luck, my output lines remain red
Which attribute are you changing, i just tested using fme_color and it worked fine

I am changing TopographicLine:

 

Source Attribute: DescriptiveGroup

 

Destination Attribute: FME_Color

 

Default Value: Unkown

 

 

Mapping Direction: Forward (Source to Destination)

 

 

and then just as a trial have chosen two Values

Building | 0,01,

 

Path | 0,1,0

I have also kept the Fan Out option crossed.

 


Hi,

 

 

You need to convert the RGB values in to correct fme color definitions,

 

Try the following:
  • Use an attribute splitter to devide the RGB
  • Calculate for each value the fme color equivalent (R value /255.0) (attribute creator > arithmetic editor)
  • Recombine fme RGB values into the fme_color attribute (string concatenator)
  • Use the fme_color attribute in the DWG styler.
You can create a custom transformer for future use.

 

Hope this helps,

 

Itay
That is if you have the RGB values in the GML...if you just make up a few instead in the attribute mapper then use the correct fme attribute naming for color (case sensitive): fme_color and fme_fill_color

 


That's strange, the process works for me

 

 


Oh my goodness!! Thankyou so much EGomm your post made me persevere and showed i was doing somthing right.

 

 

Thankyou Itay for helping place the last piece of the jigsaw in! It turns out that my chubby little finger likes pressing the caps button and therefore by just changing FME_Color to fme_color I can please the architects!

 

Thank you all very much!


Hi,

 

 

Actually it should work with any attribute name including FME_Color.....:(

 

 

Glad to hear you have the solution.

 

 

Cheers,

 

Itay

Reply