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

Week 7: Investigating Earthquake Activity

top of page

Getting to Know Spatial Querying in ARCGIS

So far in this course, you have practiced querying, classifying, and symbolizing data. All of these efforts helped you to sort and organize the data displayed on the map so that you could look for relationships and patterns in data. Now you will use spatial and database querying to sift out even more details about the earthquake events of 2009.

top of page

Launch ARCGIS and Open the Earthquakes Project

Shortcut1
37 Intro Map




top of page

Add Earthquake Data From 2009

If you worked through the "Introduction to Mapping Tabular Data" section, then you can use the Add Data button to bring up the previously mapped earthquake data. Otherwise, you'll need to use Add XY Data to map the 2009 earthquakes.

Choose ONE of the following two options to add 2009 earthquake data to the map.
  1. top of page

    Add 2009 earthquake data as a shapefile

    • Click the Add Data button 5205 Add Data Button .
    • Navigate to the csv_files folder. (Path: C:/eyesinthesky2/week7/EarthquakesAM/csv_files)
    • Choose the 2009EQ.shp shapefile that was automatically created and saved in the previous section.
    • Click OK.
  2. top of page

    Map 2009 tabular earthquake data by longitude and latitude coordinates

  3. To map the 2009 earthquake events using Longitude and Latitude coordinates:

    • Choose Tools > Add XY Data to open the Add XY Data window.
    • Click the Browse 32 Browse Button button and navigate to the file named 2009EQ.csv. (Path: C:/eyesinthesky2/week7/EarthquakesAM/csv_files).
    • Choose the 2009EQ.csv file and click OK.
    • Choose Longitude for the X Field and Latitude for the Y Field.
    • Click OK.
    1. Select Tools > Add XY Data.
      39 Add XY Pulldown

    2. The data file is in the csv_files folder within the EarthquakeAM data folder. Click the Browse 32 Browse Button button.
      41 Add XY Data Browse Button
    3. Navigate to the csv_files folder within the EarthquakeAM data folder.
      42 Add XY Navigate to CSV Folder
    4. Choose the file named 2009EQ.csv. Click Add.
      40 Navigate to CSV File
    5. In the Add XY Data window, define the coordinates.
      • Table: C:/eyesinthesky2/week7/EarthquakesAM/csv_files/2009EQ.csv
      • X field: Longitude
      • Y field: Latitude
      • Click OK.
      • Click OK on the Table Does Not Have Object ID popup window.
      8 Table does Not Have Object ID

top of page

Convert XY Data to Shapefile


To get full functionality from your XY points, it is necessary to convert your XY point (event) layers to shapefiles. It is a simple two step process.

The 2009 Earthquakes will now be displayed on the map.

45 2009 EQ on the Map


top of page

Think Spatially about Earthquake Data

Begin by brainstorming questions that could be asked when thinking spatially about earthquakes. Some examples of questions you might ask:

top of page

Carry Out a Simple Spatial Query

On September 30, 2009 a Magnitude 7.5 earthquake struck Sumatra, Indonesia. The quake originated at a moderate depth of 81 kilometers. At the surface, over 1100 people were killed and 2650 buildings were damaged in the earthquake and subsequent landslides. Power and communications were disrupted. The earthquake was felt over a wide area and produced a small tsunami.

Imagine that you worked for an international disaster aid organization, and wanted to quickly identify Indonesian cities that might have been close enough to the quake to need your help.

top of page

Select the Sumatra earthquake

The map will zoom to center on the highlighted Sumatra earthquake.

  1. Turn on the 2009EQ layer.
  2. Use a query to locate the Sumatra earthquake:
    • Click the Selection > Select by Attributes menu
      46 Select by Att Pulldown with Map .
    • In the Select by Attributes window, set up the following equation:
      (Month = 9) and (Day = 30) and (Magnitude = 7.5).
    • 50 Selected by Att Mag 75 Month 9
    • Click the Apply button. Move the Select by Attributes window aside and adjust your query as necessary if you don't get the desired results. When you are satisfied, click OK.

    • 51 Map with Selection

  3. Right click the 2009EQ layer, Selection and then Zoom to Selected Features options in the context menu.

  4. 47 Zoom to Selected Features
  5. The map will zoom to center on the highlighted Sumatra earthquake.

  6. 52 Map Zoomed to Sumatra Selection

top of page

Use the results to answer a spatial question

