<<

Intro to GIS Exercise 7 – Importing tables / creating feature classes from tabular data / Joining tables IUP Spring 2017 – Dr. Hoch

Creating spatial datasets for use in a GIS from tabular data is a very common task. Also, ‘joining’ tables together based on a common field is also very common. This exercise will demonstrate by example how to perform these very common, but important, tasks.

In this exercise we will:

 Import a table into our workspace as a feature class by assigning values in the table as ‘X’ and ‘Y’  Create a new shapefile using an excel worksheet (csv file format)  ‘Join’ the attributes from another table with our shapefile  Create a query to make a selecting by attribute from the linked table

Background:

It is very common that useful data will arrive to you in some form of database file or spreadsheet. As long as there are fields (columns of data) that have X and Y coordinates, you can import the table into ArcGIS via Catalog and create a feature class out of it, assigning the X and Y to and , respectively.

Notice here that I assigned X to longitude and Y to latitude. Why? In our everyday language we seem to identify the X axis with latitude and the Y axis with longitude. BUT IT IS THE OTHER WAY AROUND. This is a very common mix‐ up. Let me explain: Since the X‐axis is along the ‘bottom’ of our coordinate geometry, we

often incorrectly assume that:

‘X’ is latitude (lines of latitude go around the horizontally)

and we assume that: Y axis

‘Y’ is longitude (lines of longitude go around the earth vertically). This axis

measures However, this is incorrect. Let’s think about why. lines across the graph

0 X axis This axis measures lines across the graph

While the X‐axis is laying flat in the graph above, it is actually measuring lines of longitude along this axis, starting from the origin point (0), and moving ‘’.

The same logic is true for the Y‐axis. While the Y‐axis is vertical in the graph above, it is actually measuring lines of latitude along this axis, starting from the origin (0) and

moving ‘’.

Scenario: It has been brought to your attention that an important theme to be mapped in the Two Lick Creek Watershed Plan is the PA DEP permitted of Marcellus shale gas wells. The PA DEP now provides this as a shapefile in the PASDA NSDI portal. However, you will import from a comma delimited (csv) file format, then ‘link’ the table to another table that has the attributes of each well. There are two files. Both are csv files – one is the lat and long, the other is an attribute table of the wells. Bring these into your workspace by copying and pasting. Where will you put them in your catalog tree? (don’t be a messy file‐keeper!)

Download the ‘xlsx’ and ‘csv’ files for Exercise 7 from the website. Put these files in the appropriate folder in your workspace.

You will make a feature class from the Indiana_GasWells_UandC_2014_04.csv file, and will link the ‘Indiana_GasWells_UandC_201_04_attributes.csv’ file to the shapefile you will make from the first csv file.

To make a feature class/shapefile from the csv file, simply right click on the file in catalog and go to ‘create feature class. A window called ‘Create Feature Class from XY Table’ should appear. Now, in the ‘Input Fields’ section you will choose which fields to represent the ‘X’ and the ‘Y’ from the table. This is not a 3‐dimensional dataset, so don’t worry about the ‘Z’ value. Be sure to save as shapefile!

Then click the ‘Coordinate System of Input Coordinates’ button. From here, we select: GCS_North_American_1983.

That means you must select from a predefined coordinate system; ‘GCS’ stands for Geographic Coordinate System, so that’s and easy one… seems like North America is also an easy one… and the only thing that is simply ‘1983’ is the “NAD 1983.prj” choice. Choose this one. (.prj is a ‘projection’ file). So, I’ve helped you determine which coordinate system to choose – I want you to tell me how I knew this?

Now you can bring the .shp file into your TOC. It may ask if you. It should look something like this:

Once this shapefile is in your TOC, ArcGIS 10 makes joining tables easy. Simply right click on the text in the TOC and go to ‘Joins and relates’. You are going to ‘join’ the attribute table from the shapefile you just created with another file of tabular data based on a common field in both files (in this case it is ‘PERMIT_NUM’).

You may run into some problems with conflicting characters in one or the other files – use the ‘verify’ button to help guide you through.

Once you have done joined the table to the shapefile, when you look at the right side of the attribute table you will see that the information from the csv table has been added to the attribute table based on the unique identifier of ‘PERMIT_NUM’.

Now you can categorize and display the data based on these new fields in the shapefile attribute table.

DELIVERABLE: Your task is to build a query to make a map that shows the following things:

1. Shale gas wells (unconventional) in the TLC watershed that are active, and 2. Shallow gas wells (conventional) in the TLC watershed that are abandoned, and 3. Labels that indicate the operator of each unconventional well within the TLC watershed

HINT: You will select from the field/column “UNCNV_IND” (unconventional indicator) to select ‘unconventional’ or‘conventional’ [Unconventional = Y and Conventional = No]

ANOTHER HINT: You will select from “WELL_STAT” (well status) to select ‘active’ or ‘abandoned’

AND ANOTHER HINT: Right‐clicking and using the ‘Label features’ tool may be helpful for some tasks.