Question

Unable to set Band interpretation in ECW writer

  • 24 November 2017
  • 6 replies
  • 12 views

Badge

I'm trying to take an RGB raster and convert it to Gray+Alpha. I do the following:

  1. Use RasterExpressionEvaluator to calculate linear luminance from the three RGB bands into a single band with interpretation Gray8
  2. Use RasterBandAdder to add a band with interpretation Alpha8

Using RasterBandPropertyExtractor and Inspector in the workspace, I see that the result have two bands with the correct interpretations. However, once the result is written using the ECW writer, all GIS tools agree that the two bands in the file does not have an interpretation (I have checked the file with QGIS and FME Data Inspector and the bands come up as "Undefined" or "UInt8).

I tried swapping the ECW writer for a GeoTIFF writer and in this case the file came out with correct band interpretations.

Is this a bug in the ECW writer or is there another way to set the interpretation?


6 replies

Badge +1

Hi @mbu, it sounds like you are doing the correct things - having a look at the documentation for the ECW and GeoTIFF writers - ECW writer only supports 8 bit bands (which you've used), although it doesn't support pallettes whereas the GeoTIFF writer does, so I'm wondering if perhaps you have pallettes in use and that's causing the problem? You could check this using the RasterBandPropertyExtractor, and if you have any removing them using the RasterPaletteRemover.

Hope that helps - Mary

Badge

Hi @mbu, it sounds like you are doing the correct things - having a look at the documentation for the ECW and GeoTIFF writers - ECW writer only supports 8 bit bands (which you've used), although it doesn't support pallettes whereas the GeoTIFF writer does, so I'm wondering if perhaps you have pallettes in use and that's causing the problem? You could check this using the RasterBandPropertyExtractor, and if you have any removing them using the RasterPaletteRemover.

Hope that helps - Mary

Hi Mary, thanks for the answer. I am positive my source rasters are RGB without palettes, and I have a RasterBandPropertyExtractor in my workspace which shows that the rasters only have have Gray and Alpha bands before they enter the ECW writer.

 

 

To be clear, the resulting ECW rasters are usable in applications where you can set band interpretation manually - like ArcMap and QGIS. But I'm working with a different application where we try to detect the presence of an alpha band automatically, and thus we need the band interpretations to explicitly be "Gray" and "Alpha".

 

 

I know this post is slightly old but I am also having the same issue as this. When outputting the image as TIF (or JP2) the bands are set correctly. If I instead change the write to ECW then the colorinterp value for each band is listed as Undefined (using gdal_info). Has anyone found an answer to this?

 

Badge +1

Me too! I struggled all day to find a solution, but couldn't find any within FME. GDAL would do it, but you need to purchase a license from Hexagon Geospatial to write ECW. Bummer!

 

Userlevel 4
Badge +26

Me too! I struggled all day to find a solution, but couldn't find any within FME. GDAL would do it, but you need to purchase a license from Hexagon Geospatial to write ECW. Bummer!

 

I would send this into support with a sample workspace and data for them to test with. Seems like a bug to me. Especially seeing as this is now reported by three different people.

 

In fact here is a repro here:

 

repro_2019_1.fmw
Badge +7

Hi @mbu and others,

Thanks for reporting this issue. I have passed the details along to our development team for investigation as this might be something we can improve.

Internal reference:

FMEENGINE-61285

Best,

Nathan

 

Reply