Now, you'll go back to your original scenario of identifying major Indonesian cities that might be affected by the earthquake. To do this, you will add a world cities layer and use the menu option to select any cities within different distances of the Sumatra earthquake.

  1. Click the Add Data button 5205 Add Data Button . Navigate up one level to the EarthquakesAM folder, select cities.shp, and click OK.
  2. 53 Add Cities
  3. Right-click the cities layer and open the Properties window. Symbolize the cities as 8 point red squares and close the Properties window.
  4. 54 Symbol Selector Cities Red Squares
  5. Click on the Selections > Select by Location menu option. In the Select by Location window, select the options to query "Cities" "Within a Distance of" "2009EQ". Put a check in the Use Selected Features box. (This will use the selected Sumatra earthquake in this query) Check the box to Apply a Buffer to Features 2009EQ option. Fill in Buffer Distance box to 600 and the Buffer Units to Miles.
  6. 55 Select by Location 600 Miles
  7. Click the Apply button. The cities within the buffer zone of 600 miles should be highlighted. Keep the Buffer window open and move it aside to look at the selected cities.
  8. Right-click the cities layer and open the Attribute Table. Look at the bottom of the table to find out how many cities were selected. In this case, 30 cities were selected.
  9. In the Select by Location window, change the Buffer Distance and repeat the procedure for 100 miles and again for 300 miles. (You can move back and forth between the Attribute Table, Select by Location, and the Map by clicking on the title bars of each one or moving them to the side if you have a large enough screen.)

  • Distance within 100 miles - 1 city is selected
  • Distance within 300 miles - 8 cities are selected
  • Distance within 600 miles - 30 cities are selected

Movie Icon

Click on the movie to start playing.

loading the player

Before going on, you'll need to clean house a little:

top of page

Carry Out a Containment Query

A containment query finds all the features within a given boundary, such as all of the Tamarix plants in the State of Arizona or all of the lakes in Canada.

How would you select all the earthquakes in a given country? For example, say you wanted to find all the earthquakes in Chile.

top of page

Locate and select Chile

You'll use the Find tool to locate and highlight Chile.


Use the Find tool to locate and highlight Chile.

  1. Click the Find tool 5211 Find Button to open the Find window.
  2. In the In field choose Countries and enter Chile in the Find field.
  3. 56 Find Chile
  4. Click the Find button. One record (Chile) should now appear in the Find Results box.

  5. 57 Chile One Entry Found
  6. At the bottom of the Find window, right click Chile and Select and Zoom To. The map should zoom to Chile, which should be highlighted blue.
  7. 59 Find Selection 58 Find Right Click and Zoom
  8. Close the Find window. The map should now look like this, zoomed in on Chile with the country highlighted blue.
  9. 60 Chile Selected and Zoomed


top of page

Set a buffer to select all the earthquakes within Chile

Now you will use the Select by Location menu option to select the 2009 earthquakes that occurred in (or very near to) Chile:

  1. Click the Selection > Select by Location menu option to open the Select by Location window.
  2. In the Select by Location window, select the options to query "2009EQ" "Within a Distance of" "Countries". Put a check in the Use Selected Features box. (This will use the selected country of Chile in this query) Check the box to Apply a Buffer to Features in Countries option. Fill in Buffer Distance box to 1 and the Buffer Units to Miles.
  3. Click the Apply button. The 2009 earthquakes that occurred in or within 1 mile of Chile will now be highlighted on your map.
  4. Close the Select by Location window.

top of page

Show the results of the spatial query

  1. Right-click the 2009EQ layer and open the layer's Attribute Table. Look down at the bottom of the attribute table. The selected records are highlighted in blue. How many records were selected?
  2. Result: 190 earthquakes are selected. (Hint: Look at the bottom of the attribute table window for the total number of records selected.)

    62 Attribute Table Chile EQ

  3. Click on the Selected button at the bottom of the attribute table. Only the earthquake records from Chile will be displayed in the table.
  4. The 2009EQ attribute table sorted with the selected records grouped at the top.

    63 Attribute Table Chile Selected EQ Only
Movie Icon

Click on the movie to start playing.

loading the player

Time to do housecleaning again before the final spatial query:



top of page

Carry Out a Proximity Query

Proximity is how close one object is to another object. In this case you will learn how to find all the earthquakes that are within a set distance of a given type of plate boundary.

top of page

Select features of interest (transform boundaries)

  1. Click and drag the 2009 EQ layer below the bounds(Plate Boundaries) layer in the Table of Contents.
  2. Turn on the bounds layer.
  3. Click the Selection> Select by Attributes menu option. Set up a database query to select the Transform boundaries.
    (MARGIN_TYP = 'Transform' )

  4. Close the Select by Attributes window.

top of page

Set the buffer distance to select earthquakes that are within a specified distance

  1. Click the Select > Select by Location button menu option to open the Select by Location window.
  2. In the Select by Location window, select the options to query "2009EQ" "Within a Distance of" "bounds". Put a check in the Use Selected Features box. (This will use the selected transform plate boundaries (bounds) in this query) Check the box to Apply a Buffer to Features in bounds option. Fill in Buffer Distance box to 50 and the Buffer Units to Miles.
  3. Click the Apply button. The 2009 earthquakes that occurred in or within 50 miles of transform plate boundaries will now be highlighted on your map.
