Eyes in the Sky II > GIT Web Course > Module 2 > Week 5 > Getting to Know Querying in GIS > Getting to Know Querying in ArcGIS

Week 5: Monitoring Invasive Species

Getting to Know Querying in ArcGIS

Learn to create and execute GIS database queries to investigate the spread of zebra mussels.

top of page

Launch ArcGIS, Open the Invasive Species Project File, and Add a New Layer

Shortcut1

  • Launch ArcGIS by double-clicking its icon on your desktop or by clicking its icon in the Start > All Programs > ArcGIS > ArcMap.
  • 5201 Start Program
  • A startup window opens and asks if you want to start from an empty interface or a past project. Choose the New Empty Interface radio button.
  • 5203 ArcMap Start Screen
  • On the tool bar usually at the top of the interface, click on the File > Open, navigate to your C:\\EyesInTheSky2\Week5 folder and select the file inv_spc.mxd. Then click Open.
  • Add a new layer to show the sightings of the invasive Zebra Mussels. Click the Add Data 5205 Add Data Button button. Navigate to the invasive_speciesAM folder. Click once on zebra_mussel.shp to select it. Then click Add.
  • zebra_mussel should now be the top layer on your map. Notice that the layer is automatically turned on when it is added.
    In this view, the zebra mussel layer has been added. It is colored dark maroon, your color may be different. For now, don't worry about color!
    5207 MapW Zebra Mussels
Movie Icon

Click Add Data to open up the movie in a new window at the SERC media library. Click its name to play it. Close the window when you are done.

loading the player

top of page
Zebra mussels; Dreissenna Polymorpha

Zebra mussels are small shellfish named for the striped color of their shells. They typically attach to objects by threads on their shells. The zebra mussel is native to the Black, Caspian, and Azoz Seas. They were first described in Europe, by Pallas, in 1769.

small zebra mussel image Zebra Mussel

Zebra mussels were first discovered in the Great Lakes of North America in 1988. It is likely that their introduction was due to a ballast exchange from a cargo ship. By 1990 they had spread rapidly to all of the Great Lakes. Soon thereafter they escaped to the Illinois and Hudson Rivers, eventually moving into the Mississippi River system. By 2008, Zebra Mussels had spread across the United States, all the way to California.

Zebra mussels are a significant invader because they can spread both in and out of the water. In their freshwater habitat they can disperse in all life stages. They are prolific biofouling agents and therefore have profound effects on water supply pipes, including nuclear power plant cooling intake pipes. Not only do they damage man made structures, they are disruptive to entire food webs. Zebra mussels primarily consume phytoplankton. Additionally, they consume other suspended materials in the water column. Consequently, areas with dense invasions of zebra mussels have unusually transparent water. In fact, during the invasion of zebra mussels in Saginaw Bay, Michigan the sampling areas experienced a 60-70% reduction in Chlorophyll –a concentrations.

top of page

Adjust the Layers and Zoom in to the Zebra Mussel layer

  • Turn on the US States and US Rivers layers.
    The US States and US Rivers layers are on.
    5208 Map Mussels Rivers States
  • Right click on US Rivers in the Table of Contents and click on Zoom To Layer. 5209 Map Zoom to Rivers

    1. This map is the result.
      5210 Map Zoomed to Rivers
  • Right click the zebra_mussel layer in order to zoom to the current extent of the zebra mussel invasion.
    The map shows the extent of the zebra mussel invasion in the United States as of 2008.

    5209 Map Zoom to Mussels
top of page

Find A Feature By Its Attributes

The Find tool 5211 Find Button is a quick way to locate a feature. However, this type of search works best if you know how to spell, and capitalize, what you are looking for.
top of page

Find the zebra mussels in Ohio.

  • Right-click on the zebra mussel label in the Table of Contents. Then select Open Attribute Table. Spend some time looking through the fields and data records that are in the table. Use the scroll bars to move up and down and across the table. Look carefully at the State abbreviations.

    Here is the attribute table of the zebra mussel layer before scrolling.
    5212 ZebraMussel Table

    Here is the attribute table scrolled across.
    5213 zebra mussel table scrolled

  • Close the Attribute Table.
  • Click on the Find 5211 Find Button tool. When the Find window opens, move it so you can see the both the map and the window.

  • The Find window is positioned over the Western United States.
    5214 Find Box Open
  • In the window that pops up, on the Features tab, type in the name of the abbreviation for the State of Ohio, OH in the Find: box..
  • Select zebra_mussel from the "In:" list of Layers to Search. Click Find to search for the features in the layer that have "OH" as an attribute.
    In the Find box, type in the name of the abbreviation for the State of Ohio, OH. Then select zebra_mussel from the list of Layers to Search. Click Find to search for the features in the layer that have "OH" as an attribute.
    5215 Find Box Filled Out

  • In the results section of the Find window, 198 records have been located. The first result is highlighted. Click a row to make the record flash. Right click to select the zebra mussel record and highlight it in blue on the map.
    1. In the results section of the Find window, 198 records have been located.
      5216 Find Box Results
    2. Click the first entry in the results box at the bottom of the find menu. Notice two cross hairs flash on your feature in the map. Watch carefully, it is easy to miss!
      5217 Flash on find results
    3. Right click on the Find result this time and a menu of options will open. Click on the select option so that the site turns blue on your map. Remember that you have to move the Find window to see the result.
      5218 Multi Select Find Box results
  • Click on other records in the list of results and watch the blue dot move around on the map.
  • To select a group of records, hold the shift key down while clicking on results in the Find window.
    Three records are selected in the Find window and are also highlighted blue dots on the map.

    5219 Select Find box results
  • When you are done, click the Clear Selection button (in the toolbar area) 5220 Clear Selected Button to clear all selections from the map.
