You are on page 1of 66

How to put network data on a map (with Excel, ORA, GoogleEarth and

QuantumGIS) – a practical manual (with screenshots)

created by Johannes Preiser-Kapeller, Austrian Academy of Sciences


(Johannes.Preiser-Kapeller@oeaw.ac.at)

on the occasion of the workshop


“Interconnections in the Ancient and Medieval Worlds”
at the Institute of Mediterranean Studies,
Rethymno, Crete (April 3, 2019)
organized by Prof. Katerina Panagopoulou &
Prof. Kostas Vlassopoulos (Univ. Crete, Rethymno),
with Prof. Diane Harris Cline (GWU, Washington DC), Prof. Eric Cline (GWU,
Washington DC) and Dr. Ekaterini Mitsiou (Akad. d. Wiss. Göttingen/Univ. Vienna)
(http://www.history-archaeology.uoc.gr/wp-
content/uploads/2019/03/PROGRAMMA_WEB-upd.pdf)

1
Tools:
 Excel (Microsoft Office) – or any other spreadsheet-based software
 ORA (network analytical software; scholar lite-version for free download):
http://www.casos.cs.cmu.edu/projects/ora/software.php
 GoogleEarth (Pro-Version): https://www.google.at/earth/download/gep/agree.html
 QuantumGIS (Geographical Information System): https://qgis.org/de/site/

1) Creating a spreadsheet:
One of the easiest way to organize relational data for upload into ORA (or various other
network analytical tools) is a spreadsheet as a “table of network links”: the names of
the nodes of origin of the link are listed in the column “from”, the names of the target
nodes of the link are listed in the column “to”. In the column “strength”, the strength of
the network link is indicated, either simply with 1 (indicating the existence of a link) or
with other values coming from further calculations on link strength (e.g. the inverse
value of the geographical distance between two places, maybe also differentiated
between “upstream” and “downstream” connections if modelling a riverine network, for
instance):

From To Strength
Ostiglia Corte Cavanella 0,95238095
di Loreo
Pegognagna Ostiglia 2,5
Mantua Ostiglia 2,7027027
Calvatone Pegognagna 2,56410256
Brescello Pegognagna 2,3255814
Brescia Calvatone 1,36986301
Mantua Pegognagna 2,94117647
Peschiera delMantua
Garda 2,17391304
Cremona Brescello 1,5625
Samolaco Cremona 0,51546392
Como Cremona 0,51020408
Como Piacenza 0,45248869
Piacenza Cremona 2,22222222
Pavia Piacenza 1,47058824
Mailand Piacenza 1,4084507
Mailand Pavia 1,04166667

2
If you would like to visualize an itinerary (travels, campaigns etc.) of an individual or
a group, you accordingly create a line “from-to” for each leg of the itinerary, such as in
the following example:
From To Strength
Koblenz Aachen 1
Aachen Köln 1
Köln Mainz 1
Mainz Bamberg 1
Bamberg Regensburg 1
Regensburg Augsburg 1
Augsburg Würzburg 1
Würzburg Quedlinburg 1
Quedlinburg Nürnberg 1
Nürnberg Goslar 1
Goslar Quedlinburg 1
Quedlinburg Worms 1
Worms Weißenburg 1
Weißenburg Straßburg 1
Straßburg Würzburg 1
Würzburg Lüttich 1
Lüttich Maastricht 1
Maastricht Nürnberg 1

In another table, you can store the data on the latitude and longitude of the places in the
network; for ORA, one needs to use the “decimal-coordinates”-format:
Name Latitude Longitude
Ostiglia 45.0662 11.1309
Corte Cavanella
45.0612
di Loreo 12.1898
Pegognagna 44.9954 10.859
Mantua 45.1646 10.7949
Calvatone 45.1348 10.4407
Brescello 44.9091 10.517
Brescia 45.5413 10.2202
Peschiera del45.4434
Garda 10.6893
Cremona 45.1321 9.9937
Samolaco 46.2324 9.4108
Como 45.8149 9.0794
Piacenza 45.06 9.6994
Pavia 45.1822 9.1531
Mailand 45.4613 9.1911
Monteu da Po45.1572 8.0204

3
For modern places, one can easily get these coordinates via Wikipedia, for instance; on
the top right of the respective entry, one normally finds “Coordinates”.

