top of page
Search

Attribute Queries

  • Writer: Charles Frey
    Charles Frey
  • Feb 4, 2023
  • 3 min read

Finding Your Data

In this tutorial, you are becoming a GIS freelancer who has been hired by a textbook publisher to create a map of the border between North Korea and South Korea during the Korean war. Fortunately for you, the hard work of creating historical boundary data has already been done with the CShape dataset. This tutorial will show you how to use attribute queries to filter the boundaries to a specific date in the past, and then further refine to just the two Korean countries.

1. Visit ETH Zurich’s International Conflict Research website for the CShapes download. Download the data as a shapefile.


2. Extract the data into the location of your choice.


3. Open ArcGIS Pro, and create a new project. Add a new map.


4. When the map opens, click “Add Data” and open the cshapes.shp that you extracted.


Filtering Data

You should now see a shapefile of almost all countries. This shapefile contains almost all border changes going back to 1886! We want to find just the borders that were current to after the spilt of Korea. That’s means there’s a lot of polygons that we don’t need. This is where we can use Attribute queries. Attribute queries are one of the most powerful tools we harness as GIS professionals. They let us easily sort through our data, and filter to just what we desire. They have a wide array of functions and can be performed in ArcGIS through multiple mediums, for this is example we will use the Point and Click editor.


5. Right click the CShapes shapefile in the contents pane and click “Attribute Table”. (Hint: You can also you the shortcut Ctrl-T)


6. Examine the attribute table. We will need to filter data from three columns. “cntry_name” for country names, “gwsdate” for the day the particular polygon began and “gwedate” for the date each country ends.


7. On your ribbon, click “Select By Attributes”. Make sure your “Selection Type” is a “New selection”.


8. For the first clause select “gwsdate” as the field, use the “is before” operator. Enter in the date 1/1/1950 in the last box.


9. For our second clause select “gwedate” as the field, use the “is after operator”. Enter 1/1/1950 as the date again. Your window should match the picture shown.


10. To see what another method for attribute queries looks like in ArcGIS toggle the “SQL” switch. Untoggle the switch, and click “apply” to complete the selection. 172 Records should be selected.


11. To create a new layer from our query, right click the CShapes layer in the contents, expand the “Selection” category and click “Make Layer from Selected Features”.


12. Rename the new layer to “countries-1950”. You can remove, or hide the original CShapes layer.


13. Examine your new attribute table, at the bottom you should see “0 of 172 selected”. Let’s pair this down further.


14. Open the “Select By Attributes” pane again. This time select the field “cntry_name”. Use the “contains the text” operator and type in “Korea” for the last box. Your pane should like the picture below.



15. Apply the selection, and notice that 2 records should be selected. Repeat the steps from step 11 to make a new layer, this time naming it “korea-1950”.


16. Right click the new layer, and press “Zoom To Layer” to examine the polygons.


Delivering Your Map

Now you’re ready to make your map for the textbook! Add a new layout and begin working. Be sure to add map essentials like a scale bar, neatline, north arrow, legend, and proper labels. Remember, you’re the cartographer so feel free to make this map your own.

 
 
 

Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.

Call

+1 608-205-8285

Write

bottom of page