Question

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

  • 5 February 2018
  • 4 replies
  • 2 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?


4 replies

Badge +22

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

Userlevel 2
Badge +17

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)

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.

 

 

 

Badge +22
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.

 

Reply