[Qgis-developer] Object owner design in QgsGraphBuilder

Sergey Yakushev yakushevs at gmail.com
Wed Sep 5 14:26:27 PDT 2012


> Was your idea to put such information into the properties QVector that can be passed with addArc()? Would it be feasible to integrate this also for vertices in one way or another?

The idea is that you should not edit QgsGraph object :-) . Probably I
will not add the properties top. New functional is not a big problem
for me, but I do not know why it.

If you create an object without using QgsGraph QgsGraphBuilder
QgsGraphDirector then a good idea to use other libraries to analyze
graphs. For example, bgl [1] or NetworkX [2]. And I use the builder
pattern [3], so you can use the algorithm analyzes the vector layer
(QgsLineVectorGraphDirector object). I spent a lot of time debugging.

Currently I work of full-feature network and surface cost analysis
plugin, but I will not use more than the shortest path and minimum
spanning tree.

Thanks.

[1] http://www.boost.org/doc/libs/1_51_0/libs/graph/doc/index.html
[2] http://networkx.lanl.gov/
[3] http://en.wikipedia.org/wiki/Builder_pattern
-- 

Sergey Yakushev


More information about the Qgis-developer mailing list