33
GIS Fundamentals: Digital Data, Basic Tables Lab 6 1 Lab 6: DEMs, National Wetlands Inventory and Basic Table Manipulations in QGIS What You’ll Learn: This lab introduces some commonly available digital data sets, and introduces a number of rudimentary table operations. Data: Unless noted, data are in UTM Zone 15, NAD83, meters, coordinates, and the data files are found in the \L6 subdirectory, including: US_cities, a point layers of cities and towns, in NAD83 geographic coordinates, cen_Stx_U83, a subset of U.S. census bureau block group data, for a small area spanning the Minnesota/Wisconsin border, nlcd_border, a National Landcover data set, in an Alber’s conic projection, USGS_sheds, watershed boundaries at the hydrologic unit code level 8 (HUC-8), NED_lstx30, a National Elevation Dataset for the lower St. Croix HUC-8 watershed NHD_LStx_high.mdb, a National Hydrologic Dataset geodatabase for the lower St. Croix HUC-8 watershed Stil_wetU83, wetlands data for the Stillwater, Minnesota USGS 7.5 minute quadrangle What You’ll Produce: four maps: 1) a census data set, with subset cities from a US data set 2) shaded relief/hydrography map, 3) summary of wetlands by size, and 4) summary of wetlands by type. Background: This exercise introduces table queries. Most GIS store attribute data in tables. Each feature in a data layers is associated with a row in a table. A table query is a selection of rows (also called table records) based on a set of criteria. For example, you might select all polygons that are more than 100 hectares in size. We typically then further process the selected set, for example, assign values for a specific item, or export the records. You’ll be doing this sort of table manipulation in most of the remaining labs, so we’ll keep these first selections and subsequent operations rather simple. First, we’ll compose two maps including some of the wide range of data that are available for download from web sources. Next, we will introduce table operations using National Wetlands Inventory (NWI) data. We will select subsets of these data based on the size of the wetland polygons, and on wetland type (is it an upland or wetland, is it in Wisconsin or Minnesota), and produce corresponding maps. Digital Data Much data is available for download from the worldwide web, as described in Chapter 7 and appendix B of the GIS Fundamentals textbook. We will examine a few of these, and compose maps using downloaded data.

Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

1

Lab 6: DEMs, National Wetlands Inventory and Basic Table Manipulations in QGIS

What You’ll Learn: This lab introduces some commonly available digital data sets, and introduces a number of rudimentary table operations.

Data: Unless noted, data are in UTM Zone 15, NAD83, meters, coordinates, and the data files are found in the \L6 subdirectory, including:

US_cities, a point layers of cities and towns, in NAD83 geographic coordinates, cen_Stx_U83, a subset of U.S. census bureau block group data, for a small area

spanning the Minnesota/Wisconsin border, nlcd_border, a National Landcover data set, in an Alber’s conic projection,

USGS_sheds, watershed boundaries at the hydrologic unit code level 8 (HUC-8), NED_lstx30, a National Elevation Dataset for the lower St. Croix HUC-8 watershed NHD_LStx_high.mdb, a National Hydrologic Dataset geodatabase for the lower St.

Croix HUC-8 watershed Stil_wetU83, wetlands data for the Stillwater, Minnesota USGS 7.5 minute quadrangle

What You’ll Produce: four maps: 1) a census data set, with subset cities from a US data set 2) shaded relief/hydrography map, 3) summary of wetlands by size, and 4)

summary of wetlands by type. Background: This exercise introduces table queries. Most GIS store attribute data in

tables. Each feature in a data layers is associated with a row in a table. A table query is a selection of rows (also called table records) based on a set of criteria. For example,

you might select all polygons that are more than 100 hectares in size. We typically then further process the selected set, for example, assign values for a specific item, or

export the records.

You’ll be doing this sort of table manipulation in most of the remaining labs, so we’ll

keep these first selections and subsequent operations rather simple. First, we’ll compose two maps including some of the wide range of data that are available for

download from web sources. Next, we will introduce table operations using National Wetlands Inventory (NWI) data.

We will select subsets of these data based on the size of the wetland polygons, and on wetland type (is it an upland or wetland, is it in Wisconsin or Minnesota), and produce

corresponding maps.

Digital Data Much data is available for download from the worldwide web, as described in Chapter 7 and appendix B of the GIS Fundamentals textbook. We will examine a few of these,

and compose maps using downloaded data.

Page 2: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

2

