Fwd: Re: [Qgis-developer] bug when drawing a linestring with two consecutive, identical points

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Fri Apr 4 03:59:18 EDT 2008


Hi Stefanie,

This may depend on the platform and also the Qt paint device you are using. 
Could you try to change the rendering options (options -> Rendering -> Make 
lines appear less jagged.../Fix problems with incorrectly ....)? For the 
first option, QGIS draws to a QImage and for the second option to a QPixmap.

With the configuration I have (Linux, Qt 4.3.4), drawing a line with two 
consecutive points seems to work fine with both options. Also the coordinates 
in the example drawed correctly.

The workaround you provide is a good short-term fix. 
I think it is best not to commit it to svn as the problem seems to be a Qt bug 
on a specific platform/paint device.

Regards,
Marco

Am Freitag 04 April 2008 04:14:23 schrieb Stefanie Tellex:
> Hi,
>
> When I have a line string with two identical points in a row, and
> they're not the first or the last point, qgis draws an extra line to the
> upper left hand corner of the drawing space.  (This line string, for
> example, causes that to happen: 'LINESTRING(0 0, 0 1, 0 1, 1 1)')
> In my domain, it makes perfect sense for two consecutive points to be
> identical, and it seems like QGIS should draw it correctly.
>
> It looks like the draw code in qgsvectorlayer loads the line string into
> a QPolygonF before it gets drawn, so I think the bug might be there, but
> I didn't track it down exactly. However, the attached patch does make it
> go away.  It works by modifying a point by an epsilon, if the previous
> point was identical.   I'm not sure if this is the best fix, but
> deleting the point seemed bug-prone.
>
> Stefanie



-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee


-------------------------------------------------------

-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list