Skip to main content
Question

Make a Raster's "value" decrease from the center of the raster to it's short side

  • February 5, 2018
  • 4 replies
  • 31 views

Currently my workbench creates a polygon that I convert to a Raster with a cumulative oil number as the Z Value.

 

Now, what I want to do with this Raster is:

 

 

From the middle of the Raster to the short side of the polygon (see attached jpg) I want to slowly decrease the pixel value from 100% to 0%.

 

 

How can I accomplish this in FME 2017?

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.

4 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • February 5, 2018

I would probably create an alpha band with the appropriate decay and add in to the raster with the value, and then mosaic it with an all 0 raster (alpha 255) with composite using alpha channel.

The 0 raster should be first into the mosaicker.

See https://knowledge.safe.com/articles/1219/alpha-compositing-blending-two-raster-images.html


takashi
Celebrity
  • 7843 replies
  • February 6, 2018

Hi @jeffm, if I understand the requirement correctly, this workflow might be a solution. Assuming the input geometries are 3D polygons that forms a roof-like shape. The range of resulting cell values will be 0 - $(MAX_VALUE).

Left: Input (3D Polygons), Right: Output (Numeric Raster)


  • Author
  • 1 reply
  • February 6, 2018

I would probably create an alpha band with the appropriate decay and add in to the raster with the value, and then mosaic it with an all 0 raster (alpha 255) with composite using alpha channel.

The 0 raster should be first into the mosaicker.

See https://knowledge.safe.com/articles/1219/alpha-compositing-blending-two-raster-images.html

I just have the one polygon, it isn't folded. The line in the middle of the graph is what is used to make the buffer. It's just a polygon with a value. It sounds like I need to break down the polygon into raster cells, then somehow calculate the cell values depending on it's spatial position.

 

 

 


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • February 6, 2018
I just have the one polygon, it isn't folded. The line in the middle of the graph is what is used to make the buffer. It's just a polygon with a value. It sounds like I need to break down the polygon into raster cells, then somehow calculate the cell values depending on it's spatial position.

 

 

 

If you look at the alphaCompositing workspace in the above link, there is a MultiBufferer custom transformer, that creates buffer rings, and an ExpressionEvaluator that creates a decay value based on the buffer id and number of buffers.

 

 

Use that on your line. I tend to use 20 buffers with a 5% drop in value, but that is completely customisable.