Start QGIS and add the raster data set named nlcd_border.tif.

Right click on the layer and open the Properties-Style menu, change the render

type to Singleband psuedocolor, and the Load min/max values to Min/max (near the center-right of the window).

The minimum value displayed should be 11 (the value assigned for water) and the maximum 92 (assigned to herbaceous wetland). This raster contains a set of numbers

for each of the encountered NLCD data types. Each code corresponds to a defined landcover type, as described in Chapter 7 of the GIS Fundamentals textbook.

Page 3: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

3

It is inefficient to re-enter a pleasing color scheme every time we load the data (i.e., blue water, green trees), and even more burdensome to retype the labels. Try the

following:

Click on the Load Style…. Button near the bottom center, and select the file NLCD_Styles.qml found in the L6 directory. This is a set of colors/numbers created

earlier.

Click Apply then O.K. This should give a color scheme as shown below:

You can save and apply standard color schemes by saving and loading styles.

You create a qml file by clicking on the green plus in the Properties – Styles menu,

then clicking double clicking on the Value, Color, and Label entries, and typing or

selecting the desired values. You then Apply it and Save Styles via the

buttons near the bottom of the Properties – Style window.

Next time you display a data set with the same categories, you can import this layer file via the Load Styles button, as described above.

Page 4: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

4

Census Data Delete the nlcd_boarder image, and add the census data, cen_StX_U83.shp to your

new empty data frame. This is a subset of the census attributes for a portion of the Minnesota/Wisconsin border. Each polygon is a block group, a unit of aggregation for population census data. (Video:Census_Data_Display)

Open the attribute table (right click on cen_StX_U83 in TOC, then click Open Attribute

Table), and inspect the values for the column labeled pden_psqkm.

This is the population density for the census block groups in this area.

Next, make sure the Statis

plugin in loaded/activated (Plugins-Manage and install

plugins – All – Statist; see graphic at right).

Find the Statist icon , probably displayed near the lower left margin of the main

QGIS window frame, and click on it, it should display a Field statistics window, in this case with the only vector layer cen_StX_U83 selected:

Set the target field to pden_psqkm, and click on OK, this should display a histogram

and statistics shown in the figure above.

Page 5: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

5

Note that the data has quite a few small values, and a few very large values. This

“long-tailed” distribution is common in some types of data, and often displays better with a non-uniform set of symbol ranges. We’ll demonstrate.

Close the window, and open the Properties - Style menu for the census data layer.

Symbolize by setting the main style as Graduated (1), the Column (2) to the population density field (pden_psqkm), and the Mode (3) to Quantile (Equal Count).

Select Apply – OK.

The example to the right shows how the data were displayed with the defaults that came up on my system,

the blue color ramp and five classes.

Notice the rather useless symbology, in that the lines obscure the colors for the small polygons, and there is little range in colors.

We can get a more useful symbology through more

1 2

3

Page 6: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

6

advanced options in the style menu.

We wish to display more classes across colors balanced over the range of population densities.

Open the Style menu again (right click on the layer in the TOC, then Properties, then Style).

Make sure the Graduated symbol type and the pden_psqkm Column are still

specified.

Click on the Delete all button (1) below the symbol list, it should remove all the symbols you specified earlier.

Click on the Classes window (2), and specify 20 classes

Click on the Color Ramp (3), and specify YlOrRd from the pick list

Click on the Mode button (4), and change the value to Quantile(Equal Count)

Click on the Classify button (5)

Apply these, and hit O.K.

1

2

4

5

3

6

Page 7: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

7

Note how it changes the colors to better show the range of variation. Try various

combinations of class numbers, modes, and color ramps, remembering to Delete All of the categories/symbols before trying a new set.

When you are finished, return to the YlOrRd color ramp and classes in the figure above.

Note that in the densely populated, small polygons near the center of the data, lines

obscure the polygon colors. To remove the lines around each polygon:

Click on the first symbol in the list, then hold down the shift key, and click on the last

symbol in the list.

Click on the Symbol, Change button (6, figure above) near the middle of the Style window, to display the window below:

Click on the Symbol button/bar, then click on the Simple Fill patch in the lower - left (7), then set the Border style to No Pen (8), then click on OK near the bottom.

This should return you to the Style menu, then specify Apply – OK

Notice this removes the lines that obscure the small polygons.

This should display the layer in a manner similar to that shown at right.

This symbology provides a clearer view of the

variation in the data. Note that there are many other options in the menu

