[GRASS5] Polygons slow when zoomed in

Radim Blazek blazek at itc.it
Wed May 19 04:10:30 EDT 2004


On Wednesday 19 May 2004 02:15, you wrote:
> > > Two QGIS glitches (latest qgis CVS):
> > > a) when zooming in a moderate amount (with the polygon_1 enabled)
> > > QGIS would freeze my X-windows for 2-3 minutes at a time. Mouse
> > > worked, everything else was frozen. After the wait it would redraw.
> > > Had to kill -9 it remotely a couple of times..
> >
> > Do you think that it is because drawing is slow (many lines) or
> > it is realy frozen? top?
>
> X is really frozen for the time. Including xclock, gkrellm, NumLock
> LED, keyboard.. Not sure if that is a bug in X or QGIS.
> (Debian's X is pretty good though)
>
> Running top (remotely) shows that XFree86 is using 99% of the CPU, and
> QGIS is using 0% (QGIS is running tunneled over ssh, and the processor
> of the machine it is on isn't under another load, and the network
> traffic is low)
>
> Even though there are complicated boundaries, it seems fast enough when
> zoomed out.
>
> I just tried with the huge 20m contour vector file for all of New
> Zealand (lines only). It's slower (but X is fine) when zoomed out, but
> fast when zoomed in. The other file I was trying (coastline + islands as
> closed polygons) containing areas is fast when zoomed out and slow
> (Xfree86) when zoomed in..
>
> Also note in the attached screenshots that the entire screen was flooded
> with the fill color when it finally rendered after a minute or so
> (zoomed in). It's fine when zoomed out, but still 10sec of waiting at
> that scale.

I think I know why it is slow, I could reproduce it. 
When coordinates of the polygon are recalculated from map units to display
(canvas) units it may happen (if you zoom out) that some values overflow
integer maximum value. Result in the display is (known) mess:
http://mpa.itc.it/radim/qgis/poly-zoom-out.png (should be only filled by blue)

I guess that this also makes rendering (on X side) slow, because X has to render 
very complex (wrong, more or less random) polygons.

Just now, I don't know how to solve this, because any pre-clipping would be slow?
Anybody has idea?

Radim




More information about the grass-dev mailing list