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