Geography Reference
In-Depth Information
Joe Asks. . .
What's the Difference Between a Table and a Layer?
In our discussion, a PostGIS layer is a table in PostgreSQL that has
a geometry column. It may or may not have a record describ-
ing it in the geometry_columns table.
So, layers are also tables, and you may find us referring to them
in both ways. A PostgreSQL table without a geometry column is
just that—a table in the database.
notice there is a “Sql” column in the layer list. This will be initially be
empty, and we'll see its purpose in just a minute.
Loading a layer from the list is easy. Just select one or more by click-
ing them (they will be highlighted as you click so you know they are
selected); then click the Add button. The layers will be added to the
QGIS map canvas and drawn using a random color. Once loaded, you
can modify the colors and rendering using the symbology options we
discussed in Section 3.4 , Advanced Viewing and Rendering, on page 45 .
Suppose we have a PostGIS layer with 10 million features. As you can
imagine, it would take a while to draw, moving all the data across the
network. Or consider a layer that contains thousands of features, but
we are interested only in some of them based on one of their attributes.
This is where the ability to limit the features in a PostGIS layer comes
in handy. You could think of these as “virtual layers” since they are
defined by a query at the time you add them to QGIS. Let's look at
an example using the Geographic Names Information System (GNIS)
available from the U.S. Geological Survey. 9
GNIS contains information about geographic features, including the
“official” name. For example, the data includes lakes, streams, islands,
glaciers, towns, and schools. All the features are represented by a sin-
gle point. We'll use the GNIS data for Alaska in our example and add
several “virtual layers” based on queries against the gnis table.
9.
http://geonames.usgs.gov
 
 
Search WWH ::




Custom Search