[Qgis-developer] Information about Progress in diagram branch

Martin Dobias wonder.sk at gmail.com
Mon Feb 19 11:38:28 EST 2007


Hi Marco,

that's interesting work! I will surely try it out soon and investigate
the possibilities of connecting it with label placement in future.

Just to make sure if I understand well how does it work: every vector
layer has its own overlay to which it can receive some objects from
outside. Then position manager looks at the objects in overlays and
creates a placement from the information obtained from them. Is that
correct?

Do you draw the vector overlay directly to the rendered map or do you
use map canvas items?

For labeling I'd like to use this algorithm: from every feature you'll
get a set of label candidates (also with priorities). Then a conflict
graph of overlapping candidates will be created (candidate = vertex,
conflict = edge). There's a good heuristic for solving this conflict
graph, resolving in a set of labels to be drawn. Does the current
implementation fit well to this?

Martin

On 2/17/07, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch> wrote:
> Dear qgis developers,
>
> You may have noticed my activities in the diagram branch in the last time. My
> progresses are quite good and I hope that it can be merged into svn head
> before 0.9 release (whenever this will be). If you like to try out the new
> feature, you may download the sources with:
>
>  svn co https://svn.qgis.org/repos/qgis/branches/diagram-branch
>
> I'd like to give some information here about what I'm doing there. I'm also
> preparing a pdf with detailed technical description and I'll send a link to
> it to the devel list as soon as it's available.
>
> The main technical change in the branch is the class QgsVectorOverlay. A
> vector overlay is anything on top of a vectorlayer which relates to the
> position of the features. An example of a vector overlay are diagrams placed
> on a map (for which there is an early implementation in the branch). Another
> example would be labels (but the branch still uses the current label
> implementation).
>
> In the diagram branch, there is the interface QgsVectorOverlay and a subclass
> of it QgsDiagramOverlay. A vector overlay stores a multimap of
> QgsOverlayObjects (basically position, bounding box and feature geometry) and
> is able to draw those objects (which is specific to subclasses). It is a
> multimap because multitype objects may have several overlay objects.
>
> To manage the positioning of the overlay objects, there is the interface
> QgsOverlayObjectPositionManager and the subclass
> QgsCentralPointPositionManager. The idea of the position manager is that it
> may evaluate the overlay objects of one or more vector overlay together with
> the feature geometries to achieve an optimal placement. E.g. if there is a
> diagram overlay and labels at the same time, it would be great if they do not
> overlap each other and not the labels/diagrams of other features. The current
> implementation in the class QgsCentralPointPositionManager implements the
> simplest behaviour by placing the objects on the center point of a feature
> (without considerating other vector overlays). But the architecture in the
> diagram branch makes it possible to implement sophisticated placement in the
> future.
>
> The implementation of the diagram overlay in the branch is done as plugin. For
> this, a new plugin type has been introduced (QgisPlugin::VECTOR_OVERLAY).
> Vector overlay plugins are subclasses of QgsVectorOverlayPlugin and provide a
> method for the vector properties dialog to request an input dialog suitable
> for the specific vector overlay type. So QgsVectorLayerProperties checks if
> there are any overlay plugins loaded and inserts a new tab with the specific
> dialog for each. Vector overlays could of course also be implemented as part
> of the core.
>
> The current implementation of diagrams provides support for pie- and barcharts
> and for linear scaling of the diagram size according to a classification
> attribute. These behaviours are also extendable by implementing interfaces,
> but I don't want to bore you here with the exact details. The implementation
> does not yet support loading/saving to/from project file and does not yet
> generate an entry in the qgis legend. Once these points are solved, I will
> try to request permission for a merge to svn head. From my explanations above
> you can see that the impact of the changes on qgis core stability are minimal
> because most of the actual actions are done in the diagram plugin.
>
>
> All the best,
> Marco
>
>
> _______________________________________________
> 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