that contains the Style menu. You may group, flip,

8

7

Page 8: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

8

ramp, or otherwise change a set of selected symbols, or all symbols.

Experiment with these to see their effects.

Subsetting Overlapping Areas You often download data for a large area, but are interested in data for a sub-area.

There are various ways to subset, here we show how to select an area corresponding to a smaller data set. (Video: Subset_Cities)

Add the US_cities.shp point layer to the data frame that contains the census tracts, and bring the cities data to the top of the stack. They should display over the census

polygons. These are data on cities for the entire U.S. and territories. Use the Zoom to Full

Extent button to view the entire dataset.

Notice that the US cities dataset includes cities in

Hawaii, Alaska, and Guam, covering quite a broad area (figure at right).

Turn off on-the-fly projection (from the main toolbar select Project, then Project Properties, then

uncheck the box at the top of the menu that enables on the fly CRS transformation).

Once again click the zoom to full extent button, and observe the difference in what is displayed now to

the last time you displayed these two data sets.

Inspect the data and metadata, and identify the coordinate system for both the US_cities and cen_StX_u83 data sets.

Notice that these are two different projections, one a geographic (latitude/longitude)

and the other a projected coordinate system. The geographic coordinate system is restricted to coordinate values between -180 and 180 for the Y, and -90 to 90 for the X, while the UTM coordinates are typically in the half-million (x) to several million (y)

range. You must be careful when mixing coordinate systems in analysis, because some functions won’t work as expected when you combine data from several different

coordinate systems. We’ll show an example of this using a selection function. First, turn on the fly projection back on for this project.

Now, zoom to the extent of the census data set.

We want to combine these two data sets, selecting only those cities within the

Page 9: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

9

polygons of our census data set. It would be nice if the selection functions could project different coordinate systems on the fly, while doing the analysis, but

unfortunately, this presently isn’t the case for QGIS. In addition, some of the geographic coordinates are so far out of the range of our targeted NAD83(86) UTM

zone 15 N coordinates that we can’t simply project them. In some installations that crashes the QGIS program.

So, we employ a multi-step process to subset only those cities that fall within the census data layer. We get a much smaller list of cities through a manual selection,

then transformation, including many cities near the edge but still outside the census area.

This greatly reduces the data that we need to process in the next step, particularly those geographic coordinates that are very different from the ones found in the study

area. We then project this smaller data set to the UTM Zone 15, NAD83(86) coordinate

system. This reduces the amount of data in the next step, greatly speeding it up, and reduces the likelihood of a crash.

After projection, we use a subset by area function to save only those cities found within the boundaries of the census data set.

We do this by:

- Display the source Layer cen_Stx_U83, and the UScities layers

- Manually select by rectangle to select the features. The select by rectangle tool is available from the selection group, usually displayed along the top main frame of

QGIS: There are several selection modes available from a

drop-down menu, so you’ll likely have to left click and hold on the current mode, and change the mode by

picking from the list:

Note that the icon has a small, downward pointing, black triangle in the lower-right corner. This is your clue that there are “hidden” choices in a dropdown. Whenever you

see this, left-clicking and holding should reveal the choices.

- Make sure you have the “select by rectangle” selection mode chosen. With the cities on top, left-click, hold, and drag to draw a rectangle that covers the entire

Page 10: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

10

area of the census blocks.

You should see a set of selected cities in yellow (the current selection color), and the surrounding, unselected cities in the original symbology (here, dark green):

- Save this set by right clicking on the UScities

data layer, and clicking on Save As in the dropdown menu:

- Then check the box for

- “Save only selected features”

- Make sure to set the CRS to the

NAD83/UTM zone 15 coordinate system, to match the UTM census data, and name it something appropriate, here citSelbyrect.shp, then click OK to

execute the change:

Page 11: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

11

- Remove the US_cities data layer, and add the citSelbyRect.shp layer you just created, you should see something like:

- Start the Vector-Spatial Query tool:

- Specify those features from the citSelbyRect.shp that intersect the census data in UTM coordinates, here

cen_StX_U83.shp, then hit apply:

Page 12: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

12

This should select the subset of cities

only coincident with the coverage of the census data, here displayed

together

Produce your first map to turn in: Create a

layout view, include both the selected population density and cities data layers, a suitable legend, North arrow, scale bar, and

description, and produce a pdf.

Digital Elevation and NHD Data We’ll now explore digital elevation and related hydrologic data a bit. We’ll hold off an in-