With one click on these, you are re-located to the respective entry of the website
“GeoHack”, where you can find the “decimal” coordinates of the place top right. These
coordinates you can copy and paste into your Excel-table (warning: sometimes Excel
will automatically change the pasted data into another number-format; in order to avoid
this, mark the columns into which you will paste the data as “text”).

4
For ancient places, you can find these coordinate via the website “Pleiades”:
https://pleiades.stoa.org/places (“search” window top right). Once you have identified the place
you are looking for, you can find the decimal coordinates under “representative point”.

2) Uploading the table of network links and the coordinates into ORA
In ORA, after initiating the software, you now need to click on “File” in the menu at the
top and select “Data Import Wizard” in the window, which will pop up:

5
A new window “Import Data into ORA” will open, in which you select “Import Excel
or text delimited files” (if you click on the “+” next to this entry, a further sub-menu
will open which provides various options how a spreadsheet to be uploaded can be
organized, also with an image of the necessary table format):

In this menu, you select “Table of network links” and “Sample 2”; as you can see, the
image of the table looks like the one we have created above under 1):

6
Now you click on “next”, and another window will open; under “Create a new meta-
network with name”, you can select a name for you network (such as “Rethymno Test
1”, for instance):

Once you have entered a name, you click on “Next >”, and another window will open:

7
First, you click “Browse” and select the Excel-file, which you have created under 1)

Once you have uploaded the file, further windows will appear under “Step 2”:

8
Under “Step 2”, in the small window “From” you select “Node names” (or “Node Ids”,
depending on your ORA-version) and under “Nodeset class”, you select “Location”.

Under “Step 2”, in the small window “To”, you equally select “Node names” (or “Node
Ids”, depending on your ORA-version) and under “Nodeset class”, you select
“Location”. You do not select anything in the small window “Strength”

9
Under “Step 3”, you now click on “New”, and a line will appear in this sub-menu:

In this line, you select “From” under “Source Node”, “To” under “Target Node” and
“Strength” under “Link Value”:

10
Once you have entered this data, you click on “Next”, and a new window will appear.
In this window, you simply click on “Finish” (the pre-set parameters will work in almost
all cases).

When you have clicked on “Finish”, the name of the network you have selected before
will appear as entry in the “Meta-Network Manager” on the left of the main menu:

11
If you click on the “+” next to the name of the network, two lines will appear below the
network name, one referring to the nodes (“Location”) and one referring to the network
(“Location x Location”):

If you click on the line “Location” and on “Editor” in the large menu window to the
right, the list of node names will appear:

12
Now we need to enter the coordinates as “attributes” to the nodes; for this purpose, one
selects “Attributes” in the menu above the node names and selects “Create new
attribute”:

An new small window appears, in which you select “Latitude” under “Attribute
name” (if you do this, the “Attribute data type” will be automatically changed to
“Number”).

13
If you now click on “Create”, a new column “Latitude” will appear to the right of the
Node Names:

Now you create in the same way another attribute “Longitude”:

14
There are now to empty columns “Latitude” and “Longitude” next to the node names:

In these columns you now can copy and paste the coordinates from the Excel-table of
coordinates we have created under 1) (attention: make sure that your entries in the
Excel-table follow the same order of node names as in the ORA-menu):

15
In between, it is useful to save your ORA-network file (under “File” in the top menu,
select “Save Meta-Network” and indicate where to save to the file):

3) Visualising a spatial network with ORA


Now we can visualize the network. For this purpose, one selects “Visualizations” in the
top menu, and then “View Networks” and “2D Visualization”:

16
Now the “ORA Network Visualizer” will open:

With the help of the Red Globe in the top menu, you can change the shape of the nodes:

17
Other functions of the Visualizer you can easily detect yourself via playing around in
the menu; in order to get back to the original settings, you select “Node Appearance”
in the top menu and “Reset Node Color and Size”:

In order to proceed to the geographical visualization, in your first session of ORA you
have to activate the “Geospatial Networks”-Tool; for this purpose, you click on the
small downwards arrow in the top menu (which reads “Configure toolbar buttons”
if you move with you mouse above it):

18
If you have clicked on this arrow, another window will open. At the bottom of this
window is a small window with “Find”; if you write “Geospatial” in this window, you
will be relocated to the respective entry of “Geospatial Networks”, which you can
activate with a click on the small window to the left of it.

