[mapserver-users] GRIB files

Frank Warmerdam warmerdam at pobox.com
Wed May 13 06:47:53 PDT 2009


Roberto Garcia,MSc wrote:
> Hi, tks for the answers.
> 
> According to my gdainfo output file attached, can anyone tell me what 
> element could be a CLASSITEM?

Roberto,

In MapServer you always classify rasters based on the item [pixel] but
you do not need to explicitly state a classitem.

This is a relatively simple example of raster classification.

LAYER
   NAME grid1
   TYPE raster
   STATUS default
   DATA data/float.tif
   CLASS
     NAME "red"
     EXPRESSION ([pixel] < -3)
     COLOR 255 0 0
   END
   CLASS
     NAME "green"
     EXPRESSION ([pixel] >= -3 and [pixel] < 3)
     COLOR 0 255 0
   END
   CLASS
     NAME "blue"
     EXPRESSION ([pixel] >= 3)
     COLOR 0 0 255
   END
END

> I can see my grib using Grads but what tool do I use to translate 
> individual bands into GeoTIFF?

You can use gdal_translate to extract particular bands from a grib file
as a geotiff (or all the bands).  For instance, the following would
extract band 3 (total precipitation):

gdal_translate -b 3 T126L28.grb total_precip.tif

> Converting the data on-the-fly to an image is the right way to work? 

Having MapServer access the grib file on the fly rather than depending
on pre-translated extracts will reduce data duplication and may help
avoid confusion about what is up to date.  However, it is possible that
there will be a performance penalty for extracting directly from GRIB.
If so, it may not be significant enough to matter to you.

> What are the problems with Apache if I do not do so?

I don't see how either approach relates to Apache.  It is a
data management and possibly performance issue with MapServer.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the MapServer-users mailing list