[Qgis-developer] Qgis datamodel (update)

Martin Dobias wonder.sk at gmail.com
Thu Dec 14 07:37:01 EST 2006


I must say - nice analysis! I always prefer to do code cleanups and
refactorings sooner than later - I've learned that on one project
where I've been only adding new features without refining design,
ending with completely unmaintainable code.

I've read the wiki page and I have some questions:

- vector data queries: you differentiate between queries for geometry
and queries for select operation. Do you think it's better? Have you
considered that when drawing you might need also some attributes e.g.
to determine feature's color?

My vision of queries is that you'll call something like:
select(QgsRect spatialFilter, QgsSearchString attributeFilter)
so you'll specify both spatial and attribute filter at once and
getNextFeature() calls will give you features that pass through both

For even better flexibility we might use visitor design pattern, e.g.:
select(QgsDataVisitor* visitor, QgsRect spatialFilter, QgsSearchString
Usage: you'll create a subclass of QgsDataVisitor and override its
function which gets called on new feature. This way you could decide
what to do or data it will need most flexibly.

- you write that data sets should be subclassed by provider
developers. I don't understand this - I thought you mean that
providers will do low-level backend-dependent work, while datasets
will provide high-level (provider independent) functionality... Why to
subclass them?

- it's not clear to me what type of connection will be between map
layers and data sets - do you think of one-to-one or also other types
e.g. one dataset for more layers?

- when interfacing layer, should I be able to get direct access to
data set or data provider? Or should layer work as a proxy for some
functionality of these classes?

If you'll have some time it would be nice to have an UML diagram with
only layer, data set and data provider classes, their connection and
most important functions / member values.

My questions here are mostly about vector layers, I'm not very
comfortable with all the raster stuff. Probably Tim is the one who
could understands QGIS raster drawing the most


On 12/14/06, Christoph Spoerri <cspoerri at cavtel.net> wrote:
> Hi there,
> I started to write down some of my ideas regarding the design of a (hopefully)
> clearer and simpler data model (one word or two???). Please check the wki
> page at http://wiki.qgis.org/qgiswiki/Redesign_of_QGis_data_model and chime
> in with any ideas or comments.
> Since my knowledge with rasters and tins is rather limited, I'm especially
> interested in comments from the folks who are expert in that area.
> cheers,
> Christoph
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer

More information about the Qgis-developer mailing list