Skip to main content

I have 5 original jpg orthophotos as follows and would like to have the same results but as one mosaicker file

 

image1

 

I have the following workbench to merge all of the 5 files into one mosaicker

 

image2 

 

The output file on the writer I get the following final results with a black background which I don't want:

 

image3 

If I set the RasterBadnNoDataSetter to a value of 255, I then get a white background, which I also don't need.

 

Any ideas as to why I can't get the desired mosaicker without any black or white background?

Thank you for your time and any insights would be greatly appreciated.

 

 

 

 

 

Put the NodataSetter after the Mosacker or at the very end.


Thanks for your reply and Sorry for this late reply. I had placed the RasterBandNoDataSetter (to have 0 values replaced) at the end of the workbench before the writer, it doesn't work. I've placed an extra RasterBandNoDataSetter (to have 255 values replaced), also it didn't work.

 

Any other methods I can tackle this in FME or perhaps there isn't one in FME?


Hello @messagemauri​ , would you be able to share your workspace and data? Here to help, Kailin.


Here is another idea. Try writing to another filetype. PNG supports transparency for example. Maybe yours doesn't.

Also, you can try clipping your raster to the the extent of your data. When writing, the outside should automatically receive a nodata flag.


Thank you very much @caracadrian​ and @kailinatsafe (Safer)​ 

I managed to get rid of the No Data 0 values (Black background) by actually implementing a PNGRASTER writer (Portable Network Graphics). However, there are a few black dots around the border of the image, refer to Actual Results below. I also placed the RasterBandNoDataSetter (to have 0 values replaced) at the end of the workbench but I get the same results. The output file is good, a lot better than before, but any ideas as to why there was some distortion that may have kept the black border dots (Band 0= 0, Band 1 = 0, Band 2 = 2) ??

 

Workbench:

Add WriterActual Results:

actual_resultsCompared to Previous Results the first time (undesirable results):

 previous_results


@kailinatsafe​  see, Sample Data zip File attached

 


@kailinatsafe (Safer)​  see sample Workbench attached.

 


Hello @messagemauri​ , sorry for the late response! I think I've managed to solve the issue. There was another challenge I ran into with the JPEG compression algorithm (leaves slight black areas around the mosaiced raster, but this is also fixable). If you would like to remove the remaining blackened areas, I recommend clipping your raster with a vector boundary (perhaps digitizing?), after the RasterInterpretationCoercer. Let me know if you have any questions about the attached workspace! Best of luck, Kailin.


Reply