When you have done this, an additional Blue Globe shows up in the top menu:

19
If you click on the Blue Globe, the “ORA-GIS Visualizer” will open (and
congratulations, you have successfully put your network data on a map!):

With your mouse, you can zoom into the map onto your network:

20
In the top menu, you can increase the “Maximum Node Size” and the “Link Width”:

With the yellow tag left in the top menu, you can activate and de-activate the node-
labels (the same is true for the “ORA-Network Visualizer presented above):

21
In the top menu under “Map Options”, you can select a different base map:

If you click on “File” in the top menu and select “Save Map…”, you have various
options: with “Save Map to PNG”, you can save the map as an image file. With “Save
Map to SHP”, you can save the nodes as a “shape-file”, which you then can open in a
GIS-software tool such as QuantumGIS. With “Save Map to KML”, you can save the
network links as a “keyhole markup language”-file, which you can open in
GoogleEarth:

22
If you save the map as a KML-file and if you have installed GoogleEarth on your computer,
the saved file will automatically open in GoogleEarth, if you click on it in the folder in which
you have saved it:

If you select “File” in the top menu, you can select “save” and then “Save as image”:

23
This will allow you to save the image also in high resolution and to add a title, a legend, a scale
and a north arrow to your map:

4) Analyzing the network with ORA


If you would now like to visualize differences in centrality measures etc. in your network,
you have to get back to the main menu of ORA; in the view of the nodes under “attributes”,
you can find the option “Create new attribute measures”.

24
If you click on this option, another window will open which includes a long list of “Measures”
(for an explanation of all these measures, you can consult the “Help”-option in the top menu):

In this list, you can select the measures, which you would like to calculate for your network
(“Centrality, Betweenness”, for instance):

25
If you click on “Centrality, Betweenness” and the on “Create”, an additional column with the
calculated values will show up next to the Node Names; in the same way, you can calculate
all other network measures on the list:

Alternatively, you can also select under “Visualization” in the top menu the option “Measure
Charts”:

26
A new window will show up; you click on “Compute” and then on “Next”.

If you have done this, you get a statistical visualization of the respective network measure for
the top ten nodes (you can also select to have all nodes displayed); you can also select other
network measures in this menu. These statistical graphs can also be stored as images for
further display.

27
With the function “Histogram”, you can also get a visualization of the overall distribution of
network measure values among the nodes of the network (of “degree distributions”, for
instance):

In order to visualize the differences in centrality measures in the network graph, one gets
back to the main menu of ORA and activates again the 2D-visualization:

28
In the top menu, you now select “Node Appearance”, then “Node Size” and “Size Nodes by
Attribute or Measure”

In the window, which appears, you select the attribute or measure you would like to visualize,
and then you click on “Apply Changes” and then on “Close”:

29
The nodes of the network will now appear in different size according to their network measure
values. You can visualize all other network measures by the same way.

Remember: in order to get back to the original settings, you select “Node Appearance” in the
top menu and “Reset Node Color and Size”

30
In the ORA Network Visualizer, you can also do a “Cluster Analysis”, which identifies sub-
groups (“clusters”) of nodes in your network, which are more densely connected among each
other than with the rest of the network. For this purpose, one selects “Node Appearance” in the
menu on the top, then “Node Color” and the “Color Node by Newman Grouping”. The
Newman algorithm is one possible procedure for cluster detection; the “Louvain Grouping”
right below the Newman Grouping is another one, which may produce different results
(therefore, it always makes sense to try both and to present differences in results).

If you have clicked on “Color Nodes by Newman Grouping”, a small window will show up
indicating a “Newman Modularity value” (between 0 and 1), which indicates the general
tendency towards clustering in your network (which can also be used to compare different
networks):

31
If you click on “OK”, the small window will disappear, and the network is now “partitioned”
in different clusters in different colors as identified by the clustering algorithm:

In order to visualize the results of centrality calculations and of cluster detection on the map,
we activate the GIS-Visualiser again via the Blue Globe. In the GIS-Visualizer, you can now
size nodes according to network measure with the option “Analyze Network” in the menu at
the top; then you select “Size Nodes by Attribute or Measure”:

32
Another window will pop up, in which you can select the attribute or measure you would like
to visualize (again, “Centrality, Betweenness”, for instance). Then you click on “Close”.