depth treatment of DEMs until Chapter 11 in the GIS Fundamentals textbook, and a later lesson. We’ll just introduce the data, and you show how to make an interesting

shaded-relief map, suitable for backgrounds and many illustrations. (Video: DEM_NHD)

Page 13: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

13

Create a new ArcMap project, and set the data frame coordinate system to the UTM

Zone 15N, NAD83 projection.

Add the USGS_sheds.shp dataset to the data frame. These are watershed boundaries derived from elevation data, and downloaded from the US Geological Survey.

Label these features: Right click on USGS_sheds in the TOC >

Properties > Labels

Then left click on the checkbox “label

features in this layer”,

Choose SUBBASIN as the Label Field, and then Apply - OK

This should place the name of the each sub-basin within a polygon, something

like the figure to the right. Try to copy/create a data set that consists of the outline of only the Lower St. Croix

watershed, near the center of the data set.

We won’t give you exact instructions, you should be able to figure it out with a hint. Use the single selection tool Save selection as to save your data to a new shapefile.

Now, remove all the data from your data frame.

Create a Shaded-relief Elevation Map - Add the ned_lstx30 DEM to your data canvas. Note that

because this is in an ESRI grid format, you should load the

w001001.adf that is found within the ned_lstx30 data directory. I know, this is a bit

arcane, but ESRI grids are a common proprietary format

that you can display with the open GDAL standards. You just need to know which of the

files to display, and it is usually the lowest numbered

.adf file, without the x at the end of the name.

Page 14: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

14

-Use Properties > Symbology to display the Layer Properties menu and set a single-band psuedocolor symbology. Set the color ramp to Spectral, check the Invert box,

set the Classes to 100, and click classify, Apply, and OK:

Resultant display:

Now, calculate a hillshade surface.

-Make sure the Raster Terrain

Analysis plugin is installed:

Page 15: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

15

- Then from the main QGIS window, select Raster – Terrain Analysis –

Hillshade, to open a hillshade menu:

- Specify the displayed w001001 elevation layer, a suitably named output file, and accept the defaults, including the Azimuth (horizontal angle

to the sun), and vertical angle:

If you want, you can set the Z factor to something higher than 1, this is a vertical exaggeration, and a larger number accentuates

the terrain.

It is usually best to use a value between 1 and 4.

When you click O.K. this should create a hillshade surface, and if it isn’t done

automatically, load it and place it on top of your DEM. We haven’t covered these in the readings, we’ll explain them in Chapter 11 of the textbook, but for now just know they can be used to give the sense of relief in terrain map, and are often used as a

background image.

Now make the hillshade semi-transparent: Right click on the hillshade in the TOC, then Properties > Transparency.

Set the Transparency to something near 50%, then Apply – OK.

Page 16: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

16

You should now see the DEM, with the hillshading “painted” on top (see the

figure). This is a commonly-used affect in producing maps.

Finally, let’s add some hydrologic data

from the National Hydrologic Dataset (NHD). These are lakes, streams, and

other water features, derived from DEMS and other sources, and integrated into a consistent hydrologic network:

Add National Hydrologic Dataset data

(NHD, you should be familiar with these from the readings in Chapter 7 of the GIS Fundamentals textbook).

Click on the Add Vector Data icon to add

the NHDWaterbody shapefile. This should display a set of polygons,

including types with various labels, e.g., Artificial Path, Stream/River, etc.

Remove the labels for all but the LakePond and Reservoir (Properties > Style, right click on a symbol, then Delete.

Symbolize these two water types blue, with no border.

Finally, add the data layer NHDFlowlinw.shp.

Symbolize the StreamRiver and Artificial Paths in blue, and CanalDitch in red.

Remove the other line types from the legend. Your data view should appear approximately as the figure here, although the elevation

color shading will be a bit different, depending on the vertical exaggeration.

Page 17: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

17

Map 2 to Turn in: Create a

layout with the usual map elements, output a pdf, and

save your project.

Page 18: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

18

NWI Data and Table Manipulations

Open a new QGIS project, and Add the data layer Stil_wetU83.shp to a new, empty

project (Video: Wetlands_By_Size).

Right click on the Stil_wetU83 layer in the table of contents, then left click on Open Attribute Table in the dropdown menu.

You will see the attributes of the wetlands layer. The Field called “Area” displays the area of the polygon in square meters (m2). The “Wet_type” field displays the type of

wetland. Detail codes are listed at the end of this document. Left click over the heading of the “Area” column

until you see the little triangle on the right side of the column heading pointing down (as shown

right). This brings the largest polygons to the top of the table. Notice that the largest areas are

coded “U”, for uplands, and “Out”, area outside the mapping jurisdiction for these data, in this case, in Wisconsin.

We will be classifying the polygons by their size, which is contained in the “Area” attribute.

Left click on the “select features using and expression icon, along the top row of the

table:

This should open an expression editor similar to the graphic to the right.

You build an expression in the bottom pane, using a combination of fields, operations,

and other functions from the lists.

You select elements of the expression by left clicking on elements from the pick lists displayed in function list or from buttons in

the operators bar across the lower third of the window, and sometimes by typing in

values.

Page 19: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

19

This expression is applied to the data table to select a subset of features.

In the Select by Expression window:

1) left click on the “Fields and Values,” then “Wet_type” field (you should see

“Wet_type” appear in the Expression pane at the

bottom), 2) click on the “=” button in

