[mapserver-users] RE: gradient display of raster DEM data

2011-10-14 Thread sam

I struggled with this too on v5.6. After a recent post, I found this link:
http://mapserver.org/development/rfc/ms-rfc-6.html
It shows how COLORRANGE, DATARANGE, and RANGEITEM can be used to apply  
a gradient. It works OK on 5.6.


I still don't know what RANGEITEM does.

kind regards,
Sam Skinner
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: gradient display of raster DEM data (John Callahan)

2011-11-21 Thread Mark Volz
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-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of 
mapserver-users-requ...@lists.osgeo.org
Sent: Sunday, November 20, 2011 11:00 AM
To: mapserver-users@lists.osgeo.org
Subject: mapserver-users Digest, Vol 46, Issue 53

Send mapserver-users mailing list submissions to
mapserver-users@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-requ...@lists.osgeo.org

You can reach the person managing the list at
mapserver-users-ow...@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 
Subject: Re: [mapserver-users] gradient display of raster DEM data
To: "mapserver-users@lists.osgeo.org"

Message-ID:

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.sm...@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
>   DATARANGE2800 3500
> END
>   END
>   CLASS
> STYLE
>   COLORRANGE  200 55 55  215 244 244
>   DATARANGE   3500 4397
> END
>   END
> END
>
>
>   From: John Callahan 
> Date: Mon, 17 Oct 2011 14:54:13 -0400
> To: "mapserver-users@lists.osgeo.org" 
> Subject: Re: [mapserver-users] gra

Re: [mapserver-users] Re: gradient display of raster DEM data (John Callahan)

2011-11-21 Thread Puneet Kishor

On Nov 21, 2011, at 8:09 AM, Mark Volz 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.


At least with ms 6.0.1 I didn't have to use any expression directive. Just 
colorrange and datarange did the trick.


> 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

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Re: gradient display of raster DEM data (John Callahan)

2011-11-21 Thread John Callahan
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  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-boun...@lists.osgeo.org [mailto:
> mapserver-users-boun...@lists.osgeo.org] On Behalf Of
> mapserver-users-requ...@lists.osgeo.org
> Sent: Sunday, November 20, 2011 11:00 AM
> To: mapserver-users@lists.osgeo.org
> Subject: mapserver-users Digest, Vol 46, Issue 53
>
> Send mapserver-users mailing list submissions to
>mapserver-users@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-requ...@lists.osgeo.org
>
> You can reach the person managing the list at
>mapserver-users-ow...@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 
> Subject: Re: [mapserver-users] gradient display of raster DEM data
> To: "mapserver-users@lists.osgeo.org"
>
> Message-ID:
> >
> 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.sm...@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
> >