Open AI writes expressions for RasterExpressionEvaluator

  • 27 February 2024
  • 1 reply
  • 78 views

Userlevel 2
Badge +11

I keep finding more and more areas where AI can enhance or simplify FME workflows. Just another example - we can ask the OpenAI API to give us expressions for RasterExpressionEvaluator and with the latest beta of FME 2024.1 (sorry, not publicly available yet), we can take the expressions from attributes. We can, for example, color a DEM by elevation. Do you want to see what AI can write for us? This is one of three expressions needed for coloring of multiple elevation intervals of the DEM. Good luck finding errors 🤣:
if(A[0] <= 110, if(A[0] <= 22, 0, if(A[0] <= 44, 29, if(A[0] <= 66, 58, if(A[0] <= 88, 87, 116)))), if(A[0] <= 332, if(A[0] <= 154, 144, if(A[0] <= 220, 173, if(A[0] <= 276, 202, if(A[0] <= 332, 231, 255)))), if(A[0] <= 554, if(A[0] <= 388, 238, if(A[0] <= 442, 209, if(A[0] <= 498, 180, if(A[0] <= 554, 151, 122)))), if(A[0] <= 776, if(A[0] <= 610, 255, if(A[0] <= 664, 226, if(A[0] <= 720, 197, if(A[0] <= 776, 168, 139)))), if(A[0] <= 998, if(A[0] <= 832, 165, if(A[0] <= 886, 136, if(A[0] <= 942, 107, if(A[0] <= 998, 78, 49)))), 20))))
The results can be beautiful, especially when the colored DEM is combined with shaded relief, but the color assignment above green is random for some reason although my prompt explicitly tells what colors should be used. Anyhow, I mostly wanted to share my first results here and hope to publish a demo with this eventually.


 

Would you like the AI to write raster expressions for you?


1 reply

Userlevel 5
Badge +30

I keep finding more and more areas where AI can enhance or simplify FME workflows. Just another example - we can ask the OpenAI API to give us expressions for RasterExpressionEvaluator and with the latest beta of FME 2024.1 (sorry, not publicly available yet), we can take the expressions from attributes. We can, for example, color a DEM by elevation. Do you want to see what AI can write for us? This is one of three expressions needed for coloring of multiple elevation intervals of the DEM. Good luck finding errors 🤣:
if(A[0] <= 110, if(A[0] <= 22, 0, if(A[0] <= 44, 29, if(A[0] <= 66, 58, if(A[0] <= 88, 87, 116)))), if(A[0] <= 332, if(A[0] <= 154, 144, if(A[0] <= 220, 173, if(A[0] <= 276, 202, if(A[0] <= 332, 231, 255)))), if(A[0] <= 554, if(A[0] <= 388, 238, if(A[0] <= 442, 209, if(A[0] <= 498, 180, if(A[0] <= 554, 151, 122)))), if(A[0] <= 776, if(A[0] <= 610, 255, if(A[0] <= 664, 226, if(A[0] <= 720, 197, if(A[0] <= 776, 168, 139)))), if(A[0] <= 998, if(A[0] <= 832, 165, if(A[0] <= 886, 136, if(A[0] <= 942, 107, if(A[0] <= 998, 78, 49)))), 20))))
The results can be beautiful, especially when the colored DEM is combined with shaded relief, but the color assignment above green is random for some reason although my prompt explicitly tells what colors should be used. Anyhow, I mostly wanted to share my first results here and hope to publish a demo with this eventually.


 

 

Great article @dmitribagh 

Reply