top of page

Find the US State of Ohio.

  • In the Find window, select US States in the list of Layers to Search. Click Find to search for the features in the layer that have 'Ohio' as an attribute. Click Select to highlight the 'Ohio' record.
    1. Right click and Select Ohio so it is highlighted in blue on the map. Right click the result again and Pan To Ohio.
      5223 Pan to Ohio


  • Close the find window and you should see Ohio centered in your map view.
    5224 Ohio Centered

  • Experiment with using the Find 5211 Find Button tool to locate other States or other information listed in the attribute tables for Zebra Mussels, US Rivers or US States. When you are done, click the Clear Selections button 5220 Clear Selected Button to reset the map.
  • Close the Find window.
Movie Icon

Find Tool Video

loading the player

top of page

Question a Database with Select by Attribute

Another way to find features, especially for larger or more complex searches is to Select by Attribute (This is the same concept as the Database Query in AEJEE).

top of page

Find all the zebra mussels sighted in the year 1988.

  • Click the Selection > Select by Attributes. A new window opens. Move it where you can see both the Select by Attributes window and the map.
    1. Click the Selection > Select by Attributes. 5225 Select by Attributes
    2. A new window opens. Move it to where you can see both the Select by Attributes and the map.
      5226 Select by Attributes pop up window
  • In the Select by Attributes window double click the field YEAR then click the "equals" sign. Finally choose the Get Unique Value button and double click 1988. You can also type in this equation ("Year"=1988) into the box in the middle window ArcGIS. Click OK and five records should be selected on the map. 1988 by clicking once on it. You can also type in this equation ("YEAR" = '1988') into the box in the middle of the window. Click Apply. Five records are selected on the map.
    To see these records in the attribute table, right click on the layer name in the Table of Contents and choose Selection > Open Table Showing Selected Features.
    1. Click the Clear Selected Features button.
    2. Repeat this process with several other years clearing selections between investigations.
top of page

Find all the zebra mussel records from New York, NY.

  • In the Select by Attributes window, double click the field STATE, then the "equals" sign, and then click once on the Value: 'NY'. You can also type in this equation ("STATE" = 'NY') into the box in the middle of the window. Click Apply. 427 records have been selected and are highlighted in blue on the map. Click the image to view a larger version.
    5229 NY mussels
  • Click Clear Selection to clear Select By Attributes.
  • Repeat this process with several other States.
  • Click Clear Selection to clear results from the Select By Attributes.
top of page

Put these two queries together to find all the zebra mussel records in the state of New York in the year 2005.

  • Double Click the field STATE, then click once on the "equals" sign, and then double click on NY. Click the button "and". Then start the second half of the equation with YEAR equals 2005. Click Apply.
  • You should have 1 record from 2005. How did you do?
    The equation is ("STATE" = 'NY') and ("YEAR" = 2005).
    Note: the "and" is outside of the parenthesis. Querying is like setting up math equations or writing sentences. If you are confused, try reading your query out loud and see if it makes sense. This one reads "Show me the records whose State is New York and whose Year is 2005."
    5230 NY mussels in 2005
    This image shows the query results and the map. There is one dot in NY. Click on the image for a larger view.
    5231 Map Mussels NY05

top of page

Set up a query to find a set of zebra mussels within the date range between 1997 and 2000.

  • The logic of the query is, "Show me the zebra mussel records from after 1996 but before 2001."
    The equation is ("Year" > 1996) and ("Year" < 2001) This image shows the query results and the map. 808 records match the query and are highlighted in blue on the map. Click the image for a larger view.
    5232 Mussels 97 - 01
top of page

See how the zebra mussel invasion progressed over time