the operators list, mid-

window, 3) click on the “all unique”

button, mid-right 4) scroll to and double click

on the “Out” value.

Your selection expression should

appear as shown in the Expression window to the right. Remember to use the buttons on the menu to compose the

selection expression, e.g., the “Wet_type” = Out”. Typing in a selection via the keyboard is

possible, but it is easy to make mistakes which cause syntax

errors.

Click the select button near the lower right of the window.

This selects all the records in the file that have the “Out” code. The selected records

(rows) appear highlit in light blue (or the currently set selection color, if different) in the table, and the corresponding polygons are painted yellow in the data window.

Now toggle table editing on , and add a column

This will open a window requesting column characteristics. Name the field “Size”, select the Type as “Text” and change the Length to 10:

1

2

3

4

Page 20: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

20

Finally we need to change the value for the Size field. Left click on the right-most icon at the top of the table to open the Field Calculator

In the resultant window,

1) Make sure the box is checked only to update the selected feature(s) 2) Set to Update existing field, with the field set to Size

3) Type ‘Wisconsin’ surrounded by single quotes, in the expression window at bottom

Hit OK to apply.

1

2

1

3

Page 21: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

21

Your file should appear as below:

Now sort the file by the Area field (see a few paragraphs previously,

but set the triangle next to the label pointing up)

Open the Select by Expression window again, and enter the query

to select the areas between 200 and 3000, inclusive, as shown in

the bottom panel, at right. Left click on Select, Close

As before when identifying Wisconsin, open the Field Calculator and Update the “Size”

column, this time assign a value of ‘Small’ for the selected records.

Remember to use single quotes, ‘Small’ when entering the value in the Expression pane.

You can verify the selection

worked by looking at the table, scrolling down to the borders

of the selected set, either at an area of 200, or 3000:

Notice how the Size variables switches from our assigned

value of ‘Small’ to ‘NULL’ across the size Area threshold.

Page 22: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

22

You can also see the selected set in the displayed layer, here by zooming in to the

upper left corner, showing the selected set of polyogns in yellow, the current selection

color: It is a good idea to save your edits, by

clicking on the save edit button near the top left of your table window:

Select polygons that meet the criteria "AREA" > 3000 AND "AREA" <= 10000, and

Use to assign a value of ‘Medium’ in the Size field for these records.

Note the difference between < and <= in the endpoints of a range…you want to get the categories right. Repeat the process for "AREA" > 10000 AND "AREA" <= 5200000. Assign a value of

“Large” to the Size field for the selected records.

Finally, use the Select by Expression to select the polygon(s) with Wet_type = “U” and use the Field Calculator to change that record’s value in the Size field to “Uplands”.

Remember to save your edits, deselect any features (table window, this icon: ) then

close the table.

Go back to the table of contents in the main map window, right click on the still_wetU83 data layer, open the Properties - Style window.

Select Categorized, set the column to Size, and click on the

Classify button to add the

categories, to see something like:

As noted in an earlier lab, you can click on the individual patches to

change their symbology, or select and delete them.

Page 23: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

23

Map 3

Create a map to display the modified wetlands data layer, similar to that found below, add appropriate title, legend, scale

bar and north arrow; export as pdf.

Wetlands Tables

We’ll now assign a new column to identify general wetland types, based on recurrent selections. (Video: Wetland_By_Type)

Right click on Stil_wetU83 in the TOC, and left click on Open Attribute Table.

