<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 11/10/2013 05:41 AM, Ramon Andiñach
wrote:<br>
</div>
<blockquote
cite="mid:5232E19D-6CF3-46A1-B850-D613CDDA0FAD@westnet.com.au"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<div><br>
</div>
<div>On 10 Nov 2013, at 4:14, Lee Hachadoorian <<a
moz-do-not-send="true"
href="mailto:Lee.Hachadoorian+L@gmail.com">Lee.Hachadoorian+L@gmail.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>I am joining a spatial layer (from PostGIS) with an
attribute (aspatial) table (also from PostGIS). There are
more rows in the attribute table than in the spatial table.
After I do the join, I open the attribute, and it only
displays rows in the spatial table (i.e., this is an INNER
JOIN, or maybe a LEFT JOIN, I didn't test tables with
unmatched attribute rows. The point being, there are no
attribute rows with unmatched rows from the spatial table).</div>
<div><br>
</div>
<div>But when I style the layer, if I choose one of the
columns from the joined attribute table and classify the
values (I was using graduated symbology for a numeric
field), the classes that are produced are based on the
entire range of values from the attribute table, i.e., the
classification is not honoring the fact that the join result
omits many of the rows from the attribute table. Since, in
the case I tested, the field values for those rows which
match features in the spatial layer only cover a small part
of the total range, the resulting map has all the features
falling into fewer classes than specified (e.g., there are 5
classes in the data, but only 2 colors on the map).</div>
<div><br>
</div>
<div>First, I should ask whether I am doing anything wrong
here, or if people can confirm this behavior. Second, I
cannot find a specific feature request related to this at <a
moz-do-not-send="true" href="http://hub.qgis.org">hub.qgis.org</a>,
so is this already an tracked issue that I just wasn't able
to find? Third, do others agree that this is unexpected
behavior?</div>
</div>
</blockquote>
<br>
<div>Other than the styling problem that sounds about normal. </div>
<div><br>
</div>
<div>I can't replicate the styling issue with a shape file and csv
(I don't have a PostGIS layer to hand). It might be something
PostGIS specific and you will need someone who knows more about
PostGIS to confirm this. </div>
<div><br>
</div>
<div>Out if curiosity, why not do the join inside the database and
then look at the joined table in QGIS?</div>
<div>I'm pretty sure you have better control on the join in the DB
than in QGIS. </div>
<div><br>
</div>
<div>-ramon. <br>
</div>
</blockquote>
<br>
I would have to disagree about it being normal. Not only does it not
conform to other well-known commercial products, but what about the
fact that in QGIS the attribute table does not display rows from the
join table that are unmatched in the base table? Why wouldn't the
user assume that the values used for styling would only be those
values visible in the attribute table?<br>
<br>
Regarding whether this is a PostGIS issue, I have at this point
confirmed it with spatial::attribute table combinations of
PostGIS::PostGIS, PostGIS::CSV, shapefile::PostGIS, and
shapefile::CSV. Did you use layers where the subset of the data has
a significantly smaller range? In my case, the full data range of
the column from the attribute table is 1 - ~53,000, while the values
that appear in the geographic region of interest are only 10,000 -
15,000. <br>
<br>
I do often do the join in-database, but for exploratory purposes I
don't want to always have to create database objects.<br>
<br>
Best,<br>
--Lee<br>
<br>
</body>
</html>