How to do it...

Carry out the following steps to run the data store query:

  1. Navigate to File | Run Datastore Query. Choose the PostGIS connection from the Connection drop-down menu or use the Connection Manager utility if you are not linked to the database.
  2. We'll create and name a polygon layer of the main streams in the region by executing the following query:
      SELECT gid, ST_BUFFER("chp11".lines.geom_sp, 75)       AS the_geom, fullname       FROM "chp11".lines WHERE fullname <> '' AND hydroflg = 'Y'

The preceding query is shown in the following screenshot:

The preceding query selects the lines on the map that represent hydrology units such as "hydroflg" ...

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.