Skip to main content

Hi,



Can anyone answer these questions in order to aid my
understanding of Rasters? Apologies but there are a few questions, some are
general and some are specially FME related.



1. If a raster file contains multiple bands, do the
bands ALWAYS have to be of the same numerical interpretation type? ( if this is
true the presumably this would be due to a restriction of the data
structure/model?) For example:


band{0}=Uint8


band{1}= Uint8


band{2}=Uint8


Or could you have mixed types as
in:


band{0}=Uint8


band{1}= Int16


band{2}=Real32


band{3}=Int8



    2. Within FME is there a way to ‘expose’ the
    interpretation type of band/s within a raster? If so what method could I use to
    do this? I have used RasterPropertyExtractor to obtain many details of the
    raster file, including the number of bands, but I cannot ascertain the actual interpretation
    types using this method. Essentially, I want to understand whether numerous raster
    files all have the same band interpretation type.



      3. I have a mixed set of RGB raster files, either
      where the RGB bands are all UInt8; or, where the RGB bands are all Uint16.

      I decided that I would consolidate them
      into 1 interpretation type.


      Firstly I thought that I would try and convert the UInt8 files
      to UInt16. I used the RasterExpressionEvaluator to perform a test conversion. I
      only converted the r band just as a test, by Red16=A10]. I then looked at the
      value of a given pixel both before and after the conversion, before pixel X was
      A/0] =100; and after pixel X was Aa0] =100. I was sort of expecting the after
      value to be something like Ak0] =25633 where ((100/256)*65536)); i.e. that the position
      of the value on the scale would be proportionally identical on the new scale. I
      presume that this is NOT the case as the value range Red8 (0-255) sits within
      the value range of Red16 (0-65535), therefore no change was applied as pixel X =100 was already 'valid'? Is this
      correct?


      Consequently, if I do want to perform the 'proportional' conversions from
      either UInt8 to UInt16; or, UInt16 to UInt8, what method or formulas should I apply
      to complete conversions in either direction? Or should I NOT be doing this as it is this bad practice? Or, is it ok to convert
      in both directions? Or should I only
      convert down?

      I am using FME Desktop 2015.1



      Many thanks in advance.



      Rob









      Hi @rob14,

      1. A raster as a logical data structure can have multiple bands with different data types, but I've never come across an actual raster format that supports such mixed data types, so far.
      2. The RasterBandPropertyExtractor might help you.
      3. The RasterBandInterpretationCoercer or the RasterInterpretationCoercer might help you.

      Reply