The field, or item, named “Wet_type” contains the wetland classification used by the US Fish and Wildlife Service. A complete list is found at the end of this lab exercise.

Close the table. Open the Properties > Styles window for the wetlands data.

Delete the current categories (Delete all button below the list)

Select Categorized– Wet_type for the symbology type, then the Classify button

Page 24: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

24

Left click on Apply and OK.

Your display should appear something like this:

Page 25: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

25

This figure displays far too many categories. From the zoom tool bar, left click on the

identify cursor

A left click on a polygon in the main

window will display a popup list of polygon attributes. You might have to drag/resize the window edges to

see both the labels and the values:

Examine (click on) a few polygons. The item Wet_type specifies the wetland class, as shown by the

code table at the end of the exercise.

For simplicity, we will aggregate wetland classes to a few main

categories. Readers can only distinguish a limited number of

colors or shades on a map. We will reclassify the detailed classes into five groups, aggregating the

detailed wetland types into their “parent” categories.

Note that there are several numbers and letters together in a string in the wetland type column, e.g., L1UBHh. These give the wetland System-Subsystem-Class-Subclass

and any modifiers, as described in the key at the back of this lab.

The first letter is for the system (L=Lacustrine, P=Palustrine, etc.), the second is for the subsystem (defined for each system) the third is for Class, etc. Your job is to add a system/subsystem column, with appropriate designators for each record. There are

many ways to do this; we’ll do this by modifying the tables.

The basic steps are 1) add a new field (also called a new item or column), 2) select the appropriate records, and 3) assign appropriate values to the new field for these selected records, 4) repeat steps 2 and 3 until all records are processed.

First, we’ll add a field.

Open the attribute table, open editing ,

Add a field with a name you can remember, something like “reclassed”, type text, width 10 or greater.

Page 26: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

26

Open the selection window .

You want to select all the types that begin with L. Since QGIS interprets texts as an

ordered list, if you select everything “Less than” the “biggest” L-value, you will

select all of them.

Do this by first selecting Wet_type in the fields and

then clicking the all unique button.

This lists all the

unique values for the Wet_type variable.

Now we need to select records to reclassify. You build a series of expression from the variables and operators in the “Select by expression window” shown above. Typically, you build and expression by selecting variables from Fields and Values from the Function list (e.g. Wet_type above), operators from the function

list or Operators bar (<, etc.), and values from the Field Values window. Double-left

click the field named Wet_type on the left, then single-left click the <= operator in the middle, and then double-click the “L1UBHhx” value on the right.

You then use the select button

to apply the expression, selecting values for attribute which

meet your criteria. Note that the < , <= or >= operators interpret text values ranked in alphabetical order,

with ‘a’ smaller than ‘x’, and uppercase smaller than lower case.

The expression in the example at right selects all polygons with Wet_type LIUBHhx or smaller, in this

case he L1UBH and L1UBHh.

If you don’t have a correct expression, a syntax error window may pop up. If so, clear the

To display the

actual values with in a field (such as ‘Wet_type’), left click

to highlight the item, then left click on the

all unique button. This will allow you to pick your selection

values from a complete list of data

values.

Page 27: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

27

expression and try again.

To convince yourself that this operation selected the records you want, click on the Move selected records to the top icon, found near the top-center of the Table

window, and shown below.

Click on the button to move the selected record to

the top, and you can scroll to verify your selection only contains records beginning with L1.

We wish to assign values to “reclassed” field, so left click on the Field Calculator at

the top-right of the table window.

Set the check boxes

to Update only the selected features

and

Update existing field Target the reclassed

variable by selecting it from the dropdown list

Set the output expression to

‘Lacustrine’, including the single quotes because it is

a text field

Then click OK to apply this calculation.

If you inspect the table, you should now see that the polygons (and only those

polygons) with a Wet_type beginning with “L1” now have a value of “Lacustrine” in the reclassed variable.

Page 28: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

28

Now repeat the process for the next group of items (those with “Wet_type” fields starting with “L2”). This is a bit

trickier because it is a compound selection, so we’ll have to use the AND

operation in building our formula. The example for “L2” is shown in the

figure to the right:

Be careful in including the appropriate single quotes, and not to omit spaces between operators.

Assign the value “Littoral” to the Reclassed field, using Field Calculator

as described above.

Repeat this selection/assignment to assign a value of “Palustrine” to the

