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
Index: src/core/qgsvectorlayer.cpp
===================================================================
--- src.orig/core/qgsvectorlayer.cpp 2008-04-03 21:07:07.000000000 -0400
+++ src/core/qgsvectorlayer.cpp 2008-04-03 21:30:41.000000000 -0400
@@ -379,6 +379,13 @@
if (hasZValue) // ignore Z value
ptr += sizeof(double);
+
+ if (i > 0)
+ {
+ if (x[i] == x[i - 1] && y[i] == y[i - 1]) {
+ x[i] = x[i] + 0.00001;
+ }
+ }
}
// Transform the points into map coordinates (and reproject if
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer