https://issues.qgis.org/https://issues.qgis.org/favicon.ico2011-07-14T22:37:59ZQGIS Issue TrackingQGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252322011-07-14T22:37:59ZSandro Santillistrk@kbt.io
<ul></ul><p>Note: there's <em>no</em> CPU activity and memory usage is low. GUI is unresponsible, doesn't refresh (immune to expose X events) and mouse pointer is of the "busy" flavor.</p> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252342011-07-14T22:52:07ZSandro Santillistrk@kbt.io
<ul></ul><p>Can't reproduce it :/</p> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252392011-07-14T23:45:01ZMartin Dobiaswonder.sk@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/download/3343/bug4088fix.diff">bug4088fix.diff</a><a href="/attachments/3343/bug4088fix.diff"><img alt="Magnifier" src="/images/magnifier.png" /></a> added</li></ul><p>That sounds like a mutex not unlocked when PAL exception is thrown. I have prepared a small patch, though I am not at my dev machine now so I cannot compile/test it.</p>
<p>Most likely problem happens when a geometry collection is passed to labeling engine. The newly added clipping in <a class="issue tracker-1 status-5 priority-5 priority- closed" href="https://issues.qgis.org/issues/4083" title="Line layer labeling eats up all memory (Closed)">#4083</a> might be the cause - the intersection operation between extent rectangle and input feature may result in geometry collection, right?</p> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252402011-07-14T23:45:54ZMartin Dobiaswonder.sk@gmail.com
<ul><li><strong>Assignee</strong> set to <i>Martin Dobias</i></li></ul> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252422011-07-15T00:00:17ZSandro Santillistrk@kbt.io
<ul></ul><p>Intersections made with GEOS can result in collections. <br />They can also result in crashes so I'd be very careful about using them for <br />labeling purposes. If there's a way to avoid changing the input but only the way<br />it's considered it should be favored (ie: only consider segments intersecting the viewport rather than all of them?).</p>
<p>Btw, it would be helpful if the message showed also the geometry type id beside the 'unknow' label (there's a typo too)</p> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252692011-07-19T13:44:54ZMartin Dobiaswonder.sk@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>fixed</i></li><li><strong>Pull Request or Patch supplied</strong> set to <i>No</i></li></ul><p>Bugfix applied in <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/8e08c53a382d79999845a066a0abc849941076b1" title="Fix #4088: better handling of unknown geometry types">8e08c53</a></p>
<p>Regarding the intersections with GEOS: is there a high chance of a crash? Are there still robustness problems?</p>
<p>If we were going to use the whole segments that intersect the viewport we would still have to calculate the intersection of segments with the viewport in order to place label candidates only to visible positions. So I guess a better solution is to run intersect on the whole geometry.</p> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252752011-07-19T22:35:48ZSandro Santillistrk@kbt.io
<ul></ul><p>I wouldn't say "high" chances, but there still are. Maybe you could catch and let go if it happens. I don't really have statistical data about robustness issues happening with rectangular intersections (should be handled in a special way, faster).</p>
<p>Doesn't the memory representation you're using (the Qt one) support clipping ?</p> QGIS Application - Bug report #4088: Freeze while rendering labels (master 17e864b)https://issues.qgis.org/issues/4088?journal_id=252802011-07-20T00:25:26ZMartin Dobiaswonder.sk@gmail.com
<ul></ul><p>The memory representation for labeling is a custom one introduced by the PAL labeling library: geometries are input as GEOS geometry instances and then converted to that representation.</p>
<p>Anyway Qt is able to do clipping, but that is limited to rendering (and not exposed to public API) and seems to be slow.</p>
<p>Additionally QGIS has its own line and polygon clipping routines, but for yet another representation (using QPolygonF from Qt). Ultimately this may be the fastest and safest solution, however it would require us to make QgsClipper class more generic.</p>