Converting a spatial network to a graph Converting a spatial network to a graph in R Binbin Lu, Martin Charlton National Centre for Geocomputation National University of Ireland Maynooth Maynooth, Co.Kildare, Ireland Maynooth, Co.Kildare, Ireland The R User Conference 2011
23
Embed
Converting a spatial network to a graph Converting a spatial network ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Converting a spatial network to a graphConverting a spatial network to a graph in R
Binbin Lu, Martin CharltonNational Centre for Geocomputation
l i l i l l b k d lGRASS Cleaning tools in v.clean Toolset: break, rmdangle, snap
AutoCAD Map Creating a network topology, Editing Topologies
Over correction
Structure OptimizationStructure Optimization
43
2
1 2
10 98
12
14
1113
15
16
8
5 617 18 7
Pseudo-node
Multiple-edgeSelf-loop
Test on Ontario Road Network dataTest on Ontario Road Network data
Test on Ontario Road Network dataTest on Ontario Road Network dataComparison between original ORN and optimized graph
Data Number of nodes Number of edges
Original vector data 37178 48765
Optimized graph 25928 36375
1125030%
1230025%
Integration of point data into networkIntegration of point data into network
Two guidelines:1 Find a representative node1. Find a representative node
for each point
2. Add a new edge to connect each point with the network
i. M nt to
t Mapping the ne a
each
Poi
nre
st p
oint
each poiarest node
Map
ping
eth
e ne
arint toe
iii.
Mh iii. A
dd a point
wee
n ea
cst
poi
nt
new edg
and the n dge
betw
e ne
ares
ge betwee
nearest n a ne
w e
dnt
and
the
en eachnode
iv. A
dd
poi n
Edge ReconstructionEdge Reconstruction
Edge splitEdge split_ iNew a A
l
Functions for recalculating attributes
_ ii
lNew a AL
Edge merge
_ max
_ mini
i
New a A
New a A
_ sum
_ meani
i
New a A
New a A
R package “shp2graph”p g p g p
R package “shp2graph”p g p g p
After conversion you canAfter conversion, you can…
• compute the shortest paths
• visualize the graph with igraph, shp2graph,visualize the graph with igraph, shp2graph,pajek
d k l i i h i ki d f• do network analysis with various kinds ofmethods available in graph, igraph, RBGL, etc
• ……
Future workFuture work
I was an R beginner when I started to developthis package, so… I make lots of mistakes!p g
• Awkward parameter settings in functions
• Poor coding style• Poor coding style
Topology correction functions will be developedin the near futurein the near future.
I will keep working on this, and welcome any contribution, suggestions or comments., gg
AcknowledgmentsAcknowledgments
• To Centre for Research into Statistical Methodology(CRISM) for funding me to attend this conference.
• Research presented in this paper is jointly funded bya Strategic Research Cluster grant (07/SRC/I1168) bya Strategic Research Cluster grant (07/SRC/I1168) byScience Foundation Ireland under the NationalDevelopment Plan and China Scholarship CouncilDevelopment Plan and China Scholarship Council(CSC).