[Qgis-developer] slow reading shp

Marco Hugentobler marco at hugis.net
Wed Oct 21 03:15:25 EDT 2009

Hi Frank

Thanks, this is a good hint. I tested it and the large polygons draw 
considerably faster now. It is still not fast, but it seems that this is a Qt 
problem with slow drawing of large polygons. QImage seems to handle that 
better than QPixmap. 

The following warings appear on command line. Probably the shapefile contains 
some defects?

Warning 1: Geometry of polygon of fid 150 cannot be translated to Simple 
Geometry. All polygons will be contained in a multipolygon.


Am Dienstag, 20. Oktober 2009 17.59:23 schrieb Frank Warmerdam:
> Paolo Cavallini wrote:
> > On Tue, 20 Oct 2009 16:37:42 +0200, Marco Hugentobler <marco at hugis.net>
> >
> > wrote:
> >> Hi Giovanni
> >>
> >> It seems this is caused by the OGR library. Interrupting QGIS a few
> >> times with
> >> the debugger gives that the program spends much time in the function
> >> OGRLinearRing::isPointInRing (see debugger backtrace below).
> >>
> >> Probably something you could report to the GDAL/OGR project.
> >
> > Good to know - however, it seems that other programs, also using OGR, do
> > not have the same problem (maybe we should test, eg udig or gvsig?).
> > All the best.
> Folks,
> It sounds like this is the code in OGR's shapefile driver for reading
> polgyon rings and correctly assigning them as inner, or outer rings
> and for which component of a multipolygon.
> For some complex polygon files this can become quite expensive.
> Depending on the version of OGR it may be possible to define
> OGR_ORGANIZE_POLYGONS in the environment with the value SKIP to avoid
> this work.  I'd appreciate your testing this to confirm this is the issue.
> Best regards,

Dr. Marco Hugentobler
HUGIS - GIS programming and consulting
Webereistrasse 66
CH-8134 Adliswil
marco at hugis.net

More information about the Qgis-developer mailing list