Can I use QGIS 3.10 to display overlaid encoded google polylines, with the purpose of showing road network activity?
I am using QGIS 3.10.
I have a series of GPS points that go from one origin to ten different destinations, with average journey length 1,000km. The points were uploaded by CSV file and are sorted by journey, then by the appropriate consecutive next location i.e. everything is sequential. The points are derived from an encoded Google overview polyline that has been decoded.
The road network is a separate layer.
The first image shows all journeys' GPS points along a short section of one of the roads (yellow spots, along the yellow road).
I used the "points to path" tool to make the purple lines, where the paths are created on a per-journey basis and in the correct sequential order. Some sections of the created paths do not align with the road network, despite individual points being accurate.
The section of road in the screenshot is approximately 35km long, and the max variation between the "point to path" line and the road is 1,750m. This is one of many examples where the variation is significant. I understand QGIS has just drawn from, say, [journey 2; point 21] to [journey 2; point 22] when making the line, and that it has not dropped extra points in between to ensure snapping to the road.
I would like the purple lines (created by "points to path") to follow the road network when they connect the yellow spots. This is because I would like to make a heatmap of road network use. The plan was to follow instructions in Doing heatmap from line data in QGIS? to use QChainage to break the paths back into regularly-spaced points.
Currently, when I plot a heatmap of the individual GPS locations used, I get erroneous gaps. The origin for each journey shown is at the left-hand side of the image, and no destinations exist within the picture. That is, this road has been used a uniform number of times, so the heatmap should be one uniform colour.
The heatmap shows what it does because of the random number of GPS locations at random intervals along the same road, I understand that.
How do I make it so that if I plotted a path linking the individual journey points in their respective consecutive order, that path would snap to the road network?
The purpose being I would like to then break the paths back to points, to make a heatmap (unless there is a better way to show something similar with overlaid lines/paths).
Can I make the "point to path" lines snap to the road network?
Or, to put it another way, how do I make the "point to path" lines follow the road when they are created?
The lines are clearly made point-to-point as fits the particular journey, I have no issue with that, but I would like the created paths to snap to the roads and I can't figure out how to do it.
I acknowledge the network analysis "shortest path" tool could help here, but it is incredibly slow on my computer, and the underlying data is already the result of a "shortest path" analysis. Once I work out how to plot the data in this little dataset I will be plotting thousands more journeys.
I am happy to learn Python if it makes this problem go away.
points to path
tool?