pgrouting
pgrouting copied to clipboard
Add pgr_CreateTopology3D to support overpass/underpass intersections
This should be considered for 2.1 as it is low risk and basically a clone of pgr_CreateTopology with some simple changes. Or might be added directly to it with an optional argument.
The idea here is that some data sets use z-level to indicate the level that the streets connect at an intersection. So by default all nodes are at z-level=0 or null to indicate ground level. Then nodes the are below ground level are given -1, -2, etc and nodes at intersections above ground level are given values 1, 2, etc. So consider the following simple intersection:
D
|
A-----------------B------------------C
|
E
where A-B-C is an over pass and D-B-E is an underpass. Then using the following notation for edges: A-B(A, B, Az-level, Bz-level) we would have data like:
A-B(A, B, 0, 1)
B-C(B, C, 1, 0)
D-B(D, B, 0, 0)
B-E(B, E, 0, 0)
Then we can construct nodes for the vertices_tmp table with x,y,z-level coordinates where z values is z-level * factor to exceed the tolerance test for identical nodes and then B(x,y,0) != B(x,y,1) and they will get assigned different values. st_3Ddistance() in postgis can be used to compute the separation of the nodes.
The function is ST_3DDistance :)