Ticket #3663 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Classified non 8bit rasters not displaying

Reported by: msmitherdc Owned by: warmerdam
Priority: normal Milestone: 6.0 release
Component: GDAL Support Version: svn-trunk (development)
Severity: normal Keywords:
Cc: dmorissette, sdlime

Description (last modified by warmerdam) (diff)

Raster info:

Band 1 Block=480x4 Type=Float32, ColorInterp=Gray
  Min=18.645 Max=22.925 
  Minimum=18.645, Maximum=22.925, Mean=19.321, StdDev=1.002
  NoData Value=-3.4028234663852886e+38
  Metadata:
    LAYER_TYPE=athematic
    STATISTICS_MINIMUM=18.644718170166
    STATISTICS_MAXIMUM=22.925430297852
    STATISTICS_MEAN=19.320643792494
    STATISTICS_STDDEV=1.001758947595
  PROCESSING "SCALE=0, 255"
  PROCESSING "SCALE_BUCKETS=255"
  CLASS
    NAME "red"
    EXPRESSION ([pixel] > 0)
    STYLE
      COLOR 255 0 0
    END
  END

This displays a red raster in 5.6.5 but displays empty with trunk (r10920)

Attachments

dem3_final_layer.map Download (1.1 KB) - added by msmitherdc 2 years ago.
layer section showing >16bit data classification problem

Change History

Changed 2 years ago by msmitherdc

  • cc dmorissette added; dmorisette removed

Changed 2 years ago by warmerdam

  • status changed from new to assigned
  • description modified (diff)

Changed 2 years ago by warmerdam

Mike,

I have a similar test in the regression test suite (msautotest/gdal/class16_oddscale.map) and it seems to working ok. I think I will need a minimal map file and test data file I can use to reproduce this problem to go further.

Changed 2 years ago by msmitherdc

layer section showing >16bit data classification problem

Changed 2 years ago by msmitherdc

Hmm. I tried the autotest map, class16_oddscale.map, and it displayed fine in mapserver 5.6.5 but not in trunk (i got a blank image)

Both are linked dynamically to trunk gdal.

Changed 2 years ago by warmerdam

It turns out I have the same problem here, I just didn't know because perceptualdiff was telling me the results matched the test image. perceptualdiff does not understand color tables and was thus of limited use for this comparison.

I am pursuing the bug...

Changed 2 years ago by warmerdam

This relates to the following code in msGetClass_FloatRGB():

          case(MS_EXPRESSION):
            /*
            ** Big, fat TODO!
            **  
            ** See msEvalExpression() in maputil.c for an example of how to do this. Basically need to define some raster bind 
            ** variables: namely [red], [green], [blue] and [pixel]. Need to update the lexer and msTokenizeExpression() to 
            ** recognize them...
            */

            return(-1);

Changed 2 years ago by warmerdam

  • cc sdlime added
  • status changed from assigned to closed
  • resolution set to fixed

So it turns out that raster classification was never implemented when the expression parser was upgraded. I have done so now in trunk (r10976).

Changed 2 years ago by sdlime

Oh crap, sorry. I did make the big fat TODO note at least. Thanks for covering my big, fat... I'll take a look at your implementation.

There should be massive speed increases with rasters, I'd be very interested to know if that's actually true.

Steve

Changed 2 years ago by warmerdam

Steve,

The TODO was very helpful when I stepped through the code. :-)

I haven't tried any performance comparison - perhaps I can construct a test case.

Note: See TracTickets for help on using tickets.