Skip to main content

Hello everyone!

I have several raster datasets, all with multiple bands (3-10 bands). I would like to combine these rasters in such a way that the bands of one raster is appended, e.g. a 5 band raster + a 7 band raster + a 3 band raster = a 15 band raster. Note that I have different rasters with different amounts of bands, and that I have no interest in merging/calculating statistics of the bands (this time). It would be nice to select the order of the rasters and corresponding bands, but it is not strictly speaking necessary. The equivalent ArcGIS function to this is 'composite bands' (http://pro.arcgis.com/en/pro-app/tool-reference/data-management/composite-bands.htm), with which you can add as many multiband rasters you like, in whatever order, no matter the raster resolution. How can I do this in FME?

RasterMosaicker does not seem appropriate for this function, because it merges the different bands together rather than appending them RasterBandAdder also does not seem efficient to me?

Thank you!

Hi @wolters, you can decompose the multiband rasters into individual single band rasters with the RasterBandSeparater, and then combine all the single band rasters into a single multiband raster with the RasterBandCombiner.


Hi @wolters, you can decompose the multiband rasters into individual single band rasters with the RasterBandSeparater, and then combine all the single band rasters into a single multiband raster with the RasterBandCombiner.

In addition, the RasterBandOrderer can be used to adjust the order of bands if necessary.

 

 


In addition, the RasterBandOrderer can be used to adjust the order of bands if necessary.

 

 

 

@takashi I am not sure, how these transformers should be used? Splitting the geotiffs with rasterbandseparator, and then combining two (or three) rasters in one rasterbandcombiner, still yields 2 datasets. Do you maybe have an example FME workspace?

The RasterBandCombiner should work on the original files, no need to split them into different bands first. The caveat being that all rasters need to have the same spatial reference (resolution, rows, columns etc)


The RasterBandCombiner should work on the original files, no need to split them into different bands first. The caveat being that all rasters need to have the same spatial reference (resolution, rows, columns etc)

Thanks, is there a way to make all the rasters have the same rows and columns (e.g. like in ArcGIS where you can copy one of the rasters properties into the resample function to make rasters with identical dimentions/properties?
Thanks, is there a way to make all the rasters have the same rows and columns (e.g. like in ArcGIS where you can copy one of the rasters properties into the resample function to make rasters with identical dimentions/properties?
You may need to do some or all of the following

 

Resample to reference resolution -> All rasters now have the same resolution

 

Clip to common area -> All rasters now have approximately the same extent

 

Resample to reference Rows/Columns -> sometimes a clip raster may have one more or one less column/row

 

RasterGeoreferencer (extents mode) -> All rasters now have exactly the same extent

 

 

The easiest way to get the reference properties is to use the RasterPropertiesExtractor on the reference image and then use a featureMerger to attach them to all the other rasters.

 

 

 


Hi @wolters, you can decompose the multiband rasters into individual single band rasters with the RasterBandSeparater, and then combine all the single band rasters into a single multiband raster with the RasterBandCombiner.

Sorry, as @jdh mentioned, the RasterBandSeparator would not be necessary.

 

If all the source rasters have the same extents and the same resolutions, you can just send all of them into a RasterBandCombiner to combine their bands so create a single multiband raster.

 

If their extents and/or resolutions are not same, you will have to uniform them beforehand. The tips have been provided by @jdh already.
You may need to do some or all of the following

 

Resample to reference resolution -> All rasters now have the same resolution

 

Clip to common area -> All rasters now have approximately the same extent

 

Resample to reference Rows/Columns -> sometimes a clip raster may have one more or one less column/row

 

RasterGeoreferencer (extents mode) -> All rasters now have exactly the same extent

 

 

The easiest way to get the reference properties is to use the RasterPropertiesExtractor on the reference image and then use a featureMerger to attach them to all the other rasters.

 

 

 

This seems to be working, though one thing is still confusing me: I clip raster A and then run it through the RasterPropertyExtractor, so I can copy the raster properties to raster B. How do I do that, as the properties are now part of Raster A (and cannot be called in the RasterResampler of raster B, without connecting the two threads?) Attached picture is what I have so far; I end up with a multiband raster that consists of two raster A's stacked together, with raster B rejected.

 


This seems to be working, though one thing is still confusing me: I clip raster A and then run it through the RasterPropertyExtractor, so I can copy the raster properties to raster B. How do I do that, as the properties are now part of Raster A (and cannot be called in the RasterResampler of raster B, without connecting the two threads?) Attached picture is what I have so far; I end up with a multiband raster that consists of two raster A's stacked together, with raster B rejected.

 

You can either use a FeatureMerger to transfer the attributes, or you can use the reference image to Clip the secondary images with Merge Attributes.

 

 


Reply