Solved

Is it possible to set stacking order of incoming rasters before running the RasterMosaicer?

  • 1 February 2023
  • 3 replies
  • 3 views

Badge +14
  • Contributor
  • 120 replies

Imagine having a raster with transparent gaps (null) and wanting to fill these gaps with another dataset (presumably of lower resolution). If this second source is placed under the first the secondary data would "shine through" the gaps. This is how one would solve it in Photoshop, and I'm trying to figure out if the same solution is possible in FME. Is it posible to set the layering/stacking order of incoming datasources before running the RasterMosaicer?

 

(This is a follow up question to: https://community.safe.com/s/feed/0D5Dm000007hjgQKAQ)

icon

Best answer by nielsgerrits 1 February 2023, 13:51

View original

3 replies

Userlevel 6
Badge +32

Yes this works as the gaps are NoData, the RasterMosaicker is set to Overlapping values = Last and Nodata Overwrites Data = No.

 

One way to do this is to create an attribute "order" and give it a value 1 or 2 using an AttributeCreator for each raster. Then use a Sorter to make sure the top raster arrives as the last one.

Userlevel 6
Badge +32

Yes this works as the gaps are NoData, the RasterMosaicker is set to Overlapping values = Last and Nodata Overwrites Data = No.

 

One way to do this is to create an attribute "order" and give it a value 1 or 2 using an AttributeCreator for each raster. Then use a Sorter to make sure the top raster arrives as the last one.

Added workspace demonstrating this.

RasterMosaikerOrderSampleThanks, learned something new today.

Badge +22

Yes this works as the gaps are NoData, the RasterMosaicker is set to Overlapping values = Last and Nodata Overwrites Data = No.

 

One way to do this is to create an attribute "order" and give it a value 1 or 2 using an AttributeCreator for each raster. Then use a Sorter to make sure the top raster arrives as the last one.

@nielsgerrits​  is correct that the best way to deal with this is a sorter before the RasterMosaiker.

I need to add a caveat that the RM uses the resolution of the first image, so if you are using a lower resolution image to fill the gaps you need to either supersample it first to match the higher resolution image or clone the higher resolution and have one with an order value of 0 and the other with an order value of 2.

Reply