[pgrouting-users] Routing via different Layers/Levels

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jan 5 13:25:41 PST 2015


Hi Eyad,

I'm a little confused as to what you are trying to do. Just to be clear:

pgr_nodeNetwork() is for creating nodes and splitting edges the 
intersect but do not have a node at the intersection.

NOTE: there has recently been some bugs reported against 2.0 
pgr_nodeNetwork() and there might be a pull request. Check the tickets.

pgr_createtopology() is takes a nodded network and assigns the nodes to 
the edges.

Typically networks that have overpass/underpass that should not be 
connected, use a zlevel at each end of the segment. So you might 
represent an over pass like:


                   E(0)
                  /
          ----B(1)-----
         /      /      \
A(0)---/      B(0)     \-----C(0)
              /
             /
            D(0)

A-B-C is a highway overpass
B-B-E is a highway underpass

(n) is the zlevel

So B(0) and B(1) have the same x-y position but they are not connected 
together.

You can make a fairly simple clone to pgr_createtopology() to take the 
zlevel*factor as the z value of a point with the x-y values and check 
for 3D distance between the nodes. This will result in the B(0) and B(1) 
getting assigned different node ids and the related segments will then 
not be connected.

I have some old code floating about that does this, but it is a simple 
change if you wanted to do it yourself.

If this is not what you are asking about, sorry, please give more 
details on what you are trying to accomplish.

-Steve

On 1/5/2015 3:57 PM, AUS - Eyad wrote:
> Hi All,
>
> Is there a way to conduct nodding for part of a network instead of the
> whole network in order to restrict routing through specific channels
> (i.e. 2 layers network where access is restricted via ramps)?
>
> I tried the below 2 codes:
>
> 1)select pgr_nodeNetwork('schema.network_table',50,’id’,'geom') FROM
> schema.network_table where (Layer='first_level');
>
> 2)select pgr_nodeNetwork('schema.network_table' where
> (Layer='first_level'),50,’id’,'geom');
>
> The first is entering endless loop processing the data; the second is
> returning a syntax Error (@WHERE)!
>
> I know that the second sounds clearly wrong code, but I provided the
> above example trying to brain-storm with all.
>
> If there is no option to do the required while nodding or
> creating_topology, is it possible to utilize 2 separately_noded networks
> (instead of the below highlighted one) within the following code?
>
> SELECT seq, id1 as source, id2 as target, cost FROM pgr_kdijkstraCost(
>
>      'SELECT id, source, target, (st_length(geom) * 0.001) as cost FROM
> *_schema.network_table_noded_*',
>
>      (SELECT id FROM schema.p_table WHERE id=1), (SELECT array_agg(id)
> FROM schema.p_table), false, false
>
>    )
>
> Please advise suitable/potential code….
>
> Happy New Year to ALL
>
> Eyad
>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>



More information about the Pgrouting-users mailing list