Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

build a road network

I have various number of tracks which represents different roads. Each track represent one road. I have loaded this gpx file into my postgres.

Now my problem is how am I going to build a network between all these roads, in order to be possible to find the shortest path from any track point to any other track point. Below here you can see an image of my 4 roads. my roads

I have already installed pgrouting and postgis. I have already done something by creating a source and target column and loaded them with data using assign_vertex_id(). The thing is that the network is not being build properly, such as I can only go from a start point to an end point of the same road rather than of different roads. Any suggestions how can I build a proper network between all these roads?

like image 841
IT_info Avatar asked Nov 13 '22 21:11

IT_info


1 Answers

This is an old question, but pgRouting now have functions to help you build the network from inside the database.

http://docs.pgrouting.org/2.0/en/src/common/doc/functions/node_network.html#pgr-node-network

like image 142
George Silva Avatar answered Jan 04 '23 01:01

George Silva