top of page

Show the results of the spatial query

  1. Right-click the 2009EQ layer and open the layer's Attribute Table. Look down at the bottom of the Attribute Table. The selected records are highlighted in blue. How many records were selected?
  2. Result: 658 earthquakes were within 50 miles of a Transform boundary. (Hint: Look at the bottom of the attribute table window for the total number of records selected.)

    66 Attribute Table with Transform EQ

  3. Click on the Selected button at the bottom of the attribute table. Only the records for earthquakes within 50 miles of a transform boundary will be displayed in the table.
  4. The 2009EQ attribute table with only the selected records displayed.

    67 Attribute Table with Trans EQ Selected

Movie Icon

Click on the movie to start playing.

loading the player

top of page

Create and Explore More Spatial Queries

Practice spatial queries using combinations of select features, buffering, and database queries
Try the following:
  1. Use the earthquakes layer and the Latitude and Longitude lines on the map to answer the question:
    Find all the earthquakes in the Northern Hemisphere.
    1. Use the Select feature tool to drag a rectangular selection around the Northern Hemisphere. The Northern hemisphere will be highlighted blue.
    2. Click the Selection > Select by Location menu option, set the buffer distance to 1 mile, and use the buffer to select the 2009 earthquakes from within this containment.
    3. Open the earthquakes Attribute Table. We got 4227 earthquakes selected, but your number may vary depending on where you defined the Northern Hemisphere.

  2. Use the earthquakes layer and a database query to answer the question:
    Find all the earthquakes of a Magnitude greater than 7.
    1. Click the Selection > Select by Attributes menu option to open the Select by Attributes window.
    2. Set up the following query statement: (Magnitude >= 7.0 ).
    3. Click the Apply button.
    4. Open the earthquakes Attribute Table. We got 17 earthquakes of magnitude 7 or higher.

  3. Use the earthquakes layer and a database query to answer the question:
    Find all the deep earthquakes.
    1. Click the Selection > Select by Attributes menu option to open the Select by Attributes window.
    2. Set up the following query statement: (Depth > 400 ).
    3. Click the Apply button.
    4. Open the earthquakes Attribute Table. We got 234 earthquakes deeper than 400 km.

  4. Use the earthquakes layer and the plate boundaries layer to answer the question:
    How many earthquakes are there at each of the boundary types?
    1. Repeat the given in the example above, but change the initial data base query to (MARGIN_TYP = 'Convergent' ) and (MARGIN_TYP = 'Divergent').
    2. Result: 2708 earthquakes were within 50 miles of a Convergent boundary; 902 earthquakes within 50 miles of a Divergent boundary; and 657 earthquakes within 50 miles of a Transform boundary.

  5. Use the earthquakes layer and the cities layer to answer the question:
    How many National Capital cities were within 20 miles of an earthquake in 2009?
    1. Add the Cities layer from the EarthquakesAM folder.
    2. Open the Attribute Table, take a look at the Status Field.
    3. Set up and execute the database query ((STATUS = 'National and provincial capital') or (STATUS = 'National capital')). Recall that in queries, "or" is more inclusive than "and", so both of these types will be selected. Result: 214 cities are selected in this query.
    4. Click the Select > Select by Location menu option, set the buffer distance to 20 miles. Use the buffer to select features from the 2009EQ layer.
    5. 32 earthquakes are selected pretty impressive.


top of page

Build Your Own Spatial Query and Take a Screenshot

Set up and execute a spatial query of interest to you. Use the data in the project folder or add another "add event theme dataset" from the folder provided and use the new layers to complete a spatial query. Add other layers of interest to your map and symbolize the layers.

Take a screenshot. Post this screenshot along with a description of the layers you used and the query you made. This is the screenshot that is needed for your required weekly activity.

The EarthquakeAM folder includes many datasets to explore that don't follow the seismology theme. Here are just a few of the possible combinations there are many more!


top of page

Explore More If You Have Time

Take the time to read more about the additional event theme data sets on the website links where they were downloaded from. The following PDF contains more information (Acrobat (PDF) 48kB Mar25 10) and links to the data sets.

top of page

Resources


Sumatra Earthquake Information
top of page

Movies on this Page

top of page

How to download movies

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 Performing a Spatial Query in ArcGIS

Movie Icon Performing a Containment Query in ArcGIS

Movie Icon Performing a Proximity Query in ArcGIS

top of page

iPod Versions

Download these version to play on your iPod or iPhone.

Movie Icon Performing a Spatial Query in ArcGIS

Movie Icon Performing a Containment Query in ArcGIS

Movie Icon Performing a Proximity Query in ArcGIS


« Previous Page      Next Page »