[Mapserver-users] CLASS is like a CASE statement, it will stop after one is selecte d????

Javier Castillejo Montes jcastil1 at tragsa.es
Fri Jul 16 02:52:39 EDT 2004


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C46B01.7DAC04C2
Content-Type: text/plain;
	charset="iso-8859-1"

Hi all 

this is the newbie again

Stephen wrote
 "CLASS is like a CASE statement, it will stop after one is selected"

on an explanation he told me some weeks ago... I tried with this but it
doesn't work for me.
I have one layer with some class on it and  ALL are done. Where have I the
error???

.map:

	LAYER # Provincias polygon layer begins here
		NAME		provPerimeter
		DATA        provin
		STATUS      OFF
		TYPE        POLYGON
		GROUP		Provincias
		
		PROJECTION
		  "init=epsg:23030"
		END

		METADATA
			"title" "Provincias"
		END	
		
	     LABELITEM "Divi"
	     CLASSITEM    "Case1"
			CLASS
				EXPRESSION "D1"
				COLOR 99 154 206
				OUTLINECOLOR 0 0 0
			END
			CLASS
				EXPRESSION "D2"
				COLOR 255 154 99
				OUTLINECOLOR 0 0 0
			END
			CLASS
				EXPRESSION "D3"
				COLOR 99 255 206
				OUTLINECOLOR 0 0 0
			END
			CLASS
				EXPRESSION "D4"
				COLOR 255 101 99
				OUTLINECOLOR 0 0 0
			END
			CLASS
				EXPRESSION "D5"
				COLOR 255 207 99
				OUTLINECOLOR 0 0 0
			END
END



-----Mensaje original-----
De: Stephen Woodbridge [mailto:woodbri at swoodbridge.com]
Enviado el: viernes, 02 de julio de 2004 14:49
Para: Javier Castillejo Montes
CC: Mapserver-users at lists.gis.umn.edu
Asunto: Re: [Mapserver-users] Different colors in different layers


Same idea, but you have to know the range of colors that are possible 
and create a CLASS for each COLOR then use an EXPRESSION to select the 
color instead of the "divi" so if your values were like 1 .. 100 and you 
wanted assign colors based on 1-10, 11-20, 21-30, ..., 91-100

CLASS
   EXPRESSION ([divi] < 11)
   STYLE
     COLOR ...
   END
END
CLASS
   EXPRESSION ([divi] < 21)
   STYLE
     COLOR ...
   END
END
...
CLASS
   # no expression is like an default: and will catch
   # anything not caught above.
   STYLE
     COLOR ...
   END
END

CLASS is like a CASE statement, it will stop after one is selected.

-Steve W.

Javier Castillejo Montes wrote:

> Oh thanks that looks fine... 
> 
> and... how about do it dinamically (i think it's said "on the fly"), I
mean,
> I have the color I need on a database field... how can I assign the "divi"
> to his color at runtime.
> 
> Javier C.
> 
> 
> -----Mensaje original-----
> De: Stephen Woodbridge [mailto:woodbri at swoodbridge.com]
> Enviado el: viernes, 02 de julio de 2004 14:14
> Para: Javier Castillejo Montes
> CC: Mapserver-users at lists.gis.umn.edu
> Asunto: Re: [Mapserver-users] Different colors in different layers
> 
> 
> Javier Castillejo Montes wrote:
> 
> 
>>Hi!
>> 
>>First of all  Im very bad english writer (its not my language so please
>>forgive my mistakes
>> 
>>and im really new at mapserver
>> 
>>I'll try to make myself clear
>> 
>>I have differents layers and one of then is a layer a field , this field
> 
> has
> 
>>various divisions(layer 1)  and inside each division(divi A) there is one
>>more division (layer 1) (divi AA,AB,AC). Can anybody tell me how can I put
> 
> a
> 
>>different color for each diviA and a different color for divi   AA,AB,AC
> 
> 
> Javier,
> 
> You will need to know what all the possible divi are then you can try 
> something like the following:
> 
> LAYER
>    NAME "your_layer"
>    CLASSEXPRESSION "divi"  # set the attribute field name here
>    DATA ...
>    CLASS
>      EXPRESSION "A"
>      STYLE
>        COLOR 255 0 0  # red
>      END
>    END
>    CLASS
>      EXPRESSION "AA"
>      STYLE
>        COLOR 0 255 0  # green
>      END
>    END
>    ...
> END
> 
> You will have to add the other stuff you need in the layers, classes and 
> styles to make them complete, but this should give you the idea of how 
> to do it.
> 
> EXPRESSION /^A/   # will select all "divi" starting with "A..."
> EXPRESSION /^A|^B/ # will select all "divi" starting with "A..." or "B..."
> 
> -Steve W.
> 
> 


------_=_NextPart_001_01C46B01.7DAC04C2
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>CLASS is like a CASE statement, it will stop after one is =
selected????</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi all </FONT>
</P>

<P><FONT SIZE=3D2>this is the newbie again</FONT>
</P>

<P><FONT SIZE=3D2>Stephen wrote</FONT>
<BR><FONT SIZE=3D2>&nbsp;&quot;CLASS is like a CASE statement, it will =
stop after one is selected&quot;</FONT>
</P>

<P><FONT SIZE=3D2>on an explanation he told me some weeks ago... I =
tried with this but it doesn't work for me.</FONT>
<BR><FONT SIZE=3D2>I have one layer with some class on it and&nbsp; ALL =
are done. Where have I the error???</FONT>
</P>

<P><FONT SIZE=3D2>.map:</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>LAYER # =
Provincias polygon layer begins here</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>NAME&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; provPerimeter</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>DATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; provin</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OFF</FONT>
<BR>&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BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>END</FONT>
<BR><FONT SIZE=3D2>END</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>-----Mensaje original-----</FONT>
<BR><FONT SIZE=3D2>De: Stephen Woodbridge [<A =
HREF=3D"mailto:woodbri at swoodbridge.com">mailto:woodbri at swoodbridge.com</=
A>]</FONT>
<BR><FONT SIZE=3D2>Enviado el: viernes, 02 de julio de 2004 =
14:49</FONT>
<BR><FONT SIZE=3D2>Para: Javier Castillejo Montes</FONT>
<BR><FONT SIZE=3D2>CC: Mapserver-users at lists.gis.umn.edu</FONT>
<BR><FONT SIZE=3D2>Asunto: Re: [Mapserver-users] Different colors in =
different layers</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Same idea, but you have to know the range of colors =
that are possible </FONT>
<BR><FONT SIZE=3D2>and create a CLASS for each COLOR then use an =
EXPRESSION to select the </FONT>
<BR><FONT SIZE=3D2>color instead of the &quot;divi&quot; so if your =
values were like 1 .. 100 and you </FONT>
<BR><FONT SIZE=3D2>wanted assign colors based on 1-10, 11-20, 21-30, =
..., 91-100</FONT>
</P>

<P><FONT SIZE=3D2>CLASS</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; EXPRESSION ([divi] &lt; 11)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; STYLE</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; COLOR ...</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>END</FONT>
<BR><FONT SIZE=3D2>CLASS</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; EXPRESSION ([divi] &lt; 21)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; STYLE</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; COLOR ...</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>END</FONT>
<BR><FONT SIZE=3D2>...</FONT>
<BR><FONT SIZE=3D2>CLASS</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; # no expression is like an default: and =
will catch</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; # anything not caught above.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; STYLE</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; COLOR ...</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>END</FONT>
</P>

<P><FONT SIZE=3D2>CLASS is like a CASE statement, it will stop after =
one is selected.</FONT>
</P>

<P><FONT SIZE=3D2>-Steve W.</FONT>
</P>

<P><FONT SIZE=3D2>Javier Castillejo Montes wrote:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; Oh thanks that looks fine... </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; and... how about do it dinamically (i think =
it's said &quot;on the fly&quot;), I mean,</FONT>
<BR><FONT SIZE=3D2>&gt; I have the color I need on a database field... =
how can I assign the &quot;divi&quot;</FONT>
<BR><FONT SIZE=3D2>&gt; to his color at runtime.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Javier C.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -----Mensaje original-----</FONT>
<BR><FONT SIZE=3D2>&gt; De: Stephen Woodbridge [<A =
HREF=3D"mailto:woodbri at swoodbridge.com">mailto:woodbri at swoodbridge.com</=
A>]</FONT>
<BR><FONT SIZE=3D2>&gt; Enviado el: viernes, 02 de julio de 2004 =
14:14</FONT>
<BR><FONT SIZE=3D2>&gt; Para: Javier Castillejo Montes</FONT>
<BR><FONT SIZE=3D2>&gt; CC: Mapserver-users at lists.gis.umn.edu</FONT>
<BR><FONT SIZE=3D2>&gt; Asunto: Re: [Mapserver-users] Different colors =
in different layers</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Javier Castillejo Montes wrote:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;Hi!</FONT>
<BR><FONT SIZE=3D2>&gt;&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;First of all&nbsp; Im very bad english =
writer (its not my language so please</FONT>
<BR><FONT SIZE=3D2>&gt;&gt;forgive my mistakes</FONT>
<BR><FONT SIZE=3D2>&gt;&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;and im really new at mapserver</FONT>
<BR><FONT SIZE=3D2>&gt;&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;I'll try to make myself clear</FONT>
<BR><FONT SIZE=3D2>&gt;&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;I have differents layers and one of then is =
a layer a field , this field</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; has</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;various divisions(layer 1)&nbsp; and inside =
each division(divi A) there is one</FONT>
<BR><FONT SIZE=3D2>&gt;&gt;more division (layer 1) (divi AA,AB,AC). Can =
anybody tell me how can I put</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; a</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&gt;different color for each diviA and a =
different color for divi&nbsp;&nbsp; AA,AB,AC</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Javier,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; You will need to know what all the possible =
divi are then you can try </FONT>
<BR><FONT SIZE=3D2>&gt; something like the following:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; LAYER</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; NAME =
&quot;your_layer&quot;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; CLASSEXPRESSION =
&quot;divi&quot;&nbsp; # set the attribute field name here</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; DATA ...</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; CLASS</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXPRESSION =
&quot;A&quot;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STYLE</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR =
255 0 0&nbsp; # red</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; CLASS</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXPRESSION =
&quot;AA&quot;</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STYLE</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR =
0 255 0&nbsp; # green</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; ...</FONT>
<BR><FONT SIZE=3D2>&gt; END</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; You will have to add the other stuff you need =
in the layers, classes and </FONT>
<BR><FONT SIZE=3D2>&gt; styles to make them complete, but this should =
give you the idea of how </FONT>
<BR><FONT SIZE=3D2>&gt; to do it.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; EXPRESSION /^A/&nbsp;&nbsp; # will select all =
&quot;divi&quot; starting with &quot;A...&quot;</FONT>
<BR><FONT SIZE=3D2>&gt; EXPRESSION /^A|^B/ # will select all =
&quot;divi&quot; starting with &quot;A...&quot; or =
&quot;B...&quot;</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -Steve W.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C46B01.7DAC04C2--



More information about the mapserver-users mailing list