reclassed column for all polygons with a Wet_type beginning with the letter “P”. Finally, assign a value of “Upland” to all of the Wet_types with a value of U. Inspect the table to verify that you now have five categories for the item named reclassed:

Lacustrine, Littoral, Palustrine, Upland, and OUT, and no null values. Next change your legend display item (TOC, PropertiesStyle) to your new Reclassed field.

Note the Field Calculator also has

fields and functions, similar to the Select by Expression window.

You can use these to build an expression that can be assigned to

the target column, e.g., to convert from square meters to square

miles, or calculate coordinates. In this exercise we simply assign

text values

Page 29: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

29

Finally, change the legend symbols used for the Reclassed field to colors and patterns that will display nicely.

Map 4

Produce a map (as a .pdf) of the wetland data. Use your system/subsystem categories for the legend. Color the upland (U) white or hollow and other polygons appropriately to allow users to distinguish each type of wetland or areas outside our area of study

(OUT). Remember to include a scale bar (coverage units are meters), North arrow, name, title, description,

legend, and a descriptive name to the legend heading.

To Turn In Four pdf maps:

1) population cities 2) St Croix shaded

relief 3) wetlands by size 4) wetlands by type

Page 30: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

30

WETLANDS AND DEEPWATER HABITATS CLASSIFICATION

Wetlands codes are typically a string of characters, each corresponding to an attribute in a

hierarchy. For example, a wetland might be labeled L1UBG, indicating it is a Lacustrine

(System, see below), Limnetic (Subsystem), Unconsolidated Bottom(Class), which is intermittently

exposed (modifier G in L1UBG, see modifiers at end of this list). There are at least two

shortened designators which may appear on wetlands maps,

U = Uplands, and

OUT = out of the mapped area

Below is the hierarchy.

SYSTEM SUBSYSTEM CLASS SUBCLASS

|- RB=Rock Bottom 1=Bedrock

| 2=Rubble

|

|- UB=Unconsolidated Bottom 1=Cobble-Gravel

| 2=Sand

| 3=Mud

| 4=Organic

|

|-- 1=LIMNETIC----|- AB=Aquatic Bed 1=Algal

| | 2=Aquatic Moss

| | 3=Rooted Vascular

| | 4=Floating

| | Vascular

| | 5=Unknown

| | Submergent

| | 6=Unknown Surface

| |

| |- OW=Open Water/Unknown Bottom (used on older

| maps)

L=LACUSTRINE----|

|

|

| |- RB=Rock Bottom 1=Bedrock

| | 2=Rubble

| |

| |- UB=Unconsolidated Bottom 1=Cobble-Gravel

| | 2=Sand

| | 3=Mud

| | 4=Organic

| |

| |- AB=Aquatic Bed 1=Algal

| | 2=Aquatic Moss

| | 3=Rooted Vascular

| | 4=Floating

|-- 2=LITTORAL----| Vascular

| 5=Unknown

| Submergent

| 6=Unknown Surface

|

|- RS=Rocky Shore 1=Bedrock

| 2=Rubble

|

|- US=Unconsolidated Shore 1=Cobble-Gravel

| 2=Sand

| 3=Mud

| 4=Organic

| 5=Vegetated

|

|- EM=Emergent 2=Nonpersistent

|

|- OW=Open Water/Unknown Bottom (used on older

maps)

Page 31: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

31

SYSTEM SUBSYSTEM CLASS SUBCLASS

|- RB=Rock Bottom 1=Bedrock

| 2=Rubble

|

|- UB=Unconsolidated Bottom 1=Cobble-Gravel

| 2=Sand

| 3=Mud

| 4=Organic

|

|- AB=Aquatic Bed 1=Algal

| 2=Aquatic Moss

| 3=Rooted Vascular

| 4=Floating

| Vascular

| 5=Unknown

| Submergent

| 6=Unknown Surface

|

|- US=Unconsolidated Shore 1=Cobble-Gravel

| 2=Sand

| 3=Mud

| 4=Organic

| 5=Vegetated

|

|- ML=Moss-Lichen 1=Moss

| 2=Lichen

|

P=PALUSTRINE----------------------|- EM=Emergent 1=Persistent

| 2=Nonpersistent

|

|- SS=Scrub-Shrub 1=Broad-Leaved

| Deciduous

| 2=Needle-Leaved

| Deciduous

| 3=Broad-Leaved

| Evergreen

| 4=Needle-Leaved

| Evergreen

| 5=Dead

| 6=Indeterminate

| Deciduous

| 7=Indeterminate

