[GIS] PostGIS + pgRouting: Adding dumthe links to a road network and performing routing analysis

geodjangonumpypgroutingpostgispython

I'm a beginner when it comes to postgis and pgrouting development.

For a project I'm working on and a bit of the algorithm:

  • I have a polygon layer that represents zones
  • I have a line layer that represents roads based on classifications: Freeway, Arterial, and Collector, and Local
  • I created a point layer of all the zone centroids
  • I would like to create a table of n x "dummy link(s)". These links connect the centroid to the road layer based on the road classfication (above), the link is within the polygon, and based on nearest neighbour (nearest proper road classification segment to centroid).
  • A dummy link has infinite capacity and has a cost of zero.
  • These links should be added to their own table
  • I would like to start the routing from the centroid layer.
  • At each of the centroids, I would like to do a minimum spanning tree or Dijkstra to all other centroids of the network.
  • The end goal would be a matrix of some sort.
  • I'd like this operation to be somewhat fast, as I would have about 200 zones (400 once you consider two way traffic), with a road network of roughly 1,000,000 links. Road weights/costs will change as they are time of day dependent; therefore, there will be at least 24 iterations per zone.
  • If possible, I'd like to limit most of my development to python as I'm comfortable with python and libgdal.

Question:

  1. Is this feasible using postgis + pgrouting, especially considering that I am not proficient at SQL?
  2. Can you critique my model, suggest improvements, "gotchas", anything that would make my life a little bit easier?

Best Answer

ad 1. It's always good to learn SQL. There might be some learning curve, but why not.

ad 2. Have you considered using the network node closest to the polygon centroid instead of your more complex approach of creating dummy links?