Book Image

QGIS Blueprints

By : Ben Mearns
Book Image

QGIS Blueprints

By: Ben Mearns

Overview of this book

Table of Contents (14 chapters)
QGIS Blueprints
About the Author
About the Reviewers

Creating the travel time isochron polygons

Let's say that the school in our study is located at the vertex with an ID of 1 in the newark_osm layer. To visualize the walking time from the students' homes, without releasing sensitive information about where the students actually live, we can create isochron polygons. Each polygon will cover the area that a person can walk from to a single destination within some time threshold.

Generating the travel time for each road segment

We'll use DB Manager to create and populate a column for the travel time on each segment at the walking speed; then, we will create a query layer that includes the travel time from each road segment to our school at vertex 1. Perform the following steps:

  1. Navigate to Database | DB Manager | DB Manager.

  2. Select the database to be updated.

  3. Go to Database | SQL window.

  4. Enter the following code:

    ALTER TABLE newark_osm ADD COLUMN traveltime_min float8;
    UPDATE newark_osm SET traveltime_min = length_m  / 6000.0 * 60;
    SELECT *
    FROM pgr_drivingdistance...