<div dir="ltr">Hi Lester,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 1, 2014 at 2:16 AM, Lester Anderson <span dir="ltr"><<a href="mailto:arctica1963@gmail.com" target="_blank">arctica1963@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>There should be a proper solution. In my work, I often have clipped raster layers which are contoured and labelled, and I wish to compare these with a larger dataset (also contoured and labelled). If the vector contour layer is covered by the opaque overlying raster, then so to should the labels for that vector layer - this is just common logic.<br>


<br></div>I think this labelling issue needs to be addressed by the developers as it is clearly a flaw. Take it to the extreme and have the top raster totally covering the lower one that has a vector contour layer labelled, and you immediately see the incosistency.<br>
<br></div></div></div></blockquote><div>Adding this feature (already logged as issue ticket #3257 [0]) will require a considerable amount of work and possibly a large refactoring of the labeling engine. This is not to say the request should not be addressed, but simply that it is not so simple to implement. The feature you request has certainly been brought up before.<br>

</div><div><br></div><div>The difficulty lies with PAL, the automated labeling library, which provides a solution *only after* duplicates of all features to be labeled have been registered with it. This is why labels are drawn on top of everything else, because the layers are rendered in 'render order' and any vector features to be labeled registered with the labeling engine, which finally does its canvas drawing last.<br>
<br>There are several considerations to implementing this feature (let's call it 'label obstacles'):<br><br></div><div>1) Individual layers need a setting to turn on label obstacles. (Not the same concept as the current "Discourage..." setting.) This should allow all vector features or raster extents to be obstacles and also include support for defining a vector expression or raster calculation. There could also be data defined support for vector layer feature attributes, e.g. a 'label_obstacle' column.<br>
<br>2) All calculated obstacle geometries would then be registered as obstacles to avoid in PAL, with any polygons also subtracted from the clipping mask used to clip feature geometries prior to input to PAL.<br></div><div>
<br></div><div>While this seems pretty straightforward, there are some definite hurdles:<br><br></div><div>* Raster layers are not currently part of the the labeling process at all. On-the-fly calculation for figuring not just the extent, but also the extent clipped of nodata, or even defined transparent, pixels would significantly slow rendering down. The workaround is to not do so; instead, requiring users to generate vector layers from the rasters to be used as proxy obstacle layers. There should probably be a setting for whether the obstacle features are rendered or not, i.e. invisible obstacles, without turning off their parent layer's rendering.<br>
<br></div><div>* To truly be obstacles, this means individual label extents should never intersect the obstacle, i.e. auto-placement label candidates are always calculated to lie outside the obstacle, taking into account *all* label characteristics/components. This will require a large refactoring of the way final label output is calculated, currently with some label aspects before PAL solution and some after. The entire, final label needs calculated prior to input into PAL. However, this is something that already needs done, so label components won't overlap other labels.<br>
<br></div><div>* If implemented, this still means labels are drawn on top of everything else, just not over obstacles. Cartographically speaking vector and raster layers should be able to 'mask' labels, i.e. labels can be drawn just above, or even below their layer, with layers rendered above capable of showing the labels underneath, if they have semi-transparency or a specific blending mode. This would require a large refactoring of how the labeling engine interacts with rendering. It is doable, but was voted down last time it came up in developer discussions.<br>
<br></div><div>Please add your comments or testing results to feature #3257's ticket.<br><br>[0] <a href="http://hub.qgis.org/issues/3257">http://hub.qgis.org/issues/3257</a><br><br></div><div>Regards,<br><br></div><div>
Larry Shaffer<br>Dakota Cartography<br>Black Hills, South Dakota</div><div> <br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<div><div></div><div>There is no workaround for this problem from what I can see.<br>
</div><div><br></div>Cheers<br><br></div>Lester <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 1 February 2014 08:13, Harish <span dir="ltr"><<a href="mailto:harry.om2000@gmail.com" target="_blank">harry.om2000@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif">There should be solution when user user does not want labels of underlying layers to be shown, without making the labels invisible.<br>


</div>
<div style="font-family:verdana,sans-serif">Regards<br></div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Sat, Feb 1, 2014 at 12:27 AM, Nathan Woodrow <span dir="ltr"><<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hey Lester,<div><br></div><div>Labels always render above all other layers.</div><div>
<br></div><div>- Nathan</div>


</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Sat, Feb 1, 2014 at 9:55 AM, Lester Anderson <span dir="ltr"><<a href="mailto:arctica1963@gmail.com" target="_blank">arctica1963@gmail.com</a>></span> wrote:<br>





</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><br><div><div>Hello<br><br></div>I have a issue with labels. If I have a 
base raster, overlay a contour layer with labels, and then a top raster,
 the labels from the underlying contour vector layer show when they 
should be covered - why should that be ?<br>
<br></div>Cheers<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Lester<br></font></span></div>
<br></div></div>_______________________________________________<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><br></blockquote></div><br></div>
<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><br></blockquote></div><br><br clear="all"><br></div></div>-- <br><div dir="ltr"><div>Harish Kumar Solanki, Assistant Professor<br>



National Institute of Rural Development (NIRD), Jaipur Center<br>Ministry of Rural Development, Government of India <br>Chaupal, Near Railway Station<br></div>Jaipur -302006<br><div><b></b><br>Geo_Coordinates (Office): <span>26.92162 N, 75.78921 </span>E<br>



<br>Email- <a href="mailto:hksolanki@nird.gov.in" target="_blank">hksolanki@nird.gov.in</a>, <a href="mailto:harry.om2000@gmail.com" target="_blank">harry.om2000@gmail.com</a>, <br>Phone (Office) - 0141-2209904, Fax- 0141-2209905<br>



Mo.- 09214446732, 09414291732<br>Website-  <a href="http://www.nird.org.in" target="_blank">http://www.nird.org.in, </a><br><br><a href="http://www.nird.org.in" target="_blank"></a></div></div>
</div>
</blockquote></div><br></div>
<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><br></blockquote></div><br></div></div></div>