[Thuban-list] RFC: Layer Rendering

Jonathan Coles jonathan at intevation.de
Thu Jan 16 11:16:25 CET 2003


RFC: Layer Rendering
--------------------

I've noticed that the MapRenderer class contains all the logic to draw
the layers and shapes. I think that most of this can and should be moved
to another class, either Layer or LayerRenderer. When work on the layer
classification begins (see RFC: Layer Classification) there will need to
be a lot of type checking to determine what kind of shape is being
drawn, what shape property is being used for classification, and so on.
A function like layer.render(dc, ...). would clean a lot of this up and
just let the system handle what Layer to draw. 

Which leads into creating several subclasses of Layer for each type.
Each subclass would know how to draw itself and what data values are
stored in its classification data structure. This allows new types of
Layers to be drawn more easily. Ideally, Layers would know how to load
and save themselves (although the exact hierarchy for this needs some
thought; I wouldn't want to overload the class with too much work). It
seems that Layers do know how to load themselves, but a different class
is saving them. Putting all this is the same or related class has the
advantage of easily adding Layers that are stored in different formats.
Perhaps Layer loading could be a plug-in feature (I believe that this is
easy to do in Python?). 

These are just some of my rough thoughts for now.

Thoughts?

--jonathan






More information about the Thuban-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)