Skip to main content

Context:

The overarching goal is to extract certain categories of areas from GeoPackage files and then write the output as images with the R, G and B channels containing specific grouped categories.

I've gotten this all to work nicely as long as the geographical area that we collect the data from contains all of the categories that is written to each of the channels. The issue now being that when one of these categories doesn't exist in the selected area - then the connections for that color channel wont be ran and I end up with a broken output.

 

So what would be the best way of making sure the ImageRasterizer leading into the RGB channel creation is ran regardless of input data or not?

Or would I be better off doing something completely different?

 

I am currently working with a RasterNumericCreator to try and generate blank data to be supplied when other data is missing but all I've gotten is a mess trying to get the coordinates accepted by the nodes down the line.

Using this method for the RGB channel wizardry:

https://community.safe.com/s/article/making-rgb-images-with-sentinel-data

Take a look at the NoFeaturesTester from FME Hub.


After a walk outside and lunch I finally found the solution - so to whoever may stumble over this in the future:

 

Instead of testing if there is data going into the ImageRasterizer for the different categories I built this monstrosity to create a base raster with nothing in it and the same Extents and Cell Spacing as the total geographical area of the GeoPackage input.

 

What ultimately made it work was using a RasterToPolygonCoercer with Extract Nodata Values set to Yes as it created the geometry needed to be fed into a FeatureColorSetter and finally the ImageRasterizer which creates the final raster with a value of 0 (black) and all the coordinate data required to merge the channels together.

monstrosityNote: This leads into a RasterMosaicker (along with the original ImageRasterizer) with Overlapping Values set to Sum so that I will always have a black background and no need to check if there is data or not.


Reply