relate graph in weighted edgelist format to point coverage/shapefile of nodes?

438
2
04-27-2011 12:09 PM
CharlesCarroll
New Contributor II
I have a valued directed graph in ASCII edgelist format:
fromnode, to node, edgeweight
1,2,34.5
1,3,12.0
...
I have a coverage or shapefile with the nodes, with a field corresponding to the nodeids used in fromnode, tonode fields above..
How would I create a coverage that would allow me to display the network with the edges represented as arrows with width proportional to edgeweight? This is complicated by the directed nature of the graph, which would require display of 2 arcs between nodes.
this is likely a newbie question but I have not been able to locate the answer after searching.
I have Spatial Analyst and Workstation but do not have Network Analyst (but could access it if necessary).
More generally I would be interested in any tools (in ArcGIS or other programs, eg, R) to convert common graph file formats to GIS formats.
Tags (2)
0 Kudos
2 Replies
JaySandhu
Esri Regular Contributor
There are no out of the box tools to do this. But I can give you some pointers on how to get it done in workstation Arc/Info. First thing you need is the X,Y coordinates that correspond to the from and to nodes. To do this, run the AddXY command on your node coverage. This will add two fields. Now you can use them based on your nodeid mapping to get the x,y's of each node. The second part is about creating a coverage from your edge list. Look at the IMPORT command. This will create a coverage based on X,Y coordinates. You could EXPORT a small line coverage and see the format. BUILD the line coverage with line and node opions and then use JOINITEM to add the edge weights based on some unique ID of each line you imported.

You can draw the lines with "offset" to see two lines between each pair of nodes by using a line symbol with ARCLINES command that has been "offset" by using the LINEOFFSET command.

Jay Sandhu
0 Kudos
CharlesCarroll
New Contributor II
Thank you for the helpful pointers. I ended up writing an R script to produce a textfile in the correct format for import (using the GENERATE command) as a 'route' coverage in ArcGIS.
The route format retains the directed nature of the edges, and edge i->j and j->i can be displayed simulataneously using a cartographic line offset.
The format is
route-id
measure[order],x,y
measure[order],x,y
END
e.g.,
1
0,850,7945.694
1,850,6906.463
END
2
0,850,7945.694
1,2650,6386.848
END
0 Kudos