<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi people,<br>
<br>
I used gdal_translate in the GRIB file I want to show with mapserver,
but there still is something wrong. The following is a partial output
from it:<br>
<br>
Driver: GRIB/GRIdded Binary (.grb)<br>
Files: data\raster\T126L28.grb<br>
Size is <font color="#ff0000"><b>161, 98</b></font><br>
Coordinate System is:<br>
.....<br>
Origin = (-150.000000000000000,-61.246000000000002)<br>
Pixel Size = (0.938000000000000,-0.001836734693878)<br>
Corner Coordinates:<br>
Upper Left&nbsp; (-150.0000000, -61.2460000) (150d 0'0.00"W, 61d14'45.60"S)<br>
Lower Left&nbsp; (-150.0000000, -61.4260000) (150d 0'0.00"W, 61d25'33.60"S)<br>
Upper Right (&nbsp;&nbsp; 1.0180000, -61.2460000) (&nbsp; 1d 1'4.80"E, 61d14'45.60"S)<br>
Lower Right (&nbsp;&nbsp; 1.0180000, -61.4260000) (&nbsp; 1d 1'4.80"E, 61d25'33.60"S)<br>
Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( -74.4910000, -61.3360000) ( 74d29'27.60"W, 61d20'9.60"S)<br>
Band 1 Block=<font color="#ff0000"><b>161x1</b></font> Type=Float64,
ColorInterp=Undefined<br>
&nbsp; Description = 0[-] MSL (Mean sea level)<br>
&nbsp; Metadata:<br>
&nbsp;&nbsp;&nbsp; GRIB_UNIT=[Pa]<br>
&nbsp;&nbsp;&nbsp; GRIB_COMMENT=Pressure reduced to MSL [Pa]<br>
&nbsp;&nbsp;&nbsp; GRIB_ELEMENT=PRMSL<br>
&nbsp;&nbsp;&nbsp; GRIB_SHORT_NAME=0-MSL<br>
&nbsp;&nbsp;&nbsp; GRIB_REF_TIME=&nbsp; 1242453600 sec UTC<br>
&nbsp;&nbsp;&nbsp; GRIB_VALID_TIME=&nbsp; 1242453600 sec UTC<br>
&nbsp;&nbsp;&nbsp; GRIB_FORECAST_SECONDS=0 sec<br>
....<br>
<br>
As u can see the size according to the its header is 161x98, but all
the bands are related as 161x1 block. Why does it happen? Another thing
I noticed is that the dif between upper and lower latitude in the
corner coordinates is very small (-61.246 to -61.426).<br>
<br>
The issue is that, when mapserver renders this layer it only draws a
straight line below South America, exactly where the whole image should
start, as my CTL below shows.<br>
<br>
dset ^T126L28.grb<br>
title pac/sa/atlan sector: troposphere file<br>
undef 1e+20<br>
dtype grib<br>
index ^T126L28.gmp<br>
xdef 161 linear -150.000015 0.937500<br>
ydef 98 levels<br>
-61.246 -60.311 <br>
-59.376 -58.441 -57.506 -56.571 -55.636 -54.701 -53.766 -52.831 -51.896
-50.961 <br>
-50.026 -49.091 -48.156 -47.221 -46.286 -45.350 -44.415 -43.480 -42.545
-41.610 <br>
-40.675 -39.740 -38.805 -37.870 -36.935 -36.000 -35.065 -34.130 -33.195
-32.260 <br>
-31.325 -30.389 -29.454 -28.519 -27.584 -26.649 -25.714 -24.779 -23.844
-22.909 <br>
-21.974 -21.039 -20.104 -19.169 -18.234 -17.299 -16.364 -15.429 -14.493
-13.558 <br>
-12.623 -11.688 -10.753&nbsp; -9.818&nbsp; -8.883&nbsp; -7.948&nbsp; -7.013&nbsp; -6.078&nbsp;
-5.143&nbsp; -4.208 <br>
&nbsp;-3.273&nbsp; -2.338&nbsp; -1.403&nbsp; -0.468&nbsp;&nbsp; 0.468&nbsp;&nbsp; 1.403&nbsp;&nbsp; 2.338&nbsp;&nbsp; 3.273&nbsp;&nbsp;
4.208&nbsp;&nbsp; 5.143 <br>
&nbsp; 6.078&nbsp;&nbsp; 7.013&nbsp;&nbsp; 7.948&nbsp;&nbsp; 8.883&nbsp;&nbsp; 9.818&nbsp; 10.753&nbsp; 11.688&nbsp; 12.623&nbsp;
13.558&nbsp; 14.493 <br>
&nbsp;15.429&nbsp; 16.364&nbsp; 17.299&nbsp; 18.234&nbsp; 19.169&nbsp; 20.104&nbsp; 21.039&nbsp; 21.974&nbsp;
22.909&nbsp; 23.844 <br>
&nbsp;24.779&nbsp; 25.714&nbsp; 26.649&nbsp; 27.584&nbsp; 28.519&nbsp; 29.454 <br>
zdef 7 levels<br>
1000 925 850 700 500 300 200&nbsp;&nbsp; ===&gt; set Z 1 ou 2 ou 3 ... ou 7
(GRADS)<br>
tdef 1 linear 6Z16may2009&nbsp; 6hr<br>
vars 15<br>
psnm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 2,102,&nbsp; 0,&nbsp; 0 SEA LEVEL PRESSURE [hPa]<br>
tsfc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 187,&nbsp; 1,&nbsp; 0,&nbsp; 0 SURFACE TEMPERATURE [K]<br>
prec&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 61,&nbsp; 1,&nbsp; 0,&nbsp; 0 TOTAL PRECIPITATION [Kg/m2/day]<br>
cbnv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 71,&nbsp; 3,&nbsp; 0,&nbsp; 0 CLOUD COVER [0-1]<br>
role&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 114,&nbsp; 8,&nbsp; 0,&nbsp; 0 OUTGOING LONG WAVE AT TOP [W/m2]<br>
mask&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp; 137,100 MASK [-/+]<br>
uvel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 33,100 ZONAL WIND (U) [m/s]<br>
vvel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 34,100 MERIDIONAL WIND (V) [m/s]<br>
omeg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 39,100 OMEGA [Pa/s]<br>
fcor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 35,100 STREAM FUNCTION [m2/s]<br>
potv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 36,100 VELOCITY POTENTIAL [m2/s]<br>
zgeo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp; 7,100 GEOPOTENTIAL HEIGHT [gpm]<br>
temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 11,100 ABSOLUTE TEMPERATURE [K]<br>
umrl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 52,100 RELATIVE HUMIDITY [no Dim]<br>
umes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp; 51,100 SPECIFIC HUMIDITY [kg/kg]<br>
endvars<br>
<br>
Can someone help me to find out what is happening?<br>
<br>
Tks a lot<br>
<br>
Roberto Garcia<br>
<br>
<br>
Frank Warmerdam wrote:
<blockquote cite="mid:4A0ACF89.3010004@pobox.com" type="cite">Roberto
Garcia,MSc wrote:
  <br>
  <blockquote type="cite">Hi, tks for the answers.
    <br>
    <br>
According to my gdainfo output file attached, can anyone tell me what
element could be a CLASSITEM?
    <br>
  </blockquote>
  <br>
Roberto,
  <br>
  <br>
In MapServer you always classify rasters based on the item [pixel] but
  <br>
you do not need to explicitly state a classitem.
  <br>
  <br>
This is a relatively simple example of raster classification.
  <br>
  <br>
LAYER
  <br>
&nbsp; NAME grid1
  <br>
&nbsp; TYPE raster
  <br>
&nbsp; STATUS default
  <br>
&nbsp; DATA data/float.tif
  <br>
&nbsp; CLASS
  <br>
&nbsp;&nbsp;&nbsp; NAME "red"
  <br>
&nbsp;&nbsp;&nbsp; EXPRESSION ([pixel] &lt; -3)
  <br>
&nbsp;&nbsp;&nbsp; COLOR 255 0 0
  <br>
&nbsp; END
  <br>
&nbsp; CLASS
  <br>
&nbsp;&nbsp;&nbsp; NAME "green"
  <br>
&nbsp;&nbsp;&nbsp; EXPRESSION ([pixel] &gt;= -3 and [pixel] &lt; 3)
  <br>
&nbsp;&nbsp;&nbsp; COLOR 0 255 0
  <br>
&nbsp; END
  <br>
&nbsp; CLASS
  <br>
&nbsp;&nbsp;&nbsp; NAME "blue"
  <br>
&nbsp;&nbsp;&nbsp; EXPRESSION ([pixel] &gt;= 3)
  <br>
&nbsp;&nbsp;&nbsp; COLOR 0 0 255
  <br>
&nbsp; END
  <br>
END
  <br>
  <br>
  <blockquote type="cite">I can see my grib using Grads but what tool
do I use to translate individual bands into GeoTIFF?
    <br>
  </blockquote>
  <br>
You can use gdal_translate to extract particular bands from a grib file
  <br>
as a geotiff (or all the bands).&nbsp; For instance, the following would
  <br>
extract band 3 (total precipitation):
  <br>
  <br>
gdal_translate -b 3 T126L28.grb total_precip.tif
  <br>
  <br>
  <blockquote type="cite">Converting the data on-the-fly to an image is
the right way to work? </blockquote>
  <br>
Having MapServer access the grib file on the fly rather than depending
  <br>
on pre-translated extracts will reduce data duplication and may help
  <br>
avoid confusion about what is up to date.&nbsp; However, it is possible that
  <br>
there will be a performance penalty for extracting directly from GRIB.
  <br>
If so, it may not be significant enough to matter to you.
  <br>
  <br>
  <blockquote type="cite">What are the problems with Apache if I do not
do so?
    <br>
  </blockquote>
  <br>
I don't see how either approach relates to Apache.&nbsp; It is a
  <br>
data management and possibly performance issue with MapServer.
  <br>
  <br>
Best regards,
  <br>
</blockquote>
</body>
</html>