[OSRM-talk] via_points in output
Stephen Woodbridge
woodbri at swoodbridge.com
Mon Nov 18 17:20:44 UTC 2013
On 11/18/2013 12:09 PM, Florian Lohoff wrote:
> On Mon, Nov 18, 2013 at 09:08:47AM -0500, Stephen Woodbridge wrote:
>>> Or would it be more feasible to extend the OSRM output a bit to dump
>>> these interesting nodes additionally?
>>
>> Why not take the route geometries and load them into postgis where
>> you can intersect the routes and get the crossing points? You could
>> alternatively probably do this in C, PHP, Perl or Python using a
>> libgeos wrapper which is the geometry engine that is in PostGIS.
>
> I am talking about multiple million routes - My testset has 26k routes.
>
> And the point is that after discoverying the intersections i need to
> delete the routes and calculate 3 new routes.
>
>
> A ----------x------------ B
> |------------
> |
> |
> C
>
>
> Calculating A -> B
> Calculating C -> B
> Finding x
> Calculating A -> x
> Calculating x -> B
> Calculating C -> c
>
> Flo
>
Flo,
pgRouting has a function to node a network of lines. It basically does
exactly this.
It takes a table of linestring geometries, chops all the strings at the
intersection and forms a correctly "noded" result in a new table,
maintaining a back reference to the original table so you can move any
attributes over to the new table.
https://github.com/pgRouting/pgrouting/blob/master/src/common/sql/pgrouting_node_network.sql
Let me know if you want to try this and need help getting started.
-Steve
More information about the OSRM-talk
mailing list