Then you can manipulate the “minimum” and “maximum node size” in order to make the
differences in size of the nodes well visible:

33
Also in the GIS-Visualizer, you can get back to the original layout configurations via “Analyze
Network” and “Reset Node Colors and Size”:

In order to visualize the clusters, in “Analyze Network”, you select “Color Nodes by Attribute
or Measure”:

34
In the window, which shows up, you then select “Newman” (or “Louvain”, depending on the
cluster algorithm you have used before) among the attributes.

If you then click on “close”, the clusters of nodes will appear in different colors.

35
You can also visualize the clusters in another way if you select in the top menu “Options” and
then “Cluster by Attribute”.

A new window will show up, in which you select “Newman” (or “Louvain”, according to the
cluster algorithm you have used); then you click on “Apply”.

36
The clusters of nodes will now appear as polygons of different colors:

5) Visualising network data from ORA with QuantumGIS


Finally, you can also upload your data in a professional GIS-software such as QuantumGIS; as
mentioned above, you can save the nodes or your geographical network as SHP-file and the
links as KML-File (via “File” – “Save Map…”):

37
If you have installed QuantumGIS on your computer and you open it, the main menu will look
like this:

In order to upload the SHP-file you have saved from ORA, you select “Layer” in the top menu,
then “Add layer” and then “Add vector layer”:

38
A new window will show up, which allows you to “browse” for the file you have saved from
ORA:

Once you have selected the respective file and clicked on “open”, another window will show
up; you have to select a coordinate system – the standard, which is normally pre-set, is “WGS
84 – EPSG:4326” (this one is also used by ORA and by GoogleEarth).

39
Once you have selected the coordinate system, the nodes of your network will show up in the
window to the right:

In order to upload the KML-file with the network links you have saved from ORA, you again
select “Layer” in the top menu, then “Add layer” and then “Add vector layer”:

40
Again, you browse for the file you have created (this time, for a KML-file) and upload it:

Another window will show up, in which you select the lower option “LineString”; then you
click on “OK”:

41
Now, the lines of your network will show up together with the nodes in the window to the right;
in the window to the left, you can change the order of “layers” so that the lines appear below
the nodes, for instance:

Now you need a base map to display your network on; one option is to integrate free base
maps from the internet (if you have a strong internet connection); for this purpose, you select
“Web” in the top menu, then “OpenLayer plugin”; this gives you various options, such as
“Google Maps” and “Google Satellite”, for instance:

42
Depending on the selected base map, it will now show up beneath the network layers (if the
online connection is not strong enough, this however may not work well, as in the example
below):

Another option is to include a base map which you have saved on your computer; you can
find data especially for the ancient Mediterranean for free download via
http://awmc.unc.edu/wordpress/map-files/; there you can download various layers which you
can combine into one map (Elevation data, Inland water, rivers, coast line, Roman roads, etc.)
In order to upload such a base map saved on your computer, you again select “Layer”, then
“Add Layer” and then “Add raster layer”.

43
If you add the Elevation data from the link indicated above, for instance, your map will look
like this now:

You can now add further vector layers from the data downloaded via the link above (“open
water”, “rivers”, “inland water” or “roads”, for instance):

44
You can change the colors of the individual layers added in the menu to the left; if you click
on one layer with the right mouse button, a window will pop up, where you can select the option
“properties”:

In this window, you can select the color you would like for the respective layer, and then you
click on “OK”:

45
If you have changed all colors of all layers according to your wishes, your map may now look
like this:

You can now save this map if you select “Project” in the top menu and the “new print
assemblage” (the name of this option may be slightly different according to your QGIS-
version):

46
A new small window will show up, in which you can enter the name of your map project:

A new window will shop up; in the menu to the left, you select “add new map”

47
Now you can position your map on the white space according to your wishes:

In the menu to the right, you select the resolution in which you would like to save your map
(the standard setting is 300 dpi, which is normally sufficient for any publication in print):

48
Via the menu to the right, you can also select a scale for your map:

This scale, you can configure via the menu to the right and position freely on the map with your
mouse:

49
Via the menu to the left, you can also add a label to the map, which you can configure via the
menu to the right and move freely on the map with your mouse:

Finally, you can save your map as raster image in various formats (such a .tiff or .jpeg) in the
selected resolution, for further presentation or publication:

50
The final result could look like this:

