displaying rasters with negative pixel values
Christopher Condit
condit at SDSC.EDU
Mon May 8 14:30:58 PDT 2006
Hi Chris-
Here's an excerpt from a mapfile that works for me. There are two
differences:
1) I use the SCALE_BUCKETS processing directive. Try adding this.
2) I haven't tried Erdas formats, which run through GDAL or MapServer.
All the formats I've used are coming through GDAL. So the question is:
is your MapServer compiled with Erdas support? If so then there's a
difference there as well.
Run a mapserv -v and check to see if INPUT=EPPL7 is there.
There could be something else that's totally obvious, too, and we're
just not seeing it.
-Chris
...
DATA "surfaceTemperature.txt"
NAME "Surface Temperature"
OFFSITE 0 0 0
PROCESSING "SCALE_BUCKETS=30"
PROJECTION
"init=epsg:4326"
END
TEMPLATE "..\templates\search.html"
TYPE RASTER
UNITS DD
CLASS
NAME "-1.928 to -0.866"
EXPRESSION ([pixel] >= -1.9275 and [pixel] < -0.86574)
METADATA
END
STYLE
ANGLE 360
COLOR 0 0 255
SYMBOL 0
END
END
CLASS
NAME "-0.866 to 0.196"
EXPRESSION ([pixel] >= -0.86574 and [pixel] < 0.19602)
METADATA
END
STYLE
ANGLE 360
COLOR 13 27 254
SYMBOL 0
END
END
CLASS
...
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Chris Garrard
Sent: Monday, May 08, 2006 10:17 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] displaying rasters with negative
pixel values
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