[Mapserver-users] GRASS raster from GDAL

Matt Doggett mdoggett at coas.oregonstate.edu
Thu Apr 3 15:57:21 EST 2003


Got it!  Turns out I have to define a colortable mapping in GRASS.
Here's the initial report from gdalinfo :

mdoggett at precip> gdalinfo us_ppt_01r
Driver: GRASS/GRASS Database Rasters
Size is 1465, 623
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["unknown",
        SPHEROID["WGS84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (-126.020833,50.020833)
Pixel Size = (0.041667,-0.041667)
Corner Coordinates:
Upper Left  (-126.0208333,  50.0208333) 
Lower Left  (-126.0208333,  24.0625000) 
Upper Right ( -64.9791667,  50.0208333) 
Lower Right ( -64.9791667,  24.0625000) 
Center      ( -95.5000000,  37.0416667) 
Band 1 Block=1465x1 Type=Byte, ColorInterp=Gray
  Min=2.000 Max=23.000 
  NoData Value=255

My reclassified raster had no colortable defined for it and gdalinfo
reports ColorInterp=Gray.  This results is completely black layer.
So, on a hunch, I defined a colortable for the raster in GRASS.  With
that, mapserver now correctly renders the raster.

Thanks for the pointer.

Matt

Matt Doggett
Spatial Climate Analysis Service
Oregon State University
316 Strand Ag Hall
Corvallis, OR 97331
(541)737-9153
mdoggett at coas.oregonstate.edu
 

> -----Original Message-----
> From: Frank Warmerdam [mailto:warmerdam at pobox.com]
> Sent: Thursday, April 03, 2003 12:04 PM
> To: mdoggett at coas.oregonstate.edu
> Subject: Re: [Mapserver-users] GRASS raster from GDAL
> 
> Matt Doggett wrote:
> > I got it working...kind of.  I had to do the following:
> >
> > * Put a .grassrc5 file into the DocumentRoot directory
> > * Reclassify the GRASS raster into categories < 255. In my case, the
> > raster grid now has values from 0-24.
> >
> > However, mapserver only renders a completely black layer--no colors
or
> > shading to distinguish the different raster cells. Shp2img renders
the
> > same results.
> >
> > Do I need to use CLASS object to colorize the values?
> 
> Matt,
> 
> You should not need CLASS objects to colorize the values, but that
should
> also work.  How big is your dataset?  It might be helpful if you could
> provide
> it to me in .tar.gz format to check out.  Also, using "gdalinfo" you
might
> want to verify that the correct colormap is known for the dataset.
> 
> 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