| Evergreen

|

|- FO=Forested 1=Broad-Leaved

| Deciduous

| 2=Needle-Leaved

| Deciduous

| 3=Broad-Leaved

| Evergreen

| 4=Needle-Leaved

| Evergreen

| 5=Dead

| 6=Indeterminate

| Deciduous

| 7=Indeterminate

| Evergreen

|

|- OW=Open Water/Unknown Bottom (used on older

maps)

Page 32: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

32

SYSTEM SUBSYSTEM CLASS SUBCLASS

|- RB=Rock Bottom 1=Bedrock

| 2=Rubble

|

|- UB=Unconsolidated Bottom 1=Cobble-Gravel

| 2=Sand

|--1=TIDAL--------| 3=Mud

| | 4=Organic

| |

| |-*SB=Streambed 1=Bedrock

| | 2=Rubble

| | 3=Cobble-Gravel

|--2=LOWER | 4=Sand

| PERENNIAL----| 5=Mud

| | 6=Organic

| | 7=Vegetated

| |

| |- AB=Aquatic Bed 1=Algal

R=RIVERINE------|--3=UPPER | 2=Aquatic Moss

| PERENNIAL----| 3=Rooted Vascular

| | 4=Floating

| | Vascular

| | 5=Unknown

| | Submergent

|--4=INTERMITTENT-| 6=Unknown Surface

| |

| |- RS=Rocky Shore 1=Bedrock

| | 2=Rubble

| |

| |- US=Unconsolidated Shore 1=Cobble-Gravel

|--5=UNKNOWN | 2=Sand

| PERENNIAL----| 3=Mud

(used on older | 4=Organic

maps) | 5=Vegetated

|

|-**EM=Emergent 2=Nonpersistent

|

|- OW=Open Water/Unknown Bottom (used on older

| maps)

|-*STREAMBED is limited to TIDAL and

| INTERMITTENT SUBSYSTEMS, and comprises

| the only CLASS in the INTERMITTENT SUBSYSTEM.

|

|-**EMERGENT is limited to TIDAL and LOWER

| PERENNIAL SUBSYSTEMS.

Page 33: Lab 6: DEMs, National Wetlands Inventory and Basic Table ... · GIS Fundamentals: Digital Data, Basic Tables Lab 6 2 Start QGIS and add the raster data set named nlcd_border.tif

GIS Fundamentals: Digital Data, Basic Tables Lab 6

33

MODIFIERS

|- A=Temporarily Flooded

|- B=Saturated

|- C=Seasonally Flooded

|- D=Seasonally Flooded/Well Drained

|- E=Seasonally Flooded/Saturated

|- F=Semipermanently Flooded

|--Non-Tidal------|- G=Intermittently Exposed

| |- H=Permanently Flooded

| |- J=Intermittently Flooded

| |- K=Artificially Flooded

| |- W=Intermittently Flooded/Temporary (used on

| | older maps)

| |- Y=Saturated/Semipermanent/Seasonal (used on

| | older maps)

| |- Z=Intermittently Exposed/Permanent (used on

| | older maps)

WATER REGIME----| |- U=Unknown

|

|

|

| |- K=Artificially Flooded

| |- L=Subtidal

| |- M=Irregularly Exposed

| |- N=Regularly Flooded

|--Tidal----------|- P=Irregularly Flooded

|-*S=Temporary-Tidal

|-*R=Seasonal-Tidal

|-*T=Semipermanent-Tidal

|-*V=Permanent-Tidal

|- U=Unknown

|

|-*These water regimes are only used in

| tidally influenced, freshwater systems.

|- 1=Hyperhaline

|- 2=Euhaline

|--Coastal |- 3=Mixohaline (Brackish)

| Halinity-------|- 4-Polyhaline

| |- 5=Mesohaline

| |- 6=Oligohaline

| |- 0=Fresh

|

|

WATER CHEMISTRY-|

| |- 7=Hypersaline

|--Inland |- 8=Eusaline

| Salinity-------|- 9=Mixosaline

| |- 0=Fresh

|

|

|

|--pH Modifiers |- a=Acid

for all |- t=Circumneutral

Fresh Water----|- i=Alkaline

SOIL------------------------------|- g=Organic

|- n=Mineral

|- b=Beaver

|- d=Partially Drained/Ditched

SPECIAL MODIFIERS-----------------|- f=Farmed

|- h=Diked/Impounded

|- r=Artificial Substrate