Solved

How do I prevent black pixels around edge of raster when converting ESRI Raster Dataset File gdb to .ecw?

  • 26 March 2018
  • 6 replies
  • 11 views

Badge

I am using FME to convert ESRI Raster Dataset orthophotos to an .ecw file and there are some very ugly black pixels added to the border.

icon

Best answer by LizAtSafe 26 March 2018, 18:21

View original

6 replies

Userlevel 2
Badge +14

Hi @carlpreusser,

This article will help get you started with removing the black borders:

This article will help with .ECW specifics, it works with GeoTIFF data but should still work for Esri rasters:

If those don't work for you, could you share your workspace so the community can help you further.

-Liz

Badge

Hi @lizsanderson,

Here is my workspace:

workspace.png

Here are the properties of the Reader:

readerproperties.png

Here are the Writer properties:

writerproperties.png

I tried this same workspace without the RasterBandNoDataRemover transformer and just the Reader->Writer and I still get the same black pixels added.

Here is the starting raster:

originalimage.png

Here is the ECW result:

blackpixels.png

I am not sure why these pixels are being added, they aren't in the original raster. Any thoughts?

Userlevel 2
Badge +14

Hi @lizsanderson,

Here is my workspace:

workspace.png

Here are the properties of the Reader:

readerproperties.png

Here are the Writer properties:

writerproperties.png

I tried this same workspace without the RasterBandNoDataRemover transformer and just the Reader->Writer and I still get the same black pixels added.

Here is the starting raster:

originalimage.png

Here is the ECW result:

blackpixels.png

I am not sure why these pixels are being added, they aren't in the original raster. Any thoughts?

Hi @carlpreusser,

 

Thanks for supplying the screenshots. I'm not sure why it's making those lines but you can try using the RasterSelector (with default parameters) and then the RasterBandNoDataSetter with the Nodata Value set to 0.

 

 

Let me know if that works for you.

 

 

-Liz

 

Badge
Hi @carlpreusser,

 

Thanks for supplying the screenshots. I'm not sure why it's making those lines but you can try using the RasterSelector (with default parameters) and then the RasterBandNoDataSetter with the Nodata Value set to 0.

 

 

Let me know if that works for you.

 

 

-Liz

 

I ran this again and tried using the RasterSelector transformer with RasterBandNoDataSetter at 0 and again am getting the black pixels added to the border. I ran this many times with different compression percentages and that did not make a difference.

 

 

It doesn't seem to be anything to do with the original image or nodata cell replacement. FME is seemingly adding the black pixels to the final image.

 

 

If anyone has any suggestions, literature, or insight I would appreciate the help!

 

 

Userlevel 2
Badge +14
I ran this again and tried using the RasterSelector transformer with RasterBandNoDataSetter at 0 and again am getting the black pixels added to the border. I ran this many times with different compression percentages and that did not make a difference.

 

 

It doesn't seem to be anything to do with the original image or nodata cell replacement. FME is seemingly adding the black pixels to the final image.

 

 

If anyone has any suggestions, literature, or insight I would appreciate the help!

 

 

Would you be able to share one of the orthophotos with us? You can upload it to the community or if it is confidential you can submit a support case.

 

 

Thanks

 

Userlevel 4
Badge +13

I suspect the problem is coming in because there may be two values of 'NoData' coming in from the reader. I've seem problems like this in the past. When performing a resample of the data this is where the issues can arise. Are you reprojecting at all in the worklow? We may be resampling upon write also.

 

Check out the values of the cells in FME Data inspector where the black cells appear just after the raster has been read into FME.

Also check out the reader parameter 'Nodata Handling for Managed Rasters' By default this is set to add an alpha band and set transparency on the image where the original 'NoData' parts of the image were. When re-sampling some cells may be changing values which are not covered by the alpha mask. This makes them appear visible.

 

You can try and see what changing this setting to 'None' does to see the difference in how the image is read in to FME.

 

The trick will be making all of the cells around the data you care about to have all the same cell value.

Reply