In the Select by Attributes window, select groups of YEARS with the less than operator.
  • Execute the first query, with the equation ("YEAR" < 1989). Then change the equation to ("YEAR" < 1990). Continue moving through the years to follow the invasion.
    The equation ("Year" < 1989) produces 5 results highlighted in blue on the map.
    5233 Mussels pre 89
  • How many zebra mussels had been documented by the end of 1988? 1990? 1999?
    The equation ("YEAR" < 1989) shows that 5 zebra mussels were documented by the end of 1988.
    The equation ("YEAR" < 1990) shows that 20 zebra mussels were documented by the end of 1989.
    The equation ("YEAR" < 2000) shows that 2354 zebra mussels were documented by the end of 1999.
Movie Icon
Query Builder Video
loading the player

top of page

Create and Explore More Database Queries

Practice querying using combinations of set (<, >, =) and Boolean operators (And, Or, Not, etc.)

Try the following:

  1. Use the zebra mussel layer to answer the question:
    Where are the zebra mussels that are in Ashtabula County AND Ohio?
    The equation is: ("COUNTY" = 'Ashtabula') and ("STATE" = 'OH')
    The result of this query is 3.
  2. Substitute OR in the equation above with the zebra mussel layer:
    ("COUNTY" = 'Ashtabula') or ("STATE" = 'OH')
    This query yields 95 records because it gives you BOTH records that are either in the county of Ashtabula or that are in the State of Ohio. The expression "OR" is more inclusive than the operator "AND".
  3. In the US Rivers layer, try this equation that combines both set and Boolean algebra.
    ("SYSTEM" = 'Mississippi') and ("LENGTHCOMP" >= 1361.4323989)
    What question does this query answer?
    What rivers in the Mississippi River system have a length greater than or equal to 1361.4323989?
    Six rivers are selected.
  4. The US States layer has interesting data to practice with.
    What happens when you enter this expression?
    not ("STATENAME" = 'Texas')
    The query shows all the US States other than Texas. The result is listed as 50 States because the District of Columbia is included as a state.
  5. Try this equation with the US States layer:
    ("POPULATION" >= 1211537) and ("MEDIANAGE" <= 35.0)
    What question does this query answer?
    What states have a population greater than 1211537 and a median age less than or equal to 35?
    Twelve states are selected.
  6. The wildcard symbol % combined with the expression LIKE allows you to set up a query that is a bit more open ended. Enter this equation in the Select by Attributes in the US States layer:
    ("STATENAME" like 'A%')
    What result do you get and why?
    This query returns four states: AZ, AL, AR and AK. They are all the States that start with the letter A.
top of page

Build Your Own Database Query and Take a Screenshot

Design and execute a query of interest to you or that you might use in your teaching. Here are a few suggestions.
  • Try selecting the US Rivers, by Name, Length or System.
  • Select a Lake or River in your State.
  • Select your own State.
  • Select and combine attributes from the US States layer such as population, number of farms, crop acreage or other demographic data.

Once you have built and executed a query, take a screenshot of the map and the Select by Attribute window. In your discussion group, post the question you asked, the equation you used, and the result of your query along with the screenshot. This is the screenshot that is needed for your required weekly activity.

Follow the instructions below to make a screen shot:

  • On a Windows computer, press Alt and Printscreen at the same time. This will save an image of the screen to the computer's clipboard. Launch Paint and choose Edit > Paste.Save the image as a jpeg, giving it a name that describes it, such as River_query.jpg.

  • Alternatively you can open ImageJand choose your File > New > System Clipboard. To open your screen shot, then use the File > Save as > .jpegto make a copy..
top of page

Explore More If You Have Time

  • Explore the Attribute Tables of other layers in the map to see the rich assortment of data that can be found in a GIS.
  • Set up database queries that might interest you or your students.
  • Use Add Layer 5205 Add Data Button button to add other data layers that are a part of this or other weeks lessons and investigate these layers.
top of page

Resources

top of page

Movies on this Page

top of page

How to download movies

  • Click the link to go to the SERC media library listing for the movie. The record will open in a new window.
  • On the SERC media library page, right-click (Win) or control-click (Mac) the link (below the movie on the Flash version pages) to download the movie file to your hard drive.
  • Look below the movie window for the file download link.

    Save Movie from CMS listing

top of page

Flash Video Versions

Download these versions to play on your computer. You'll need an appropriate movie player to view the file, such as Flash Player, Real Player (Mac / Win), or Adobe Media Player.

Movie Icon Adding Layers ArcGIS

Movie Icon Find Tool ArcGIS

Movie Icon Query Builder ArcGIS

top of page

iPod Versions

Download these version to play on your iPod or iPhone.

Movie Icon Adding Layers ArcGIS

Movie Icon Find Tool ArcGIS

Movie Icon Query Builder ArcGIS