SANET Manual Sandalone
SANET Manual Sandalone
SANET Standalone
June 14, 2020
Table of Contents page
1. About SANET 2
1.1 Functions and Versions
1.2 Copyright
1.3 Use conditions
1.4 Citation in publication
1.5 Contact
1.6 I/O file formats
3. What is SANET? 7
4. Analytical Tools
4.1 Tool 01: Voronoi diagram 10
4.2 Tool 02: Delaunay diagram 12
4.3 Tool 03: Kernel density estimation 14
4.4 Tool 04: Interpolation 16
4.5 Tool 05: Point clustering method 19
4.6 Tool 06: Random points generator 20
4.7 Tool 07: Shortest path distances between points in a set of points 22
4.8 Tool 08: Shortest path distances between A points to B points 24
4.9 Tool 09: Network Characteristics: polylines, points and links 26
4.10 Tool 10: Global auto nearest neighbor distance method 29
4.11 Tool 11: Global cross nearest neighbor distance method 32
4.12 Tool 12: Local cross nearest neighbor distance method 36
4.13 Tool 13: Global auto K function method 39
4.14 Tool 14: Global cross K function method 44
4.15 Tool 15: Local cross K function method 48
4.16 Tool 16: Voronoi cross K function method 53
4.17 When SANET claims “The network is disconnected” 57
1
5. Visualize the SANET sample results on ArcMap, R and QGIS
5.1 Visualize the results on ArcMap and ArcScene 59
5.2 Visualize the results on R 65
5.3 Visualize the results on QGIS 73
6. Manuals
6.1 Procedure for generating ‘buffer sub-networks’ of a generator point set 79
6.2 Procedure for counting the number of points on ‘buffer sub-networks’ of a
generator point set 89
6.3 Procedure for computing the total length of ‘buffer-ring sub-networks’ of a
generator point set 104
6.4 Exact statistical test for network Voronoi cross K function method 114
2
1. About SANET
1.1 Functions and Versions
SANET Standalone statistically analyzes spatial patterns of events that occur
on/alongside networks.
Current version of SANET Standalone Version 1.0 is a licensed program.
The effective license period for SANET Standalone Version 1.0 is one year.
SANET is developed by the SANET Team (Leader: Atsu Okabe).
SANET Version 3.1 is for ESRI ArcGIS Ver.9.1 & 9.2 with Windows XP.
SANET Version 4.0 is for ESRI ArcGIS Ver.9.3 with Windows Vista and Windows XP.
SANET Version 4.1 is for ESRI ArcGIS Ver.10 with Windows 7, Vista and Windows XP.
1.2 Copyright
The program is copyrighted by PASCO and is intended for the use of students,
academic researchers, non-profit researchers and educators.
SANET can be distributed freely on educational and research purposes, but cannot
be re-sold.
3
1.5 Contact
SANET team contact information is as follows.
Request for distribution of SANET Program and sending papers should contact to
Atsu Okabe [atsu@csis.u-tokyo.ac.jp]
Technical questions relating to the SANET software and manual should contact to
Atsu Okabe [atsu@csis.u-tokyo.ac.jp]
4
2. How to resister and run SANET Standalone
2.1 Hardware and Software requirements
Concerning the interface either ESRI ArcMap or QGIS Desktop is required to
visualize the results obtained from running the SANET Standalone.
GNU R is also preferably installed for the better performance of the results.
Place the license number which the SANET team have sent to you after receiving
5
your registration form.
To obtain the license number, download a registration form, fill up the form and
email it to the SANET contact person (see the section 1.5 above). Having qualified
as an eligible user, the license key will be sent to you via email.
AB6666-5555-4444-3333-2222
Click the SET button and you will find all SANET tools in your window.
6
3. What is SANET?
In the real world, there are many and various kinds of network events. Those events may
be classified into two types: the events occurring exactly on networks, termed on-network
events and those occurring alongside networks, termed alongside-networks (Figure 1.1).
network (constrained) events
Source: Figure 1.1 in Okabe and Sugihara (2012). Network (constrained) events
consisting of on-network events and alongside-network events.
Typical examples of on-network events are: traffic accidents (shown in Figure 1.2), road-
kills of animals, street crimes, beaver lodges in watercourses, leakages in gas pipe lines
and river contamination. Alongside-network events include advertisement agencies (Figure
1.3), fast-food shops, convenience stores, fashionable boutiques and other kinds of
facilities locating alongside streets in urbanized areas. Almost all facilities in urbanized
areas are regarded as alongside-network events because their entrances are adjacent to
streets.
Tokyo Bay
Source: Figure 1.2 in Okabe and Sugihara (2012). Sites of traffic accidents around Chiba
station, Japan (private roads are not shown).
7
0 0.5 1.0 km
Source: Figure 1.3 in Okabe and Sugihara (2012). The distribution of advertisement
agency sites (the black points) alongside streets (the gray line segments) in Shibuya ward,
one of the sub-central districts in Tokyo.
Traditionally, network events are analyzed with spatial methods assuming Euclidean
distance on a plane, referred to as planar spatial analysis. However, this assumption is
difficult to accept in practice when analyzing network events, in particular, in urbanized
areas, because Euclidean distances and their corresponding shortest-path distances are
significantly different. As a matter of fact, an empirical examination shows that the
difference is more than 20% when Euclidean distances are less than 400 meters.
Network spatial analysis is not only practical but also theoretically sound because it can
avoid misleading statistical inference when network events are examined. A clear example
is provided in Figure 1.4. Having observed the distribution of points in panel (a), nobody
would consider that points are randomly distributed. This is true when a plane is assumed
but this becomes false when a network is assumed. In fact, the points in panel (b) are
randomly generated according to the uniform distribution over the network (the
configuration of points in panel (a) and that in panel (b) is the same). This shows that
8
planar spatial analysis is likely to lead to false conclusions when applied to network
events.
(a) (b)
Source: Figure 1.4 in Okabe and Sugihara (2012). Point distributions: (a) nonrandomly
distributed points on a bounded plane, (b) randomly distributed points on a network (note
that the point distributions in (a) and (b) are the same).
As is noticed from the above discussion, tools in SANET are practically as well as
theoretically useful for examining network events.
9
4. Analytical Tools
SANET Toolbox includes the following tools: The following sections show how to operate
these tools using the sample data downloadable from the SANET website. Note that each
section is self-contained; therefore, the user can directly go to any section you want to
read.
10
Click to choose a file of network (e.g. orgroad.shp: street network in the
sample data set).
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. Having no trouble such as memory overflows,
you may obtain the following files as the output.
11
Shape: polylines
SgtID: link ID (a polyline ID).
FromX, FromY, From Z: from the node (x, y, z).
ToX,ToY, ToZ: to the node (x, y, z).}.
Length: the length of a link.
AcsID: the Voronoi subnetwork ID to which a link belongs.
To visualize the result, please see section 5.1 / section 5.3.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
12
Click to choose a file of network (e.g. orgroad.shp: street network in the sample
data set).
If the following window does not appear, the network is completely connected.
Proceed to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. Having no trouble such as memory overflows,
13
you may obtain the following files as the output.
14
Choose the file of a network (e.g., orgroad.shp: street network in the sample
data set.).
Choose the file of a set of points (e.g., rsd_pts.shp: location of points in the
sample data set.).
Choose ▼ one of the two estimation methods: “equal split continuous at nodes” or
“equal split discontinuous at nodes”.
Fill in a band width and a cell width. 50 and 10 are put respectively in this example.
Note that if you use a large band width and a small cell width, computation time
becomes long. Try to use a fairly small band width and a large cell size satisfying
that the former is larger than the latter. If the computation time is within your time
allowance, change those values. Our experience says [band size] = 10*[cell size].
We also note that you are supposed to use the same grid coordinates system as that
of the network.
If the following window does not appear, the network is completely connected.
Proceed to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. If you do not have any trouble such as memory
overflows, you may obtain the following files as the output.
15
To visualize the result, please see section 5.1 / section 5.3.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
inverse distance weighting method. Stated explicitly, the tool predicts the value ẑ0 at
neighborhood PN ( p0 ) of p0 , i.e.:
zˆ0 w z i
pi PN ( p0 )
i
,
d S ( p 0 , p i )
wi
p j PN
d S ( p0 , p j )
,
where is a positive predetermined parameter.
For details, see Chapter 9 and Section 12.2.5 in Okabe and Sugihara (2012).
16
Choose the file of a network (e.g., orgroad.shp: street network in the sample
data set.).
Choose the file a set of points at which their attribute values are known (e.g.,
location points in the sample data set.).
Choose ▼ the field in which weights are given.
Choose ▼ “Inverse distance weighting method”.
17
Fill in
cell width (This determines the resolution of the resulting figure; default is 10,
but might require much memory; you may start a larger value, say 10).
value of , say 0.5.
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. If you do not have any trouble such as memory
overflows, you may obtain the following six files as the output.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
18
4.5 Tool 05: Point clustering method
This tool clusters points in a given point set on a given network by the closest-pair
clustering method. For details, see Sections 8.1.2.1 and 12.2.4 in Okabe and
Sugihara (2012).
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
Choose the file name of a set of points (e.g., location points in the sample data
set.).
19
Choose to store the resulting output files, and
Click “OK” .
If the following window does not appear, the network is completely connected.
Proceed to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. If you do not have any trouble such as memory
overflows, you may obtain the following “SANETClustering.R” file as the output.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
20
Then the following window appears.
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
Fill in a number of random points, say 200.
Choose to store the resulting output files, and
Click “OK”.
If the following window does not appear, the network is completely connected.
Proceed to the next step marked by *** below.
21
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. If you do not have any trouble such as memory
overflows, you obtain the following files in the output file.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: JonWiley, a volume in the Wiley series of
Statistics in Practice.
Click the “Shortest-path distances between points in a point set” in the SANET menu.
22
Then the following window appears.
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
Choose the file name of a set of points (e.g., store_pts.shp: store location
points in the sample data set)
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning
window, the program begins to run. If you do not have any trouble such as memory
overflows, you obtain the following file.
23
The contents of the file are as follows.
The first column indicates “from the i-th point of the point set”.
The second column indicates “to the j-th point of the point set”.
The last column indicates the shortest-path distance between those points. For
instance, the shortest-path distance from the 0th point to the first point is 313.0112
and so forth.
AVERAGE of the last row shows the average of all the distances.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
4.8 Tool 08: Shortest path distances from type A points to type B points
This tool computes the shortest-path distance from each point in a given set of type A
points to each point in a given set of type B points, where those points are on a given
network. For details, see Section 12.1.3 in Okabe and Sugihara (2012).
Click the “Shortest-path distances between type A points and type B points” in the
SANET menu. Then the following window appears.
24
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
Choose the file name of a set of type A points (e.g., rsd_pts.shp: location points
in the sample data set).
Choose the file name of a set of type B points (e.g., store_pts.shp: store location
points in the sample data set).
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following file.
25
The contests are as follows.
The first column indicates “from the i-th point of the type A point set.
The second column indicates “to the j-th point of the type B point set.
The last column indicates the shortest-path distance between those points. For
instance, the shortest-path distance from the 0th point of the type A to the 0th point of
the Type B is 76.3664.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
26
Click the “Network characteristics: polylines, points and links” in the SANET menu.
Then the following window appears.
Choose the file name of a network (e.g., orgroad.shp: street network in the sample
data set).
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case, see
p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following three files.
27
SANETNetworkLink.csv
This table shows that the (x, y, z) coordinates of a point specified by PntId.
SANETNetworkSgt.csv
28
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
Click the “Global auto nearest neighbor distance method” in the SANET menu.
29
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
Choose the file name of a set of points (e.g., rsd_pts.shp: location points in the
sample data set).
Fill in:
a number of iterations for Monte Carlo simulation (a default values is 1000),
a bin width (a continuous distance is divided by the equal bin width; a default
value is 10; in this case, the resulting intervals are 0-10, 10-20, 20-30,…..) ,
one-sided statistical significance level (the default value is 5%).
Choose to store the resulting output files. If you want to have intermediate data,
check “Output logs”, which may require much memory. Click “OK”.
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
30
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following three files.
- - - - -
SANETNNDExpectedValue.csv
31
The first column indicates the i-th iteration of Monte Carlo simulation.
The second column indicates “from the j-th point” in a given point set.
Third column indicates “to its nearest neighbor point”.
The last column indicates the shortest-path distance between them.
The last row of the last (1000) iteration (AVERAGE) indicates the average of the nearest
neighbor distance for the j-th iteration.
At the end of this file, “Lower” indicates the lower critical value for the one-sided
significance level is 5 %, while “Upper” indicates the upper critical value for the one-
sided significance level is 5 %
“ALL AVERAGE” indicates the average nearest neighbor distances for 1000 iterations.
SANETNNDExpectedValue.R.
To visualize SANETNNDExpectedValue.R, please see section 5.2.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
32
points are independently and identically distributed according to the uniform distribution
over the network, or points follow the homogeneous binomial point process on the
bounded network. A general description about the nearest neighbor distance method is
provided in Chapter 5 in Okabe and Sugihara (2012); specifically, the global cross
nearest neighbor distance method is shown in Section 5.2.2 and its application in Section
12.2.2.2.
Click the “Global cross nearest neighbor distance method” in the SANET menu.
33
Choose the file name of a network (e.g., orgroad.shp: street network in the sample data
set).
Choose the file of type A points (e.g., store_pts.shp: store location points in the sample
data set); and the file of type B points (e.g., rsd_pts.shp: location points in the sample data set).
Fill in:
a number of iterations for Monte Carlo simulation (a default values is 1000),
a bin width (a continuous distance is divided by the equal bin width; a default value
is 10; in this case, the resulting intervals are 0-10, 10-20, 20-30,…..) ,
a statistical significance level (the default value is 5%; one-sided).
Choose to store the output resulting files, and click OK.
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case, see
p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If the memory is enough, the following three files are obtained
as the output.
34
- - - - -
The first column indicates “from the i-th point in the type B point set”.
The second column indicates “to its nearest neighbor point in the type A point set”.
The third column indicates the shortest-path distance between those points.
The last row “AVERAGE” indicates the average nearest neighbor distance from all type
B points to their nearest type A points.
SANETCNNDExpectedValue.csv
- - - - -
The first column indicates the i-th iteration of Monte Carlo simulation.
The second column indicates “from the j-th point of type B”.
Third column indicates “to its nearest neighbor point of type A”.
The last column indicates the shortest-path distance between those points. The last
row of the i-th iteration, AVERAGE, indicates the average distance of from each type B
point to its nearest type A point.
At the bottom, ALL AVERAGE indicates the average of AVERAGEs, and ALL
VARIANCE indicates the variance of AVERAGEs.
“Lower” and “Upper” indicate the lower and upper critical values for a given
significance level, say, 5 % (one-sided).
35
These numbers indicate: the lower critical value is 104.1329, the upper critical value is
187.033(the significance level is 5 %) and the average of the average nearest
neighbor distances for 1000 iterations is 135.6321.
SANETCNNDExpectedValue.R
To visualize SANETCNNDExpectedValue.R, please see section 5.2.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
Click the “Local cross nearest neighbor distance method” in the SANET menu.
36
Then the following window appears.
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
37
Choose the file name of a set of type A points (e.g., store_pts.shp: store location
points in the sample data set).
Choose the file name of a set of type B points (sd_pts.shp: location points in the
sample data set).
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following six files, three for the observed values and three for the
expected values.
38
SANETLocalCNNDExpectedValue0.csv >> table below left
SANETLocalCNNDExpectedValue1.csv >> table below middle
SANETLocalCNNDExpectedValue2.csv >> table below right
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
39
To state it explicitly, for a set of n points placed on a network, let be the number
of points that are within shortest-path distance from point and be the density
of points on the network. Then the K function is given
.
In the literature, the global auto K function method is simply referred to as the K function
method. A general review of the K function method is illustrated in Chapter 5 in Okabe
and Sugihara (2012); specifically, the global auto K function method is described in
Section 6.1.2, and its application in Section 12.2.3.1.
40
Choose the file name of a network (e.g., orgroad.shp: street network in the sample
data set)
Choose the file name of a set of points (e.g., rsd_pts.shp: location points in the
sample data set).
Fill in:
a number of iterations for Monte Carlo simulation (a default values is 1000),
a unit interval (a continuous distance is divided by the equal unit interval; a
default value is 10) ,
a statistical significance level (the default value is 5%).
Choose to store the output files.
If you want to obtain intermediate files, check “Output log”. Please note that the output
file requires much memory.
Click “OK”.
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
41
If this window appears, the given network is not completely connected. In that case, see
p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following three files.
The third column indicates the shortest-path distance between those points.
The last row “AVERAGE” indicates the average of shortest-path distances between any
pair of points.
42
SANETExpectedValue.csv
This file has two tables.
The first one is as shown below.
The first row indicates that the unit interval is 50 and the resulting intervals are 50, 100,
150, and so on.
Each column indicates the numbers of points within the distance given by the unit
interval ×i for 1000 Monte Carlo iterations, and those numbers are ordered from the
smallest to the largest. For instance, 101 points are independently and identically
generated according to the uniform distribution over the street network for 1000 times;
then the points whose nearest neighbor points within 150 are 4, 8, 8, , .
The second table is as shown below. Note that the file size of this example may be too
large to fit for Excel. Access may be a better choice.
43
The first column indicates the i-th iteration of Monte Carlo simulation.
The second column indicates “from the j-th point” in the point set.
Third column indicates “to the k-th point in the point set.
For instance, the above table shows part of the output of the 0-th iteration, where the
shortest-path distances are from the 0-th point to the k-th point (k =1, 2, …., 100).
At the end of this file, AVERAGE appears, e.g., AVERAGE 2824.017907. This implies
that the average of the shortest-path distances between any pair of points in
the point set.
SANETGraphics.R
To visualize SANETGraphics.R, please see section 5.2.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
To state this test explicitly, consider a set of n A type A points and that of nB type B
points, and let n (t | pA i ) be the number of type B points that are within shortest-path
distance t from the i-th type A point pA i , and B be the density of type A points on
nA
1 n (t | p A i )
K AB (t | p A i ) i 1
.
B nA
In the literature, the global cross K function method is simply referred to as the cross K
function method. A general review of the cross K function method is illustrated in Chapter
6 in Okabe and Sugihara (2012); specifically, the global cross K function method is
44
described in Section 6.2.2, and its application in Section 12.2.3.2..
45
Choose the file name of a network (e.g., orgroad.shp: street network in the sample
data set).
Choose .
The file of type A points (e.g., store_pts.shp: store location points in the sample data
set; type A points are supposed to be structural points)
The file of type B points (e.g., rsd_pts.shp: location points in the sample data set; type
B points are supposed to be temporal points).
Fill in:
the number of iterations for Monte Carlo simulation (a default values is 1000),
a unit interval (a continuous distance is divided by the equal unit interval; a default
value is 10; in this case, the resulting intervals are 10, 20, 30,…..),
a statistical significance level (the default value is 5%; one-sided).
Choose the out file where the resulting files are stored
If you want to obtain intermediate files, check “Output log”. Please note that the output
file requires much memory.
Click “OK”.
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case, see
p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following three files.
46
SANETCKFuncObservedValue.csv
The first column indicates “from the i-th point of type B”.
The second column indicates “to the j-th point of type A”.
The third column indicates the shortest-path distance between those points.
The last row “AVERAGE” indicates the average shortest-path distance.
SANETCKFuncExpectedValue.csv
The first row indicates that the unit interval is 10 and the resulting intervals are 10, 20,
30 and so on.
Each column indicates the numbers of points within the distance given by the unit
interval×i for 1000 Monte Carlo iterations, and those numbers are ordered from the
smallest to the largest.
SANETCKFuncGraphics.R
To visualize SANETCKFuncGraphics.R, please see section 5.2.
47
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
To state this test explicitly, consider a set of n A type A points and that of nB type B
points, and let n (t | pA i ) be the number of type B points that are within shortest-path
distance t from the i-th type A point pA i , and B be the density of type A points on
48
Click the ‘Local cross K function method’ in the SANET menu.
Then the following window appears.
Choose the file name of a network (e.g., orgroad.shp: street network in the sample
data set).
Choose : the file of type A point set (e.g., store_pts.shp: location points in the
49
sample data set), the file of type B point set (e.g., rsd_pts.shp: store location points in
the sample data set). Recall that the local cross K function deals with the number of type
B points within a parametric shortest-path distance from the i-th point in the type A point
set.
Fill in:
a number of iterations for Monte Carlo simulation (a default values is 1000),
a unit interval (a continuous distance is divided by the equal unit interval; a default
value is 10; in this case, the resulting intervals are 10, 20, 30,…..; in the example,
10 was used) ,
a statistical significance level (the default value is 5%; one-sided).
Choose to store the resulting output files, and
Click “OK”.
If the following window does not appear, the network is completely connected. Proceed
to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case, see
p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. Note that for 2 type A points and 47 type B points on the street
network in the sample data set. Also note that this computation requires much output
space, and so your computer memory might be overflowed. When you use the local cross
K function, you are interested in particular type A points, and so you are supposed to use
a small number of type A points. To shorten computational time, you may choose a long
unit interval, say 100 (the default is 10).
50
If the memory is enough, the following files are obtained in the output file. The number of
files is the number of A points multiplied by three. In the example, the number is nine
(three multiplied by three).
SANETLocalCKFuncObservedValue.csv
The first column indicates the i-th point in the type A point set.
The second column indicates the j-th point in the type B point set.
The last column indicates the shortest-path distance between those points.
The last row indicates the average distance fom the i-th A point to evey B point.
SANETLocalCKFuncExpectedValue.csv
This file has two tables.
The first table is shown below.
51
…
The first column indicates the i-th iteration of Monte Carlo simulation.
The second column indicates “from the j-th point of type A”.
Third column indicates “to the k-th point of type B”.
The last column indicates the shortest-path distance between those points.
The last row “AVERAGE” of each simulation indicates the average of those shortest-
path distances (e.g., the 9th row is the average for the first (denoted by 0) simulation.
The last row of the last simulation (e.g., 999) indicates the average of the averages of
all simulations.
The second table is shown below.
The row indicates intervals (with a chosen unit interval). For instance, 100, 200, 300,
and so on.
The column indicates the numbers of type B points within the unit interval for 1000
iterations, and those numbers are ordered from the smallest to the largest. For instance,
52
in the 900 column, the numbers of the type A points within 900 are: 0, 0, 1, 1, … (a
number of these numbers is 1000) for 1000 iterations.
SANETLocalCKFuncGraphics.R
To visualize SANETLocalCKFuncGraphics.R, please see section 5.2.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
Given two sets of points placed a network: a set of type A points (its number is n A ; a
diagram is shown in Figure 1 in Section 6.1) and that of type B points (its number is nB ),
this tool tests the complete spatial randomness (CSR) hypothesis in terms of the number
of type B points that are within a parametric shortest-path distance t from their nearest
type A points. To state it a little more explicitly, consider the shortest-path distance from
every type B point to its nearest type A point. Note that if a type B point is placed in the
Voronoi subnetwork of the i-th type A point, the nearest type A point from the type B point
is the i-th type A point. The number of the resulting shortest-path distances is nB . Next
consider a function, K(t), that indicates the number of type B points satisfying that the
associated shortest-path distances are less than t. The tool tests the CSR hypothesis
with K(t).
53
Then the following window appears.
Choose the file name of a network (e.g., orgroad.shp: street network in the
sample data set).
Choose : the file of type A point set (e.g., store_pts.shp: location points in the
sample data set), and the file of type B point set (e.g., rsd_pts.shp: store location
54
points in the sample data set).
Fill in:
a number of iterations for Monte Carlo simulation (a default values is 1000),
a unit interval (a continuous distance is divided by the equal unit interval; a
default value is 10; in this case, the resulting intervals are 10, 20, 30,…..),
a statistical significance level (the default value is 5%).
Choose to store the resulting output files, and
Click “OK”.
If the following window does not appear, the network is completely connected.
Proceed to the next step marked by *** below.
If this window appears, the given network is not completely connected. In that case,
see p.55 to find out your next step to proceed.
***
When the network is completely connected or if you click “Yes” in the warning window,
the program begins to run. If you do not have any trouble such as memory overflows,
you obtain the following three files.
SANETVCKFuncObservedValue.csv
55
The first column indicates “from the i-th point of type A”.
The second column indicates “to the j-th point of type B”.
The third column indicates the shortest-path distance between those points.
The last row “AVERAGE” indicates the average distance.
SANETVCKFuncExpectedValue.csv
The row indicates bin lengths. For instance, 10 means the bin length is 0-10; 20
means the bin length is 10-20; and so on. While the column indicates the numbers of
points in the i-th bin for 1000 iterations, and those numbers are ordered from the
smallest to the largest.
SANETVCKFuncGraphics.R
To visualize SANETVCKFuncGraphics.R, please see section 5.2.
Reference
Okabe, A. and K. Sugihara (2012) Spatial Analysis Along Networks: Statistical and
Computational Methods, Chichester: John Wiley, a volume in the Wiley series of
Statistics in Practice.
56
4.17 When SANET claims “The network is disconnected”
As you run SANET, you may occasionally come up with the below window;
When you add this Shapefile on ArcGIS, for example, you will be provided with the
below warning map which indicates disconnected parts by color.
The attribute table shows disconnected links by numbers on the AcsID column.
57
If you think that the disconnected parts should be connected, click “Setting” in the
SANET menu. Then the following window appears.
The “Vertex tolerance” means that if the distance between two nodes (vertexes) is less
than 0.001(the unit depends on the scale of the map you are using, default is 0.00001),
then two vertices are regarded as the same. You change the tolerance distance and try
again. If your network is still disconnected, you are supposed to connect disconnected
parts using tools in ArcGIS or QGIS.
58
5 Visualize the SANET sample results on ArcGIS, R and QGIS
5.1 Visualize on ArcGIS and ArcScene
Launch ArcMap and add the Shapefile which the SANET yielded. Open the layer
properties window and set “Value Field” and add values at the symbology tab to make
the layer look properly. The below is an example of setting “Symbology”.
59
Tool 02:Delaunay diagram
60
Above figure is classified as below;
61
Base Heights : Set the elevation value such as 2.0 to exaggerate a bit.
Extrusion :
62
Tool 04: Interpolation
ArcScene will give you the 3D presentation of Interpolation in the same manner as
63
you did with Tool 03 ; Kernel Density Estimation.
64
5.2 Visualize the results on R
Launch R program, and click “Files”.
Then the following window appears.
Click “Source R code”, select the resulting output file, and open it.
65
Tool 10: Global auto nearest neighbor distance method
SANETNNDExpectedValue.R
Selecting the SANET yielded R file, the following graph is obtained.
The curves are: the observed curve; the upper and lower envelop curves for the
one-sided significance level 5%; and the expected curve under the CSR
hypothesis. If the observed curve is in between the upper and lower envelop curves,
we cannot reject the CSR hypothesis with 0.95 confidence level.
66
The curves are: the observed curve; the upper and lower envelop curves for
significance level 5%; and the expected curve under the CSR hypothesis. If the
observed curve is in between the upper and lower envelop curves, we cannot
reject the CSR hypothesis with 0.95 confidence level.
67
The blue curve indicates the observed curve;
the red curve indicates the mean value under the CRS hypothesis;
the green and pink curves are, respectively, the upper and lower envelop curves
under the CSR hypothesis.
68
The blue curve indicates the observed curve;
The red curve indicates the mean value under the CRS hypothesis;
The green and pink curves are, respectively, the upper and lower envelop curves
under the CSR hypothesis.
69
70
The blue curve indicates the observed curve;
the red curve indicates the mean value under the CRS hypothesis;
the green and pink curves are, respectively, the upper and lower envelop curves
under the CSR hypothesis.
71
The blue curve indicates the observed curve;
the red curve indicates the mean value under the CRS hypothesis;
the green and pink curves are, respectively, the upper and lower envelop curves
under the CSR hypothesis.
72
5.3 Visualize the results on QGIS
How to view SANET results on QGIS is shown here using SANETVoronoi Shapefile
as an example.
If you have already downloaded and installed QGIS on your PC, just launch QGIS
desktop and add the Shapefile which the SANET yielded.
To add SANETVoronoiSgt file is as follows.
Select the file in the directory window and right click your mouse button. Then
you will find “Add Layer” in you pull-down menu to select.
After selecting the coordinate reference system of your Shapefile, you will get
below image.
73
In order to view the SANET results of voronoi diagram, open the ”Properties”
window.
74
Press “Classify” button and press OK in the property window as below.
75
Then, you will view the voronoi diagram of the SANET output.
76
About Handling SANET Setup Wizard
1. Unzip the SANET_standalone10_32.zip / SANET_standalone10_64.zip
2. Double click the executable SANET file.
3. Welcome to SANET Setup Wizard
Cancel NEXT
Browse
77
5. Click to start installing SANET
6.
Confirm installation
Back
NEXT
7. Installing SANET
Installing SANET
Please wait
Cancel
8. Completed installation
CLOSE
78
6 Manuals
6.1 Procedure for generating ‘buffer sub-networks’ of a generator point set using
QGIS with GRASS
The ‘buffer subnetworks’ of a generator point set on a network means: for a given network
(the gray and red line segments in Figure 1) and a given generator point set (the orange
circles in Figure 1), the shortest path distance from any points on ‘buffer subnetworks’ (red
line segments in Figure 1) to the nearest point in the generator point set is less than or equal
to a given shortest path distance x (x=200m in Figure 1). An example is illustrated in Figure
1.
Figure 1: Buffer subnetworks (the red line segments; the orange circles are generator
points)
79
1) Open QGIS 3.x with GRASS 7.x (x represents any number of the version of the
software).
Figure 2
Figure 3
80
3) Click “Open Data Source Manager” (Ctrl+L).
Figure 4
Figure 5
81
4) Select “Vector” in Figure 5.
Then the window in Figure 6 appears.
Figure 6
82
Figure 7
Figure 8
7) Select a network data to “input vector line layer” (in Figure 9) and
a set of generator points data to “centers point layer” (in Figure 9).
83
Set the value of “threshold for connecting centers to the network”
and ”costs for isolines” (in Figure 9).
The costs for isolines means the list of buffer distances that you want to create;
noted that you should use a comma to separate values (e.g., 100, 200, 300).
After entering those parameters, click “Run” (the arrow in Figure 9).
Figure 9
8) Completed the task, click “Close” (in Figure 9) to close the v.net.iso window.
9) Right click the output temporary file (the orange arrow in Figure 10), and
click “Property” (the green arrow in Figure 10).
84
Figure 10
10) Select “Symbology” tab (the orange arrow in Figure 11), and choose “Categorized”
from the box on the top (the green arrow in Figure 11).
Figure 11
85
Click “Classify” (the orange arrow in Figure 12).
Set the rules for symbols (e.g., color and width) as you like.
Click “OK” (the green arrow in Figure 12).
Note that “cat = 1” represents line segments form the buffer subnetwork in which
the shortest path distance from the nearest generator point is less than 100 m; “cat
= 2” is between 100 m and 200 m; “cat =3” is more than 200 m.
Figure 12
You obtain the map in Figure 13, showing multi-distance buffer subnetwork.
86
Figure 13
12) If you want to save the temporary file as a permanent shape file, right click the
output temporary file (the orange arrow in Figure 14), and
click “Make Permanent” (the green arrow in Figure 14).
87
Figure 14
88
Figure 15
To state the above computation precisely, let 𝑁(𝑥 , 𝑥 ) denote the ‘buffer-ring sub-networks’ of a
network 𝑁 in which the shortest path distance from any points on 𝑁(𝑥 , 𝑥 ) to the nearest
generator point (Type A) is between 𝑥 and 𝑥 , where 𝑥 < 𝑥 , 𝑥 − 𝑥 = 𝑐 for 𝑖 = 0, 1, 2, …
Note that 𝑐 is a parameter determined by a user. In an illustrative example here, 𝑐 = 10m. Visually,
𝑁(0, 𝑥 ) is obtained from the ‘buffer sub-networks’ in Figure 1 in Section 6.1, where 𝑥 = 200.
Therefore, ‘buffer-ring sub-networks’ 𝑁(𝑥 , 𝑥 ) is obtained from 𝑁(0, 𝑥 )¥ 𝑁(0, 𝑥 ), i.e., the
compliment of 𝑁(0, 𝑥 ) with respect to 𝑁(0, 𝑥 ).
89
To state the above computation precisely, given a set of generator points on a given network 𝑁,
let 𝑁(𝑥 , 𝑥 ) denote the sub-network of 𝑁 in which the shortest path distance from any points
in 𝑁(𝑥 , 𝑥 ) to the nearest generator point in given generator points is between 𝑥 and 𝑥 ,
where 𝑥 < 𝑥 𝑥 − 𝑥 = 𝑐 for 𝑖 = 0, 1, 2, … Note that 𝑐 is a parameter determined by a user.
In an illustrative example here, 𝑐 = 10m.
Let 𝐿(𝑥 , 𝑥 ) be the total length of line segments constituting the sub-network 𝑁(𝑥 , 𝑥 ), and 𝐿
is the total length of line segments constituting the whole network 𝑁.
In terms of the above notations, this manual describes the procedure for computing 𝐿(𝑥 , 𝑥 ).
Let 𝑙 be link 𝑗 of a given network, and 𝑑(𝜕𝑙 ) refers to the shortest path distance between the
start node of link j and the nearest generating point from link j; 𝑑(𝜕𝑙 ) is the shortest path
distance between the end node of link 𝑗 and the nearest generating point.
Step 1
Run the “Voronoi diagram” tool of SANET. In more detail, see Section 4.1 Tool 01: Voronoi
diagrams in User Guide/Manual for SANET Standalone.
Step 2
Copy “SANETVoronoiPnt.dbf” and “SANETVoronoiSgt.dbf” on one folder.
Step 3
Open these files in Excel.
* You may follow the four steps described below, or you may use an alternative method as you
like.
90
3-3) Click “Browse” and select the folder in which you saved the files (the green arrow in
Figure 1).
3-4) In the “Files of Type” drop down box, select: “All Files” (the blue arrow in Figure 1),
and then choose “SANETVoronoiPnt.dbf” and “SANETVoronoiSgt.dbf”, and click “Open”.
Figure 1
Step 4
Copy these two sheets on a new book (for instance, Book1). Figure2 is a sample of the screenshot
after step 4).
Figure 2
91
Step 5
In the cell Q2 (column Q and row 2) of “SANETVoronoiSgt” sheet, enter the formula to compute
distance from the generator to “FromPnt” of the segment:
=VLOOKUP(H2,SANETVoronoiPnt!$A:$J,8, FALSE)
Figure 3
Step 6
Copy the formula to the other segments by left-clicking and dragging the small dot at the lower
right corner of Q2 down column Q to the end row of the data.
Figure 4
Step 7
In cell R2 of SANETVoronoiSgt, enter the formula to compute distance from the generator to
“ToPnt” of the segment:
=VLOOKUP(I2,SANETVoronoiPnt!$A:$J,8, FALSE)
92
Hit the enter.
Figure 5
Step 8
Copy the formula to the other segments by left-clicking and dragging the small dot at the lower
right corner of R2 down column R to the end row of the data.
Figure 6
Step 9
Copy the values of columns Q and R, and paste them to a new sheet.
93
Figure 7
Step 10
Delete Cell A1 and B1 (blank spaces). Note that choosing “Shift cells up” as the option and then
clicking “OK”.
Figure 8
Step 11
Hit Alt + F11 to open Excel VBA editor.
94
Step 12
Add a new module in VBA editor by clicking on VBAProject (Book1), right click, Insert > Module.
Figure 9
Step 13
Copy the following scripts and paste it into the window of Module1. The code sorts out the data.
Column D will have 𝑑(𝜕𝑙 ): the shortest path distance between the start node of link j and the
nearest generating point from link j; and column E will have 𝑑(𝜕𝑙 ): the shortest path distance
between the end node of link 𝑗 and the nearest generating point.
Sub Transformation()
MaxRow = Rows.Count
For i = 1 To MaxRow
If Cells(i, 1) > Cells(i, 2) Then
Origin = Cells(i, 2)
Destination = Cells(i, 1)
95
Else
Origin = Cells(i, 1)
Destination = Cells(i, 2)
End If
End Sub
Figure 10
96
Step 14
Run the module by clicking “Run Sub” icon (see Figure 11). Figure 12 is an output example. You
would see that each value of Column D must be smaller than each one next to it (Column E).
Figure 11
Figure 12
97
Step 15
Create another module in the VBA editor (Module2), and copy the following scripts and paste it into
the window. This code is for calculating 𝐿(𝑥 , 𝑥 ): the total length of line segments constituting
the sub-network 𝑁(𝑥 , 𝑥 ). Note that this code assumes that the bin width 𝑐 = 10m.
Sub Classification()
MaxRow = Rows.Count
MaxBin = MaxVal ¥ 10 + 1
For j = 0 To MaxBin
For i = 1 To MaxRow
ElseIf Cells(i, 4) <= j * 10 And Cells(i, 5) >= j * 10 And Cells(i, 5) <= (j + 1) * 10 Then
Cells(j + 1, 10) = Cells(j + 1, 10) + (Cells(i, 5) - j * 10)
ElseIf Cells(i, 4) > j * 10 And Cells(i, 4) <= (j + 1) * 10 And Cells(i, 5) > (j + 1) * 10 Then
Cells(j + 1, 10) = Cells(j + 1, 10) + ((j + 1) * 10 - Cells(i, 4))
ElseIf Cells(i, 4) > j * 10 And Cells(i, 4) <= (j + 1) * 10 And Cells(i, 5) <= (j + 1) * 10 Then
Cells(j + 1, 10) = Cells(j + 1, 10) + (Cells(i, 5) - Cells(i, 4))
End If
Next i
Next j
For k = 1 To MaxBin
98
Cells (k,9) = k*10
Next k
End Sub
Step 16
Run the module by clicking “Run Sub” icon. Note that this macro takes a lot of time (about several
hours depending on data size) to complete the calculation. Figure 13 is an example of outputs.
Figure 13
In terms of the above notations, this manual describes the procedure for computing 𝑛 𝑥 𝑃 .
Note that this computation uses the output of the Voronoi cross K function tool in SANET software
package.
99
1) Run the “Voronoi cross K function method” tool of SANET. See the Section 4.16 in the
SANET manual.
* You may follow the steps below, or you may use an alternative method as you like.
a) Open Excel.
c) Click “Browse” and select the folder in which you saved the files (the green arrow in
Figure 1).
d) In the “Files of Type” drop down box, select: “All Files” (the blue arrow in Figure 1), and
then choose “SANETVCKFuncObservedValue.csv”, and click “Open”.
Figure 1
100
4) In cell E2, enter 𝑥 : the minimum value (meters) of bin 𝑐 (e.g., 10). Next, in cell E3, enter
𝑥 : a double value of E2 (e.g., 20).
Figure 2
5) Highlight cells E2:E3. When we drag the fill handle to the below (by left-clicking and
dragging the small dot at the lower right corner: AutoFill function), Excel will fill in the next
cells with values having same intervals (e.g., 30, 40, 50, and so on… as shown in Figure 3).
101
Figure 3
6) In cell F2, enter the formula that counts 𝑛 𝑥 𝑃 : the number of point-like facilities
located within a specific range from generating points
=COUNTIFS($C$2:$C$131,"<”&E2)
*Note that “131” (the number of type B points) in the formula change appropriately.
102
Figure 4
Figure 5
103
8) If you want to obtain the number of points on the line segments between xi and xi+1, enter
the following formula in cell G2.
=COUNTIFS($C$2:$C$131,"<"&E2, $C$2:$C$131,">="&E2-10)
Hit the enter and copy the formula to the rest of bins by using AutoFilll function.
Figure 6
Let 𝐿(𝑥 , 𝑥 ) be the total length of line segments constituting the buffer-ring sub-networks
𝑁(𝑥 , 𝑥 ), and 𝐿 is the total length of line segments constituting the whole network 𝑁.
104
In terms of the above notations, this manual describes the procedure for computing 𝐿(𝑥 , 𝑥 ).
Let 𝑙 be link 𝑗 of a given network, and 𝑑(𝜕𝑙 ) refers to the shortest path distance between the
start node of link j and the nearest generating point from link j; 𝑑(𝜕𝑙 ) is the shortest path distance
between the end node of link 𝑗 and the nearest generating point.
Step 1
Run the “Voronoi diagram” tool of SANET. In more detail, see Section 4.1 Tool 01: Voronoi
diagrams in User Guide/Manual for SANET Standalone.
Step 2
Copy “SANETVoronoiPnt.dbf” and “SANETVoronoiSgt.dbf” on one folder.
Step 3
Open these files in Excel.
* You may follow the four steps described below, or you may use an alternative method as you
like.
3-3) Click “Browse” and select the folder in which you saved the files (the green arrow in
Figure 1).
3-4) In the “Files of Type” drop down box, select: “All Files” (the blue arrow in Figure 1),
and then choose “SANETVoronoiPnt.dbf” and “SANETVoronoiSgt.dbf”, and click “Open”.
105
Figure 1
Step 4
Copy these two sheets on a new book (for instance, Book1). Figure2 is a sample of the screenshot
after step 4).
Figure 2
Step 5
In the cell Q2 (column Q and row 2) of “SANETVoronoiSgt” sheet, enter the formula to compute
distance from the generator to “FromPnt” of the segment:
=VLOOKUP(H2,SANETVoronoiPnt!$A:$J,8, FALSE)
106
Figure 3
Step 6
Copy the formula to the other segments by left-clicking and dragging the small dot at the lower
right corner of Q2 down column Q to the end row of the data.
Figure 4
Step 7
In cell R2 of SANETVoronoiSgt, enter the formula to compute distance from the generator to
“ToPnt” of the segment:
=VLOOKUP(I2,SANETVoronoiPnt!$A:$J,8, FALSE)
107
Figure 5
Step 8
Copy the formula to the other segments by left-clicking and dragging the small dot at the lower
right corner of R2 down column R to the end row of the data.
Figure 6
Step 9
Copy the values of columns Q and R, and paste them to a new sheet.
108
Figure 7
Step 10
Delete Cell A1 and B1 (blank spaces). Note that choosing “Shift cells up” as the option and then
clicking “OK”.
Figure 8
Step 11
Hit Alt + F11 to open Excel VBA editor.
109
Step 12
Add a new module in VBA editor by clicking on VBAProject (Book1), right click, Insert > Module.
Figure 9
Step 13
Copy the following scripts and paste it into the window of Module1. The code sorts out the data.
Column D will have 𝑑(𝜕𝑙 ): the shortest path distance between the start node of link j and the
nearest generating point from link j; and column E will have 𝑑(𝜕𝑙 ): the shortest path distance
between the end node of link 𝑗 and the nearest generating point.
Sub Transformation()
MaxRow = Rows.Count
For i = 1 To MaxRow
If Cells(i, 1) > Cells(i, 2) Then
Origin = Cells(i, 2)
Destination = Cells(i, 1)
110
Else
Origin = Cells(i, 1)
Destination = Cells(i, 2)
End If
End Sub
Figure 10
111
Step 14
Run the module by clicking “Run Sub” icon (see Figure 11). Figure 12 is an output example. You
would see that each value of Column D must be smaller than each one next to it (Column E).
Figure 11
Figure 12
112
Step 15
Create another module in the VBA editor (Module2), and copy the following scripts and paste it into
the window. This code is for calculating 𝐿(𝑥 , 𝑥 ): the total length of line segments constituting
the sub-network 𝑁(𝑥 , 𝑥 ). Note that this code assumes that the bin width 𝑐 = 10m.
Sub Classification()
MaxRow = Rows.Count
MaxBin = MaxVal ¥ 10 + 1
For j = 0 To MaxBin
For i = 1 To MaxRow
ElseIf Cells(i, 4) <= j * 10 And Cells(i, 5) >= j * 10 And Cells(i, 5) <= (j + 1) * 10 Then
Cells(j + 1, 10) = Cells(j + 1, 10) + (Cells(i, 5) - j * 10)
ElseIf Cells(i, 4) > j * 10 And Cells(i, 4) <= (j + 1) * 10 And Cells(i, 5) > (j + 1) * 10 Then
Cells(j + 1, 10) = Cells(j + 1, 10) + ((j + 1) * 10 - Cells(i, 4))
ElseIf Cells(i, 4) > j * 10 And Cells(i, 4) <= (j + 1) * 10 And Cells(i, 5) <= (j + 1) * 10 Then
Cells(j + 1, 10) = Cells(j + 1, 10) + (Cells(i, 5) - Cells(i, 4))
End If
Next i
Next j
For k = 1 To MaxBin
113
Cells (k,9) = k*10
Next k
End Sub
Step 16
Run the module by clicking “Run Sub” icon. Note that this macro takes a lot of time (about several
hours depending on data size) to complete the calculation. Figure 13 is an example of outputs.
Figure 13
6.4 Exact statistical test for Voronoi cross K function method on networks
using outputs of the tools in SANET software package
This manual instructs a procedure for achieving the exact statistical test of global Voronoi cross K
function method. The global Voronoi cross K function method is explained in detail in Section 6.2.3
in Chatper 6 of Okabe and Sugihara (2012).
114
To begin with, let us introduced a few notations. We consider a network 𝑁, on which two types of
points are placed, i.e., Type A points (generator points of the network Voronoi) and Type B points
(activity points).
Note that the notations conform to the SANET software. Okabe and Sugihara (2012) treated the
terms in the opposite (i.e., Type A: activity points, Type B: generator points).
Let 𝑁(𝑥 , 𝑥 )denote the sub-network of 𝑁 in which the shortest path distance from any points on
𝑁(𝑥 , 𝑥 ) to the nearest point in Type B points is between 𝑥 and 𝑥 , where 𝑥 < 𝑥 , 𝑥 −
𝑥 = 𝑐 for 𝑖 = 0, 1, 2, … Note that 𝑐 is a parameter determined by a user. In an illustrative example
in Figure 1, 𝑐 = 10 m.
Let 𝐿(𝑥 , 𝑥 ) be the total length of line segments constituting the sub-network 𝑁(𝑥 , 𝑥 ), and 𝐿
is the total length of line segments constituting the whole network 𝑁.
Suppose that Type B points are distributed on 𝑁 according to the complete spatial randomness,
CSR. Then the probability that a Type B point is located on 𝑁(𝑥 , 𝑥 ) is given by 𝑝 =
𝐿(𝑥 , 𝑥 )/𝐿, and 𝑚(𝑥 , 𝑥 ) follows the binomial distribution with parameter 𝐿(𝑥 , 𝑥 )/𝐿.
The data of 𝐿(𝑥 , 𝑥 ) are obtained from running the Voronoi diagram tool in SANET. This task is
explained by the manual “A procedure for computing the length of line segments of a network
satisfying that the shortest path distance from a point on the line segments of a network to its nearest
generator point among given generator points placed on the network is between 𝑥 and 𝑥 ”.
Step 1
Compute the total length 𝐿 of network 𝑁 by summing 𝐿(𝑥 , 𝑥 ) for 𝑖 = 0, 1, 2, …. You may use
AutoSum function as shown in Figure 1.
115
========[Omit]========
Figure 1
Step 2
To compute, first, type in the equation in cell K2 (Figure2) and drag as shown in Figure3.
Figure 2
116
Figure 3
Step 3
Create a new sheet and set the framework shown in Figure 4.
117
Figure 4
Step 4
In cell B2, type in the following formula to calculate the probabilities of the binomial distribution
for 𝑖 = 10, 20, …
*Note that “131” (the number of type A points) and “Sheet1” (the sheet name storing the
probabilities of each bin width) in the formula change appropriately. In this case, the resulting value
in cell B2 of Figure 5 represents the probability to locate no type A points within 10m from their
nearest type B points under CSR hypothesis.
118
Figure 5
Step5
Copy the formula to the rest of rows (Column B) by using AutoFilll function. And, in cell C2, type in
the following formula to calculate the probability.
* Change the value from $2 in the formula described at Step 4 to $3 (colored in Red).
Figure 6
119
Repeat Step 5 until all bins and counts are filled.
* The value colored in Red in Step 5 should be added one by one every time changing the column.
Figure 7 shows the sample output.
Figure 7
Step 6
In order to visualize the magnitude of probabilities, you may want to use "data bars" with
conditional formatting. Select the cells which you would like apply the rules. On the home tab, click
“Conditional Formatting”. Point to Data Bars, and then click “More rules” (Figure 8).
120
Figure 8
As Figure 9 shows, select “Number” from type drop down from Maximum and enter 1 in the value.
Click “OK”.
Figure 9
121
You obtain the bar charts with values in Figure 10, showing probabilities of a result of the Network
Voronoi Cross K function method.
Figure 10
122