[Qgis-developer] API changes
Marco Hugentobler
marco.hugentobler at karto.baug.ethz.ch
Wed Mar 28 04:22:32 EDT 2007
Hi Martin,
> This is a good idea! In fact, getNextFeature() is always called with
> the same parameters, so besides the performance reason there would be
> also simpler interface. Moreover I would suggest to move also
> 'fetchGeometry' parameter to select() as this is another chance for
> provider to optimize.
>
> Maybe it would be good also to modify behaviour of reset(). Currently
> it's used to reset reading and prepare for new reading. In my opinion
> it would be better to have it like this:
> - select() - initiates reading of data
> - reset() - resets reading of the selected subset to begin
Yes, this would be much cleaner separation. I noticed when I implemented wfs
provider that the usage of select() and reset() now is not very intuitive.
> > I made some tests by
> > doing a quick hack to the postgres provider and the following came out
> > with a simple test dataset:
> >
> > current approach:
> > rendering geometry only: 4 seconds
> > classified symbology: 8 seconds
> > opening attribute table: 12 seconds
> >
> > proposed approach with select(rectangle, attributeList) and attributes
> > via binary cursor:
> > rendering geometry only: 4 seconds
> > classified symbology: 4 seconds
> > opening attribute table: 7 seconds
>
> Quite a difference :-)
>
> Btw. I seen you've added recently numericalTypes() and
> nonNumericalTypes() to vector providers. Now when we don't have to
> decide just between these two types I would suggest to change them to
> a one call, something like supportedNativeTypes() or so...
I agree. We do not need to have separation, because we can ask the QGIS
specific type now.
As the provider changes affect the core of QGIS, I suggest we should make them
in a branch so that 0.9 is always in a stable state. It will be no problem to
merge them back if the progresses are fast.
cheers,
Marco
More information about the Qgis-developer
mailing list