[GIS] point to point distances along road network

distanceNetworkqgisroad

I have 2 different point layers that I want to use as origins (Company offices) and a separate layer with 500+ points in it (Client Stores) I also have a road network layer.

For each of the 500+ stores I would like to have a field in the attribute table showing the distance along the road network back to each of the Offices.

I currently use QGIS.

Best Answer

There are a large number of potential answers to this question, but for a QGIS only solution, I would look at using the net functions in Grass, which should be accessible if you install Grass 7 (you may already have it). Please note you may encounter a bug where the path to your Grass 7 files is not properly defined - to fix this just go to Processing->Options->Providers->Grass GIS 7 commands and then set the folder correctly.

Have a look here - you can get to this function by looking for v.net.path in the processing toolbox (Ctrl-Alt-T if it's not on).

Then define your road network (you will need to have a point layer for nodes and a line layer split at these nodes) and tolerances (how far each link can be away from the node to be considered part of the network). There will be some work to do depending on how your dataset is organised, but you could also look at v.net to see if that can help.

Then you can define the routes you want to calculate in a json file which apparently has to be in the format id start_point_x start_point_y end_point_x end_point_y. You then pass this to "Name of file containing start and end points" parameter in the Grass tool and hopefully you will have some results. More likely you will have problems along the way, but at least this might point you in the right direction.

Other options not involving QGIS include pgRouting (based on postgis / postgres), spatialite_network or graphopper. There are of course commercial offerings as well, which will most likely be slightly easier to use for you.

Related Question