So far, we have only looked at the shortest path between all the given segments of road in the city. Now, given the student location, let's look at where student traffic will accumulate.
By following these steps, we will join attributes from the closest road segment—including the associated topological and travel attributes—to each student location. Perform the following steps:
students_topologystudents_topology into the packt_c4 database using Database Manager.The following image shows the parameters as entered into the NNJoin plugin:

We want to find which routes are the most popular given the student locations, network characteristics, and school location. The following steps will produce an accumulated count of the student traffic along each network segment:
SELECT id, geom, count(id1)
FROM
(SELECT *
FROM pgr_kdijkstraPath(
'SELECT id, source, target, traveltime_min as cost FROM newark_osm',
1, (SELECT array_agg(join_target) FROM students_topology), false, false
) a,
newark_osm b
WHERE a.id3=b.id) x
GROUP BY id, geom
We want to visualize the number of students on each segment in a way that really accentuates the segments that have a high number of students traveling on them. A great way to do this is with a symbology expression. This produces a graduated symbol as would be found in other GIS packages. Perform the following steps:

ln("count")
Now that we have mapped the variable sized symbol to the natural log of the count of students traveling on each segment, we will see a pleasing visualization of the "flow" of students traveling on each road segment. The student layer, showing the student locations, is displayed alongside the flow to better illustrate what the flow visualization shows.
