Online raster processing?

Teemu Makela teemu.makela at ARBONAUT.COM
Fri Feb 10 09:57:15 EST 2006


In MapServer Documentation "Raster Data Access" is a following example:

"CLASS
    NAME "near white"
    EXPRESSION ([red] > 200 AND [green] > 200 AND [blue] > 200)
    STYLE
      COLOR 0 255 0
    END
END"

However, it is also stated that "Raster classifications always take place on
only one raster band. It defaults to the first band in the referenced file,
but this can be altered with the BANDS PROCESSING directive."

IS IT POSSIBLE TO CLASSIFY SEVERAL BANDS?

My problem:
I have large set of aerial images. Map file, which work fine:
"LAYER
 NAME "Aerial images"
 TYPE RASTER

 STATUS ON
 MINSCALE 40
     MAXSCALE 50000

 PROJECTION
  "init=epsg:2393"
       END

 TILEINDEX "ilmakuvat.shp" #image format is ECW
END"

I need to reclassify images online so that near white colors would be set to
250,250,250. So, I tried this:

LAYER
 NAME "Classified"
 TYPE RASTER

 STATUS ON
 MINSCALE 40
     MAXSCALE 50000

 PROJECTION
  "init=epsg:2393"
       END

 TILEINDEX "ilmakuvat.shp" #image format is ECW
 PROCESSING "BANDS=1,2,3"

   CLASS
     NAME "near white"
     EXPRESSION ([red] > 250 AND [green] > 250 AND [blue] > 250)
     STYLE
       COLOR 250 250 250
     END
   END
END

But it does not work.

Alone "PROCESSING "BANDS=1,2,3" or "PROCESSING "BANDS=3,2,1" work fine and
produces images with different color scheme.

PROCESSING with one (1) band only works with CLASS definition. So map file:
"PROCESSING "BANDS=2"
...
CLASS
   NAME "near white"
   EXPRESSION ([red] > 250 AND [green] > 250 AND [blue] > 250)
   STYLE
     COLOR 250 250 250
   END
END"
Generates an image with some red pixels, otherwise white. This is fine.

However, if there is CLASS definition and PROCESSING of several bands
(PROCESSING "BANDS=1,2,3") at the same time no image is generated.

What should I do?

Teemu



More information about the mapserver-users mailing list