How to do it...

In the following example, we will look at all users within a distance of three units from our starting point—that is, a proposed bike shop at node 2:

SELECT * FROM pgr_drivingDistance(  'SELECT id, source, target, cost FROM chp06.edge_table',  2, 3);

The preceding command gives the following output:

As usual, we just get a list from the pgr_drivingDistance table that, in this case, comprises sequence, node, edge cost, and aggregate cost. PgRouting, like PostGIS, gives us low-level functionality; we need to reconstruct what geometries we need from that low-level functionality. We can use that node ID to extract the geometries ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.