820 lines
24 KiB
Plaintext
820 lines
24 KiB
Plaintext
|
|
################################################################################
|
||
|
|
### Creating networks from imported OSM data (9 / 11)
|
||
|
|
################################################################################
|
||
|
|
### Description:
|
||
|
|
### - This script creates a relation containing junctions between three Sections
|
||
|
|
### belonging to two Streets.
|
||
|
|
### (the number 1 in the relation name stands for incoming, the number 2 means
|
||
|
|
### outgoing)
|
||
|
|
### Please, see tu_shp_import.sh for further details.
|
||
|
|
###
|
||
|
|
### Preconditions:
|
||
|
|
### - activated necessary algebras
|
||
|
|
### - existing open database with successfully imported osm data
|
||
|
|
### - FullSectionsView-relation
|
||
|
|
###
|
||
|
|
### Postconditions:
|
||
|
|
### - cityJunctions-relation
|
||
|
|
### threeSecJuncBtwTwoSts: rel{Road1: int, Pos1: double, Road2: int,
|
||
|
|
### Pos2: double, JunctionType: int}
|
||
|
|
###
|
||
|
|
### Author:
|
||
|
|
### - Thomas Uchdorf, thomas.uchdorf(at)fernuni-hagen.de
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#----->x<-----
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let ThreeSecInZeroOut111AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,2,2,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#----->xxxxxxx
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
let ThreeSecInZeroOut111BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,2,0,1,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#----->x----->
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let TwoSecInOneOut112AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,2,1,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#----->xxxxxxx
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
let TwoSecInOneOut112BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,2,0,2,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#----->x<------
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let TwoSecInOneOut121AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,1,2,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#----->xxxxxxx
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
let TwoSecInOneOut121BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,1,0,1,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#<-----x<------
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let TwoSecInOneOut211AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,2,2,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#<-----xxxxxxx
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
let TwoSecInOneOut211BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,2,0,1,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#----->x----->
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let OneSecInTwoOut122AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,1,1,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#----->xxxxxxx
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
let OneSecInTwoOut122BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, EndNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(1,1,0,2,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#<-----x----->
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let OneSecInTwoOut212AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetEndNodeId = .EndNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,2,1,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
#<-----xxxxxxx
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
let OneSecInTwoOut212BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {b}
|
||
|
|
hashjoin [NodeId,EndNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,2,0,2,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#<-----x<-----
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let OneSecInTwoOut221AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,1,2,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#<-----xxxxxxx
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
let OneSecInTwoOut221BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,EndNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,EndNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,1,0,1,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#<-----x----->
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
# x
|
||
|
|
let ZeroSecInThreeOut222AJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_c])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,1,1,0,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,.OneWay_c = 1,FALSE),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road1 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# ^
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
#<-----xxxxxxx
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# |
|
||
|
|
# v
|
||
|
|
let ZeroSecInThreeOut222BJuncTmp =
|
||
|
|
(((NodesRel feed
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
filter [(.StreetStartNodeId = .StartNodeId) and
|
||
|
|
not(.StreetStartNodeId = .StreetEndNodeId)]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {a}
|
||
|
|
hashjoin [NodeId, StartNodeId_a,99997])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,
|
||
|
|
OneWay] {b}
|
||
|
|
hashjoin [NodeId,StartNodeId_b,99997]
|
||
|
|
filter [.SectionId_a < .SectionId_b])
|
||
|
|
FullSectionsView feed
|
||
|
|
sortby [SectionId]
|
||
|
|
project [StreetId,SectionId,StartNodeId,StreetData,SectionData,OneWay] {c}
|
||
|
|
hashjoin [NodeId,StartNodeId_c,99997]
|
||
|
|
filter [.SectionId_c < .SectionId_b])
|
||
|
|
projectextEnd [;
|
||
|
|
Road1: .StreetId_a,
|
||
|
|
Pos1: atpoint(.StreetData_a,.Node,TRUE),
|
||
|
|
Road2: .StreetId_b,
|
||
|
|
Pos2: atpoint(.StreetData_b,.Node,TRUE),
|
||
|
|
Road3: .StreetId_c,
|
||
|
|
JunctionType:
|
||
|
|
getconnectivitycode(2,1,0,2,
|
||
|
|
.OneWay_a = 1,.OneWay_b = 1,FALSE,.OneWay_c = 1),
|
||
|
|
Sec1: .SectionId_a,
|
||
|
|
Sec2: .SectionId_b,
|
||
|
|
Sec3: .SectionId_c,
|
||
|
|
Node: .Node,
|
||
|
|
SecData1: .SectionData_a,
|
||
|
|
SecData2: .SectionData_b,
|
||
|
|
SecData3: .SectionData_c]
|
||
|
|
filter [(.Road2 = .Road3) and not(.Road1 = .Road2)]
|
||
|
|
consume;
|
||
|
|
|
||
|
|
# Creating the union
|
||
|
|
let ThreeSecJuncBtwTwoSts =
|
||
|
|
((((((((((((((ThreeSecInZeroOut111AJuncTmp feed
|
||
|
|
twoSecInOneOut112AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
TwoSecInOneOut121AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
TwoSecInOneOut211AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
OneSecInTwoOut122AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
OneSecInTwoOut212AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
OneSecInTwoOut221AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
ZeroSecInThreeOut222AJuncTmp feed
|
||
|
|
concat)
|
||
|
|
ThreeSecInZeroOut111BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
TwoSecInOneOut112BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
TwoSecInOneOut121BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
TwoSecInOneOut211BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
OneSecInTwoOut122BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
OneSecInTwoOut212BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
OneSecInTwoOut221BJuncTmp feed
|
||
|
|
concat)
|
||
|
|
ZeroSecInThreeOut222BJuncTmp feed
|
||
|
|
concat
|
||
|
|
consume;
|
||
|
|
|