<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.MsoAcetate {
        FONT-SIZE: 8pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
LI.MsoAcetate {
        FONT-SIZE: 8pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
DIV.MsoAcetate {
        FONT-SIZE: 8pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; mso-style-priority: 99; mso-style-link: "Balloon Text Char"
}
P.MsoListParagraph {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; mso-style-priority: 34
}
LI.MsoListParagraph {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; mso-style-priority: 34
}
DIV.MsoListParagraph {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; mso-style-priority: 34
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-compose
}
SPAN.BalloonTextChar {
        FONT-FAMILY: "Tahoma","sans-serif"; mso-style-priority: 99; mso-style-link: "Balloon Text"; mso-style-name: "Balloon Text Char"
}
.MsoChpDefault {
        mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
OL {
        MARGIN-BOTTOM: 0in
}
UL {
        MARGIN-BOTTOM: 0in
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff size=2>I 
would suggest creating a column in table A to store a color value and 
pre-populating it.&nbsp; You would want to store the RGB triplet (e.g. '255 0 
0').&nbsp; I assume that you could have some sort of a stored proc that gets 
triggered when a new record gets added.&nbsp; </FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff size=2>Using 
the new attribute binding in MapServer 5, you could then just set the feature 
color by specifying the column name in the style in your map file layer 
definition.&nbsp; </FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2>Something like:</FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2>STYLE</FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp; COLOR [myColorColumn]</FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp; OUTLINECOLOR 0 0 0</FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2>END</FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff size=2>As 
soon as someone kicks the MapServer site server and it restarts, I suggest 
looking at the map file reference document under style.&nbsp; 
</FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff size=2>Also, 
make sure that your color column is specified in the query in your data 
statement.&nbsp; </FONT></SPAN></DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=708314214-15092008><FONT face=Arial color=#0000ff 
size=2>David.</FONT></SPAN><SPAN class=708314214-15092008></DIV></SPAN>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  mapserver-users-bounces@lists.osgeo.org 
  [mailto:mapserver-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Lee 
  Keel<BR><B>Sent:</B> Monday, September 15, 2008 9:33 AM<BR><B>To:</B> 
  mapserver-users@lists.osgeo.org<BR><B>Subject:</B> [mapserver-users] Different 
  color for each row and it's child<BR><BR></FONT></DIV>
  <DIV class=Section1>
  <P class=MsoNormal>I had a client request something that sounds really cool, 
  but I don&#8217;t know how to do it (or if it is even possible in 
  mapserver).<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>First, my setup:<o:p></o:p></P>
  <P class=MsoNormal>I am running MS4W 2.6 on windows xp against postgis 8.2 
  database.&nbsp; I have table A that has anywhere from 4 to 35 rows.&nbsp; And 
  table B which could have several hundred rows each relating back to one of the 
  rows from table A.<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>For Example:<o:p></o:p></P>
  <P class=MsoNormal>TableA<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P 
  class=MsoNormal>ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Name<o:p></o:p></P>
  <P class=MsoListParagraph 
  style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -1in; mso-list: l0 level1 lfo1"><![if !supportLists]><SPAN 
  style="mso-list: Ignore">1<SPAN 
  style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  </SPAN></SPAN><![endif]>t<o:p></o:p></P>
  <P class=MsoListParagraph 
  style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -1in; mso-list: l0 level1 lfo1"><![if !supportLists]><SPAN 
  style="mso-list: Ignore">2<SPAN 
  style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  </SPAN></SPAN><![endif]>t2<o:p></o:p></P>
  <P class=MsoListParagraph 
  style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -1in; mso-list: l0 level1 lfo1"><![if !supportLists]><SPAN 
  style="mso-list: Ignore">3<SPAN 
  style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  </SPAN></SPAN><![endif]>t3<o:p></o:p></P>
  <P class=MsoListParagraph 
  style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -1in; mso-list: l0 level1 lfo1"><![if !supportLists]><SPAN 
  style="mso-list: Ignore">4<SPAN 
  style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  </SPAN></SPAN><![endif]>t4<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>TableB<o:p></o:p></P>
  <P 
  class=MsoNormal>ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  ta_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Value<o:p></o:p></P>
  <P 
  class=MsoNormal>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  something<o:p></o:p></P>
  <P 
  class=MsoNormal>2&nbsp;&nbsp;&nbsp;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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  bar<o:p></o:p></P>
  <P 
  class=MsoNormal>6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  done<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>Now my problem:<o:p></o:p></P>
  <P class=MsoNormal>The client would like to see all the rows rendered from 
  tableA as different colors.&nbsp; These colors can be random, it doesn&#8217;t 
  matter.&nbsp; On top of this, they want to see all the associated rows in 
  tableB as the same color as their parent from tableA.<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>Can I add a column to tableA and use that as a value in the 
  mapfile for the style?&nbsp; And if so, how?<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>I would greatly appreciate any help that anyone can 
  provide.<o:p></o:p></P>
  <P class=MsoNormal><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal>Thanks in advance,<o:p></o:p></P>
  <P class=MsoNormal>Lee<o:p></o:p></P></DIV></BLOCKQUOTE></BODY></HTML>