There is also a way to get the data of the centrality calculations and cluster identification
from ORA into QuantumGIS. For this purpose, you copy and paste all the columns from the
ORA main menu into another Excel-Table (again, I would advise to mark all columns as “text”
in the Excel-table before pasting in order to avoid changes in the number format):

51
Now you name the columns in your Excel-Table like the ones in the ORA-menu (Betweenness,
Latitude, etc.)

This excel-file you now save as tab-stop-delimited file:

52
This file you can now import into QuantumGIS via “Layer”, then “Add Layer” and “Import
text file as layer”:

A new window will show up, which allows you to browse for the Tab-delimited-file you have
created via Excel before:

53
Normally, the software will identify all parameters correctly, so that you only have to click on
“OK”:

Again, you have to indicate the coordinate system of your data (WGS 84 – EPSG:4326); then
you click on OK:

54
Now your nodes will show up on the map (in addition to the network links, which you uploaded
before as KLM-files, see above):

Now you size the nodes differently if you click on the respective layer in the menu to the left
with your right mouse button; a new window will show up, in which you select the option
“properties”:

55
In the window, which now pops up, you select “advanced” at the bottom right and then “size
scaling field”, which will open another window with a list of the columns in the file you have
uploaded. Here you may select the network measure you would like to visualize, such as
“Betweenness”, for instance:

Then you click on “Apply” and then change the “Size” at the top of the window until the
differences in size between the nodes become visible (if you click on “apply” again); once you
find the result satisfying, you can click on “OK”:

56
Your map may now look like this:

In addition, you may like to change the colors of your nodes; for this purpose, you again click
on the respective layer in the menu to the left with your right mouse button, so that this window
may show up. At the top, you now select “categorized” from the drop-down menu:

57
In the new menu, you now select for instance “Newman”:

Then you click on “classify”:

58
Now a list with the various Newman clusters and different colors will show up:

Now, in addition to different node sizes, nodes also have different colors according to the
Newman clustering:

59
Furthermore, you can also visualize Clusters in a different way, if you select from the top menu
“Vector”, then “Geo tools” and finally “convex hulls”:

In the new window, which shows up, you select the name of the layer of the uploaded file with
the ORA-data:

60
Then you select “create convex hulls on the basis of a field” and then “Newman” from the drop
down menu:

Then you select a folder to save the created layer and provide it with a name and click “save”:

61
You click on “OK”, and again a window will show up in which you again have to indicate the
coordinate system (WGS 84-EPSG:4326); then you click “OK”:

Now polygons marking the different clusters will show up:

62
You can make these polygons transparent if you click on the layer name in the menu to the
right with the right mouse button, so that this window shows up, in which you can modify the
“transparency” of the layer:

If you click on “OK”, your map will look like this:

63
Via “Layer” in the top menu and then “labelling”, you can also add labels to your places:

In the window which shows up, you select “Name” from the drop down menu; in addition, there
are various ways in which you can change the parameters of the labels which you can easily
explore yourself in this window:

64
Finally, your map may look like this:

This map you can prepare for further presentation or printing in the same way as described
above; the final result may look like this:

65
And ultimately, do not forget to save your QuantumGIS-project, via “Project” and “Save”:

6) Concluding remarks:
There are many aand various ways for processing and analyzing network and geospatial
data and an increasing number of tools. The present manual is based on a well-
established work-flow, which was created with the help of freely accessible and
relatively easy to use-software tools and tested in more than a dozen of workshops with
students and scholars in various countries across Europe (cf.
https://oeaw.academia.edu/TopographiesofEntanglements - “Material for
introduction”)
 For the network analytical tool ORA, there exists an exhaustive and massive manual for
download: http://www.casos.cs.cmu.edu/projects/ora/CMU-ISR-18-103.pdf
 For the various versions of QuantumGIS, numerous manuals and also videos exist
online, such as:
https://geogeek.xyz/qgis-training-course-manual-pdf-includes-exercises.html
http://www.refugeeinfoturkey.org/repo/Toolkit/CapacityBuilding/GIS/02+-
+Step+by+Step+QGIS.pdf or
https://docs.qgis.org/2.18/pdf/en/QGIS-2.18-UserGuide-en.pdf

Finally, you can of course contact me via Email (Johannes.Preiser-


Kapeller@oeaw.ac.at), if you have any questions or problems.

66

You might also like