displaying rasters with negative pixel values

Chris Garrard chrisg at BIOLOGY.USU.EDU
Mon May 8 10:16:46 PDT 2006


Hi Chris,

Thanks for looking at this.  Here's the map file.  It displays classes
c5 - c10 just fine, and shows part of the data from the c4 class.  I
have big blank areas for classes c1 - c3.  If I use either of the
commented-out processing directives instead of the classes, I still get
the blank areas.  The image displays fine in other software, so I know
the data are there.

MAP
  NAME utah
  EXTENT -1510000 -285000 -1020000 375000
  UNITS METERS
  IMAGETYPE png
  SIZE 450 450

  OUTPUTFORMAT
    NAME PNG
    DRIVER "GD/PNG"
    MIMETYPE "image/png"
    IMAGEMODE RGBA
    EXTENSION "png"
    TRANSPARENT OFF
  END

  WEB
    IMAGEPATH "/webgis/apache/htdocs/tmp/"
    IMAGEURL "/tmp/"
  END

  LAYER
    NAME mintemp
    TYPE raster
    STATUS default
    DATA '/auto/earth2/ars_data/statedata/utah/ut_tmin.img'
#    PROCESSING "SCALE=AUTO"
#    PROCESSING "SCALE=-7,10"
    CLASS
      NAME 'c1'
      TITLE '(-7) - (-6)'
      EXPRESSION ([pixel] >= -7 AND [pixel] <= -6)
      COLOR 0 0 255
    END
    CLASS
      NAME 'c2'
      TITLE '(-5.9) - (-4)'
      EXPRESSION ([pixel] > -6 AND [pixel] <= -4)
      COLOR 54 97 255
    END
    CLASS
      NAME 'c3'
      TITLE '(-3.9) - (-2)'
      EXPRESSION ([pixel] > -4 AND [pixel] <= -2)
      COLOR 56 171 255
    END
    CLASS
      NAME 'c4'
      TITLE '(-1.9) - 0'
      EXPRESSION ([pixel] > -2 AND [pixel] <= 0)
      COLOR 0 255 255
    END
    CLASS
      NAME 'c5'
      TITLE '0 - 1'
      EXPRESSION ([pixel] > 0 AND [pixel] <= 1)
      COLOR 145 255 181
    END
    CLASS
      NAME 'c6'
      TITLE '1.01 - 2'
      EXPRESSION ([pixel] > 1 AND [pixel] <= 2)
      COLOR 209 255 105
    END
    CLASS
      NAME 'c7'
      TITLE '2.01 - 3'
      EXPRESSION ([pixel] > 2 AND [pixel] <= 3)
      COLOR 255 255 0
    END
    CLASS
      NAME 'c8'
      TITLE '3.01 - 4'
      EXPRESSION ([pixel] > 3 AND [pixel] <= 4)
      COLOR 255 184 0
    END
    CLASS
      NAME 'c9'
      TITLE '4.01 - 6'
      EXPRESSION ([pixel] > 4 AND [pixel] <= 6)
      COLOR 255 112 0
    END
    CLASS
      NAME 'c10'
      TITLE '6.01 - 10'
      EXPRESSION ([pixel] > 6 AND [pixel] <= 10)
      COLOR 255 0 0
    END
  END

END

> -----Original Message-----
> From: Christopher Condit [mailto:condit at sdsc.edu] 
> Sent: Friday, May 05, 2006 5:59 PM
> To: Chris Garrard; MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: RE: [UMN_MAPSERVER-USERS] displaying rasters with 
> negative pixel values
> 
> Hi Chris-
> Can you send your map file?  I've had great success with 
> negative raster
> values when defining my own classes (Sea temperature GeoTIFF 
> / AAI Grid,
> for instance).
> 
> -Chris
> 
> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Chris Garrard
> Sent: Friday, May 05, 2006 5:16 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] displaying rasters with negative pixel
> values
> 
> Hi all,
> 
> I have a raster data set that has values from -7 to 10 (mean minimum
> temps C).  I can't get any of the pixels with values less than -1 to
> display in mapserver.  I have tried using the processing directive to
> scale the values and I've tried specifying classes, and neither works.
> I have also tried different file formats (geotiffs and erdas .img).
> 
> Anyone know why this isn't working?
> 
> I'm using mapserver 4.8.3 and gdal 1.3.1 on solaris 10.
> 
> Thanks for any ideas,
> Chris
> 



More information about the MapServer-users mailing list