Opened 18 years ago

Closed 17 years ago

#1844 closed defect (fixed)

[SLD] raster class names based on the ColorMapEntry

Reported by: assefa Owned by: assefa
Priority: high Milestone:
Component: WMS Server Version: unspecified
Severity: normal Keywords:
Cc:

Description

e-mail discussion the the subject

Hi There,
> 
>   We could maybe use the label element in the ColorMapEntry 
> if available and if not use the quantity value or the 
> exprsssion to set the class name.  In this case, the Rule 
> Name value would not affect the classes created based on a 
> raster symbolizer.  Is this acceptable ?
> 
> Later,
> 
> 
> Kralidis,Tom [Burlington] wrote:

>> >  
>> > Sorry, meant one ColorMap per Rule  :) 
>> > 
>> > 	-----Original Message----- 
>> > 	From: UMN MapServer Users List on behalf of 

> Kralidis,Tom [Burlington] 

>> > 	Sent: Sat 22-Jul-06 11:01 
>> > 	To: MAPSERVER-USERS@LISTS.UMN.EDU 
>> > 	Cc: 
>> > 	Subject: Re: [UMN_MAPSERVER-USERS] MapServer SLD 

> RasterSymbolizer

>> > 	
>> > 	
>> > 
>> > 
>> > 	The OGC:SLD 1.0.0 schema allows for one ColorMap 

> element with 0 or more ColorMapEntry elements.

>> > 	
>> > 	MapServer typically picks up Rule/Name and applies them 

> as a legend title.  For rasters, because of the way the 
> schema is defined, I think MapServer should be picking up 
> ColorMapEntry/@label when doing raster legends, but then what 
> happens when someone creates a Rule/Name value earlier?

>> > 	
>> > 	..Tom
>> > 	
>> > 	
>> > 	
>> > 	        -----Original Message-----
>> > 	        From: UMN MapServer Users List on behalf of Van 

> Ulden, Joost

>> > 	        Sent: Fri 21-Jul-06 18:57
>> > 	        To: MAPSERVER-USERS@lists.umn.edu
>> > 	        Cc:
>> > 	        Subject: [UMN_MAPSERVER-USERS] MapServer SLD 

> RasterSymbolizer

>> > 	       
>> > 	       
>> > 	
>> > 	        Hi all,
>> > 	       
>> > 	        I am unsure how the raster symbolizer is 

> supposed to work in MapServer.  Do I create one Rule in the 
> SLD with one ColorMap that has one or more ColorMapEntries?  
> Or can I create a rule for each ColorMapEntry? Either way 
> works (works using a filter too!!!) but ColorMapEntries can't 
> be given a name.  It is preferable from my point of view to 
> create a rule for each ColorMapEntry so that a decent legend 
> can be generated.

>> > 	       
>> > 	        Thoughts anyone?
>> > 	       
>> > 	        Joost
>> > 	       
>> > 	
>> >

Change History (4)

comment:1 by assefa, 18 years ago

Owner: changed from mapserverbugs to assefa
Summary: [SLD] raster class names based on the ColorMapEntry [SLD] raster class names based on the ColorMapEntry
taking the bug.

comment:2 by assefa, 18 years ago

I have update the cvs head (mapogcsld.c) as per comments in the bug. If 
statisfactory please close the bug.

comment:3 by anne.blankert@…, 17 years ago

mapserver 4.10 is now using the label atrribute from ColorMapEntry as class
name, but not yet correctly: all labels are shifted one class down, the highest
class gets named "unknown". 

propose patch (works for me):
file mapogcsld.c
function msSLDParseRasterSymbolizer()
old:
char *pszLabel = NULL;
new:
char *pszLabel = NULL, *pszPreviousLabel = NULL;


old:
 psLayer->class[nClassId].name = strdup(pszLabel);
new:
 psLayer->class[nClassId].name = strdup(pszPreviousLabel);

old:
 pszPreviousColor = pszColor;
 pszPreviousQuality = pszQuantity;
new
 pszPreviousColor = pszColor;
 pszPreviousQuality = pszQuantity;
 pszPreviousLabel = pszLabel;

and below comment:
/* do the last Color Map Entry */
after line
  nClassId = psLayer->numclasses-1;
add:
if (pszLabel)
  psLayer->class[nClassId].name = strdup(pszLabel);
else
  psLayer->class[nClassId].name = strdup(pszQuantity);


comment:4 by assefa, 17 years ago

Resolution: fixed
Status: newclosed
Thanks Anne. Corrected in mapserver head version.
Note: See TracTickets for help on using tickets.