Download Introduction to GIS Using Open Source Software

Transcript
2.4. EXPLORING FEATURES
7. Clear selected features. Click the
CHAPTER 2. EXPLORING THE INTERFACE
deselect features button on the toolbar to remove selected features from all
layers. Alternatively, with the
Select features button active, you could click on an area of the map that has
no stations to clear the features, or you could clear the current selection from the attribute table.
8. Labeling features. Attributes stored in the table can also be used to label features. Select the subway_stations
layer in the ML to activate it. Click the
layer labeling options button on the toolbar (alternatively, you can
double-click on the layer in the ML and access the Label tab via the layer properties menu). Check the box
that says Label this layer with and in the dropdown choose the trains column. Click OK. Explore the map a
little, and notice how the labels shift as you zoom in. We’ll experiment more with labeling later on. Click the
labels button again and uncheck the box to turn the labels off.
2.4.2
Commentary
Attribute Tables
Every vector feature has a record in the attribute table; you can’t have a feature without an attribute or vice versa. In
a shapefile, the geometry is stored in the .shp file, an index of the geometry is in the .shx file, and the attributes are
stored in a .dbf file. As we’ll explore throughout this tutorial, attributes can be used for selecting, symbolizing, and
labeling features in layers.
In GIS software attribute tables are managed and handled in the same manner as tables in a relational database.
Each column has a data type associated with it which determines the kind of data that can be stored in that column
and the types of operations that can be performed on it. Data types include strings (aka text) and various types of
numeric fields (integers for whole numbers, reals for numbers with decimal places, etc). When you use the Expression
Builder to select features, like bcode = ’36005’, you are actually creating SQL code, which is a standard language for
manipulating data in a database. The code ’36005’ must be surrounded by quotes, as the data is an identifier saved
as a text or ’string’ field; if we were querying actual numeric values we would not use quotes.
F. Donnelly, Baruch CUNY, 2015
21
CC BY-NC-ND 4.0