Thanks guys. Adding an EXPRESSION for each class worked great. When using only one class, the EXPRESSION was not necessary. I'm using RGB and everything looks great. <div><br></div><div>Any thoughts about the Legend Graphic? I saw some brief discussions on the doc page.<br>
<div><br clear="all"><div>- John</div><div><br></div><div><br></div><br>
<br><br><div class="gmail_quote">On Mon, Nov 21, 2011 at 9:09 AM, Mark Volz <span dir="ltr"><<a href="mailto:MarkVolz@co.lyon.mn.us">MarkVolz@co.lyon.mn.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
John,<br>
<br>
I was able to get datarange and classrange to work. However I found a couple issues:<br>
<br>
1) I had to include an expression for the raster range. - This may have been fixed in newer versions of MS.<br>
2) I was getting unwanted black areas on my map. - I was using PC256 (to make the image smaller), I had to revert to RGB, which has more colors. Mapserver did not report an error when I was using PC256.<br>
<br>
<br>
<br>
CLASS<br>
EXPRESSION ([pixel] >= 1030 AND [pixel] < 1133)<br>
STYLE<br>
COLORRANGE 176 240 232 255 255 179<br>
DATARANGE 1030 1133<br>
END<br>
END #class<br>
<br>
<br>
<br>
Mark Volz<br>
GIS Specialist<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>] On Behalf Of <a href="mailto:mapserver-users-request@lists.osgeo.org">mapserver-users-request@lists.osgeo.org</a><br>
Sent: Sunday, November 20, 2011 11:00 AM<br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Subject: mapserver-users Digest, Vol 46, Issue 53<br>
<br>
Send mapserver-users mailing list submissions to<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:mapserver-users-request@lists.osgeo.org">mapserver-users-request@lists.osgeo.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:mapserver-users-owner@lists.osgeo.org">mapserver-users-owner@lists.osgeo.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of mapserver-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: gradient display of raster DEM data (John Callahan)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 19 Nov 2011 13:51:38 -0500<br>
From: John Callahan <<a href="mailto:john.callahan@udel.edu">john.callahan@udel.edu</a>><br>
Subject: Re: [mapserver-users] gradient display of raster DEM data<br>
To: "<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>"<br>
<<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
Message-ID:<br>
<CAL=<a href="mailto:axXkvjPjKKbY%2B2FFf0r6Cf8YaRP7ZGmLGvC21GKDnXWMbZQ@mail.gmail.com">axXkvjPjKKbY+2FFf0r6Cf8YaRP7ZGmLGvC21GKDnXWMbZQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Thanks again for the idea of using multiple classes but I can't seem to get<br>
it to work. Has anyone else had success with this method? It seems as<br>
though it's applying only the first defined COLORRANGE to full range of the<br>
values in the dataset.<br>
<br>
I've tried using the below syntax (only COLORRANGE and DATARANGE in each<br>
CLASS) as well as the (proposed?) block syntax as defined at<br>
<a href="http://mapserver.org/development/rfc/ms-rfc-6.html" target="_blank">http://mapserver.org/development/rfc/ms-rfc-6.html</a> (which gives me errors<br>
for RANGEITEM and invalid hex color for MINCOLOR.)<br>
<br>
I am using MapServer 6.0.1 as part of MSW 3.0.3.<br>
<br>
Incorrect image being displayed: <a href="http://i44.tinypic.com/2hdwuuu.jpg" target="_blank">http://i44.tinypic.com/2hdwuuu.jpg</a><br>
<br>
Correct image, created through QGIS: <a href="http://i42.tinypic.com/21d2x5h.jpg" target="_blank">http://i42.tinypic.com/21d2x5h.jpg</a><br>
<br>
<br>
Here is the LAYER portion of my map file. Is there anything obvious I<br>
should change? Thanks for any suggestions.<br>
<br>
***********<br>
LAYER<br>
NAME 'de_dem2m'<br>
TYPE RASTER<br>
DATA 'C:\data\delaware2m.img'<br>
PROCESSING "CLOSE_CONNECTION=DEFER"<br>
EXTENT 166773.496 49314.974 233217.496 204730.974<br>
METADATA<br>
'ows_title' 'Delaware DEM'<br>
INCLUDE "ogc_projections.map"<br>
'wms_include_items' 'all'<br>
END<br>
STATUS ON<br>
DUMP TRUE<br>
TRANSPARENCY 100<br>
PROJECTION<br>
"init=epsg:26957"<br>
END<br>
<br>
CLASS<br>
STYLE<br>
COLORRANGE 170 230 209 255 255 179<br>
DATARANGE 0.0 7.0<br>
END<br>
END<br>
<br>
CLASS<br>
STYLE<br>
COLORRANGE 255 255 179 0 128 64<br>
DATARANGE 7.01 11.0<br>
END<br>
END<br>
<br>
CLASS<br>
STYLE<br>
COLORRANGE 0 128 64 252 186 3<br>
DATARANGE 11.01 14.0<br>
END<br>
END<br>
<br>
CLASS<br>
STYLE<br>
COLORRANGE 252 186 3 199 15 2<br>
DATARANGE 14.01 20.0<br>
END<br>
END<br>
CLASS<br>
STYLE<br>
COLORRANGE 199 15 2 105 48 13<br>
DATARANGE 20.01 40.0<br>
END<br>
END<br>
<br>
CLASS<br>
STYLE<br>
COLORRANGE 105 48 13 171 171 171<br>
DATARANGE 40.01 100.0<br>
END<br>
END<br>
<br>
CLASS<br>
STYLE<br>
COLORRANGE 171 171 171 232 230 232<br>
DATARANGE 100.01 140.0<br>
END<br>
END<br>
<br>
END<br>
*********************<br>
<br>
- John<br>
<br>
***********************************************<br>
John Callahan, Research Scientist<br>
Delaware Geological Survey, University of Delaware<br>
URL: <a href="http://www.dgs.udel.edu" target="_blank">http://www.dgs.udel.edu</a><br>
*************************************************<br>
<br>
<br>
<br>
On Mon, Oct 17, 2011 at 3:05 PM, Smith, Michael ERDC-CRREL-NH <<br>
<a href="mailto:Michael.Smith@usace.army.mil">Michael.Smith@usace.army.mil</a>> wrote:<br>
<br>
> John,<br>
><br>
> I got a larger color range by using multiple classes<br>
><br>
> LAYER<br>
> NAME "hillshade"<br>
> TYPE raster<br>
> TILEINDEX<br>
> "/benchmarking/wms/2011/data/raster/DEM/bil_16int/dem_bil16int.shp"<br>
> PROCESSING "CLOSE_CONNECTION=DEFER"<br>
> PROJECTION<br>
> "+init=epsg:4326"<br>
> END<br>
> CLASS<br>
> STYLE<br>
> COLORRANGE 46 154 88 251 255 128<br>
> DATARANGE 1003 1800<br>
> END<br>
> END<br>
> CLASS<br>
> STYLE<br>
> COLORRANGE 251 255 128 224 108 31<br>
> DATARANGE 1800 2800<br>
> END<br>
> END<br>
> CLASS<br>
> STYLE<br>
> COLORRANGE 224 108 31 200 55 55<br>
> DATARANGE 2800 3500<br>
> END<br>
> END<br>
> CLASS<br>
> STYLE<br>
> COLORRANGE 200 55 55 215 244 244<br>
> DATARANGE 3500 4397<br>
> END<br>
> END<br>
> END<br>
><br>
><br>
> From: John Callahan <<a href="mailto:john.callahan@udel.edu">john.callahan@udel.edu</a>><br>
> Date: Mon, 17 Oct 2011 14:54:13 -0400<br>
> To: "<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>" <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
> Subject: Re: [mapserver-users] gradient display of raster DEM data<br>
><br>
> Thanks for all your responses. I have COLORRANGE / DATARANGE working<br>
> fine in my map file. Works very well. I'm also looking at using gdaldem<br>
> for a more custom color scale. Thanks again.<br>
><br>
> - John<br>
><br>
><br>
><br>
> On Fri, Oct 14, 2011 at 5:49 PM, Smith, Michael ERDC-CRREL-NH <<br>
> <a href="mailto:Michael.Smith@usace.army.mil">Michael.Smith@usace.army.mil</a>> wrote:<br>
><br>
>> John<br>
>><br>
>> The DATARANGE / COLORRANGE keywords will be fully documented by 6.2 but<br>
>> they have been present in MapServer for years (since 4.6 or so).<br>
>><br>
>> We used DATARANGE / COLORRANGE for dem display in this years FOSS4G WMS<br>
>> Benchmarking effort.<br>
>><br>
>> Mike<br>
>><br>
>> --<br>
>> Michael Smith<br>
>> US Army Corps<br>
>> Remote Sensing GIS/Center<br>
>><br>
>> From: John Callahan <<a href="mailto:john.callahan@udel.edu">john.callahan@udel.edu</a>><br>
>> Date: Fri, 14 Oct 2011 16:55:59 -0400<br>
>><br>
>> To: <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
>> Subject: [mapserver-users] gradient display of raster DEM data<br>
>><br>
>> I know this has been asked before but I thought I'd ask to see if<br>
>> anything changed.<br>
>><br>
>> I'm looking to display a raster digital elevation model in mapserver.<br>
>> My data is in flat files, img and tiff. I'd like to display this data as<br>
>> a continuous gradient color range, rather than using CLASS categories/bins<br>
>> for specific colors. Is it still tru ethat this is not possible, easily?<br>
>><br>
>> One method (passed to me on this list) was too generate the colored<br>
>> image I want in another program, using GMT or similar tool, then use that<br>
>> in mapserver. This seems like the best option but is non-trivial to<br>
>> someone who hasn't done this before. (though not terribly difficult.)<br>
>><br>
>> I also read about the use of DATARANGE and COLORRANGE in mapserver.<br>
>> However, these are not in the documentation. Are these available in trunk<br>
>> only? A ticket was generated that seems to say this will be included with<br>
>> MS 6.2. (<a href="http://trac.osgeo.org/mapserver/ticket/1305" target="_blank">http://trac.osgeo.org/mapserver/ticket/1305</a>) Any insight on<br>
>> whether this is still the plan?<br>
>><br>
>><br>
>> Thanks for your help and advice.<br>
>><br>
>> - John<br>
>><br>
>> ***********************************************<br>
>> John Callahan, Research Scientist<br>
>> Delaware Geological Survey, University of Delaware<br>
>> URL: <a href="http://www.dgs.udel.edu" target="_blank">http://www.dgs.udel.edu</a><br>
>> *************************************************<br>
>><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111119/6e425339/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111119/6e425339/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
End of mapserver-users Digest, Vol 46, Issue 53<br>
***********************************************<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div><br></div></div>