Skip to main content
Question

Convert Excel to Image

  • April 5, 2023
  • 2 replies
  • 34 views

philippeb
Enthusiast
Forum|alt.badge.img+22

Hi,

 

We have tables of values with colors in Excel that we would want to integrate in a mxd.

I though to export them automatically in jpeg files. It would be easier after to integrate images in mxd.

How could I do that with FME?

 

Thanks !

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1620 replies
  • April 5, 2023

To do anything with an MXD in FME, you'll to use a PythonCaller and ArcPy

 

https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/mapdocument-class.htm


david_r
Celebrity
  • 8391 replies
  • April 6, 2023

If you want to create a jpeg file with a single, specific color, you could e.g. use the RasterRGBCreator followed by a JPEG writer. You could then publish the color value as a parameter and use a second workspace to loop over all the Excel lines (FMEServerJobSumitter or WorkspaceRunner).

If you have RGB values in your Excel, you can convert them to an FME color code like this:

@round(@Value(Red)/255,3),@round(@Value(Green)/255,3),@round(@Value(Blue)/255,3)

Given that the attribute names are "Red", "Green" and "Blue".