[mapserver-dev] RE: MapServer and MultiBand-IMG

Steve Lime steve.lime at dnr.state.mn.us
Thu Nov 7 09:44:03 EST 2002


Hi Stepan/Oliver: This will be a great addition but I'd like  to run it
by Frank Warmerdam first since he's our raster guru and I don't know if
he had something else in mind (or already working in 3.7). I've cc'd the
developers list for feedback.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Stepan Kafka" <stepan.kafka at centrum.cz> 11/05/02 16:56 PM >>>
Hi Oliver,
  I am sending you my changes in Mapserver source code to enable
selecting
raster bands. Only GDAL formats are supported. Originaly I tried it with
3.6
dev. code, I haven't try actual Mapserver version yet!
In map file the bands are supproted with LAYER COLOR parameter:

LAYER
  NAME mylyr
  DATA landsat.tif
  COLOR 7 4 2  # the R G B channels
  ...
END

It would be better to use e.g. BANDS parameter, but I don't know, how to
introduce it.

Steve, if you consider it useful, can you involve these changes to
oficial
release? Can you help us with BANDS parameter. Thank you very much.
There are changes in today downloaded nighty build, I hope I haven't
forgotten anything (the source files are attached):

map.h
712 >   int band1, band2, band3;

mapfile.c
1669 etc>   layer->band1 = -1;
  layer->band2 = -1;
  layer->band3 = -1;

1851 etc >
    case(COLOR):
      if(getInteger(&(layer->band1)) == -1) return(-1);
      if(getInteger(&(layer->band2)) == -1) return(-1);
      if(getInteger(&(layer->band3)) == -1) return(-1);
      break;

mapraster.c
475 etc >
     if(layer->band1 > 0){
        hBand1 = GDALGetRasterBand( hDS, layer->band1 );
        hBand2 = GDALGetRasterBand( hDS, layer->band2 );
        hBand3 = GDALGetRasterBand( hDS, layer->band3 );
        if( hBand1 == NULL || hBand2 == NULL || hBand3 == NULL )
            return -1;
      }
      else{

494 > }

Stepan Kafka
Help Service Remote Sensing
tel: +420-327514118
mailto:kafka at email.cz
http://www.bnhelp.cz



> Hi Stepan,
>
> I would really appreciate if you could send me the code or at least a
> binary containing your implementation. I agree that the results thru
> colorcube preprocessing are no good but I would love to try this with
> 3.7. And I think it would be great to see this functionality in a
common
> release. Most likely we need to develop some extented functions for
our

> project but it would be good if we don't need to reinvent the wheel.
>
> kind regards
> Oliver
>




More information about the mapserver-dev mailing list