[Qgis-user] Support - representing a graph in Qgis

Nicolas Cadieux njacadieux.gitlab at gmail.com
Wed Feb 10 09:09:47 PST 2021


Hi,

You could consider https://networkx.org/ if you are really looking for 
just a graph. It's a pure Python library but it's not included with 
QGIS.  It's not too difficult to learn but geared towards analysis and 
not visualization like Graphviz. (I have never user Graphviz so don't 
take my word for it.)

You can still do what you want in QGIS.  Shapefile lines could 
simplified by changing the geometry into a simple line between the first 
and last node.  Qgis has the advantage (and disadvantage if the network 
is complicated) of giving you complete control on were you position 
nodes on a map.  Graph libraries usually give you a choice of rendering 
styles but it gets complicated if you want complete control on the 
rendering.   You could also use  QGIS to draw the shapefile and export 
those to Graphviz for visualization.  You could also look at Cytoscape 
and Gephi that seem to be vizualisation software for graphs.

https://gephi.org/

https://cytoscape.org/

Nicolas

On 2021-02-10 11:39 a.m., chris hermansen wrote:
> Giacomo and list,
>
> On Wed, Feb 10, 2021 at 4:05 AM Giacomo Uguccioni 
> <giacomo.uguccioni at gmail.com <mailto:giacomo.uguccioni at gmail.com>> wrote:
>
>     Thanks a lot!
>     I would like to represent a shapefile or more shapefiles of nodes
>     and connections (lines and points)
>     in a layout similar to an electrical scheme, a symbolic and
>     conceptual scheme and not a geographical one.
>     I attached an image with qgis view and output that I would like to
>     get.
>
>
> In your graph representation (version to the right in your sketch) how 
> do you determine that A is the start node? (and not 3 or 4?)
>
> This kind of diagram is what Graphviz is built to represent.  You will 
> need to convert your shapefiles to a Graphviz input program.  A 
> reasonable starting approach might be to use some vector operations to 
> get attribute tables that look like [from-node,to-node] along with the 
> node attributes.  I suggest you study the Graphviz documentation, 
> which is quite excellent and full of worked examples, to see how to 
> draw the sketch you presented here, and then revisit your shapefiles 
> to think about how to convert them to that format.
>
>
> -- 
> Chris Hermansen · clhermansen "at" gmail "dot" com
>
> C'est ma façon de parler.
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Nicolas Cadieux
https://gitlab.com/njacadieux

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210210/fb4a0aaa/attachment.html>


More information about the Qgis-user mailing list