Skip to main content
Solved

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

  • March 26, 2018
  • 6 replies
  • 141 views

Forum|alt.badge.img

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.

Best answer by LizAtSafe

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

LizAtSafe
Safer
Forum|alt.badge.img+18
  • Safer
  • 1542 replies
  • Best Answer
  • March 26, 2018

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


Forum|alt.badge.img
  • Author
  • 2 replies
  • March 26, 2018

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?


LizAtSafe
Safer
Forum|alt.badge.img+18
  • Safer
  • 1542 replies
  • March 26, 2018

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

 


Forum|alt.badge.img
  • Author
  • 2 replies
  • March 27, 2018
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!

 

 


LizAtSafe
Safer
Forum|alt.badge.img+18
  • Safer
  • 1542 replies
  • March 27, 2018
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

 


fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • March 27, 2018

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.