<div dir="ltr"><div>I have tested myself and I can confirm this behavior with char(x) values.</div><div><br></div>If the classifier identify 3 different classes, but the renderer does not draw them. I think this might be classified as a bug.<div>
<br></div><div>Maybe you should fill a bug report, with all the steps to reproduce the error. Also, maybe a SQL to create and populate a table to help developers reproduce the problem.</div><div><br></div><div>Best regards,</div>
<div><br></div><div>Alexandre Neto</div><div><br></div><div><br></div><div><br></div><div><br></div><div>Best regards,</div><div><br></div><div>Alexandre Neto</div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, May 30, 2014 at 1:21 PM, McDonaldR <span dir="ltr"><<a href="mailto:McDonaldR@angus.gov.uk" target="_blank">McDonaldR@angus.gov.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">









<div lang="EN-GB" link="blue" vlink="purple">
<div>
<div><span style="FONT-SIZE:10pt;FONT-FAMILY:Arial"><font size="1">
</font></span></div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">No spaces in the fields or table name – all lowercase and underscores.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Yeah, the rules work if I use trim(“prob”) or prob like ‘H%’<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">I would have thought that the display by category would have worked on the strings in the field even if the values were made up of a lot of space characters.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Ross<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alexandre Neto [mailto:<a href="mailto:senhor.neto@gmail.com" target="_blank">senhor.neto@gmail.com</a>]
<br>
<b>Sent:</b> 30 May 2014 12:58<br>
<b>To:</b> McDonaldR<br>
<b>Cc:</b> Brent Wood; QGIS User</span></p><div><div class="h5"><br>
<b>Subject:</b> Re: [Qgis-user] Categorised Styling of PostGIS layers<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">That sounds still strange. Do you have space characters on your fields? I would definitely remove them.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Either way, in Rule based symbology, you could use a rule like this:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">prob like 'H%'<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Alexandre Neto<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, May 30, 2014 at 12:47 PM, McDonaldR <<a href="mailto:McDonaldR@angus.gov.uk" target="_blank">McDonaldR@angus.gov.uk</a>> wrote:<u></u><u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Hi Alexandre, Brent</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Thanks for the pointers.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Rules based renderer failed but it work on the same data in different format.</span><u></u><u></u></p>

<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Going back to the source data (ESRI FGDB) and checking PostGIS I noticed the prob field was
 set to char(50).  I reloaded the data with the field as varchar(50) and it now renders correctly although I still get the extra category added – presumably to catch blank records.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">With the data as char(50) categorisation works if I set the field with an expression like,
 TRIM(“prob”), as it then strips of the 49 blank spaces after the H.  Varchar is better though as the table is smaller.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Many thanks</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d">Ross</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Alexandre
 Neto [mailto:<a href="mailto:senhor.neto@gmail.com" target="_blank">senhor.neto@gmail.com</a>]
<br>
<b>Sent:</b> 30 May 2014 12:01<br>
<b>To:</b> McDonaldR<br>
<b>Cc:</b> QGIS User<br>
<b>Subject:</b> Re: [Qgis-user] Categorised Styling of PostGIS layers</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Somehow QGIS is not finding any of those 3 values in the features in that extent. Can you select a few visible (pink) features  and check their <span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">probability
 field values?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">Are you sure that all you features have valid values in the prob column?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Try build that same stack of symbols using rule-based symbology. And see if it works.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">You can also try save a few features in other format, say a shapefile, open it and copy the style. See if it works there (I doubt).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Not having access to the data, is quite difficult to understand what can be wrong, if you can provide a sample data, I can give a look into it.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Alexandre Neto<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Fri, May 30, 2014 at 11:35 AM, McDonaldR <<a href="mailto:McDonaldR@angus.gov.uk" target="_blank">McDonaldR@angus.gov.uk</a>> wrote:<u></u><u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white">Morning all,</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040"><br>

<br>
<span style="background:white">I'm trying to style some flooding probability data.  It's in PostGIS and I'm using QGIS master (same issue in 2.0 and 2.2 though).  My polygon layer has a probability field with values H, M and L.  If I select a categorised style
 using the probability field I get the expected three values.  And an extra one.  And the data is drawn using the style of the extra category - in the screenshot the pink lines and not the blues as expected.  If I delete the extra category from the classification
 table then nothing is drawn on the canvas.  I have checked the field and there are only three unique values in it without nulls or blanks.  The table is properly indexed with a primary key and GIST spatial index.</span><br>

<br>
<span style="background:white">So, is it a QGIS style engine problem or a PostGIS data problem?  I should add that the same data from PostGIS draws perfectly in ArcGIS 10.2.2 and is styled as expected.  </span></span><u></u><u></u></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white">Anyone else had similar experiences?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white">[If the screenshot is scrubbed by the list then you can see it here:
<a href="http://openphoto.mixedbredie.net/photo/96/view" target="_blank">http://openphoto.mixedbredie.net/photo/96/view</a></span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";background:white">]</span><u></u><u></u></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040;background:white"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#4f6228">Ross McDonald
</span></b><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#4f6228">|<b>
</b>GIS Data Coordinator | Resources Department, IT Division | Angus Council, Angus House, Orchardbank Business Park, Forfar, DD8 1AT</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:13.0pt;font-family:"Century Gothic","sans-serif";color:#4f6228">T:
<b>01307 476419</b> | F: 01307 476401 | E: <a href="mailto:mcdonaldr@angus.gov.uk" target="_blank">
<span style="color:#4f6228">mcdonaldr@angus.gov.uk</span></a> | W: <b><a href="http://www.angus.gov.uk/maps/map_home.cfm" target="_blank"><span style="color:#4f6228">Angus Maps</span></a></b></span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">This message is strictly confidential. If you have received this in error, please inform the sender and remove it
 from your system. If received in error you may not copy, print, forward or use it or any attachment in any way. This message is not capable of creating a legal contract or a binding representation and does not represent the views of Angus Council. Emails may
 be monitored for security and network management reasons.  Messages containing inappropriate content may be intercepted. Angus Council does not accept any liability for any harm that may be caused to the recipient system or data on it by this message or any
 attachment. </span><u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">This message is strictly confidential. If you have received this in error, please inform the sender and remove it from your system. If received in error you may not copy, print,
 forward or use it or any attachment in any way. This message is not capable of creating a legal contract or a binding representation and does not represent the views of Angus Council. Emails may be monitored for security and network management reasons.  Messages
 containing inappropriate content may be intercepted. Angus Council does not accept any liability for any harm that may be caused to the recipient system or data on it by this message or any attachment.
</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div><div><div class="h5">
<div>
<font face="Arial" size="1">
</font> </div>
<div>
<p class="MsoNormal" style="MARGIN:0cm 0cm 0pt"><span style="FONT-SIZE:7.5pt;FONT-FAMILY:'Arial','sans-serif'"><font>This message is strictly confidential. If you have received this in error, please inform the sender and remove it from your system. If received in error you may not copy, print, forward or use it or any attachment in any way. This message is not capable of creating a legal contract or a binding representation and does not represent the views of Angus Council. Emails may be monitored for security and network management reasons.<span>  </span>Messages containing inappropriate content may be intercepted. Angus Council does not accept any liability for any harm that may be caused to the recipient system or data on it by this message or any attachment. </font></span></p>

</div>
</div></div></div></div>
</blockquote></div><br></div></div></div>