You are on page 1of 11

General Guide to Environmental Data and ArcGIS

For ENVR468: Fall 2013

TOPICS

1) Downloading Data from Internet Sources


a. USGS Water Database
b. EPA STORET (modernized & legacy)
c. Air Data
d. Health Data

2) Importing Data into ArcGIS


a. Setting up ArcGIS
i. Working directories
ii. Relative path names
b. Adding Shapefiles/Coverages
i. Downloading from NJ DEP GIS website
c. Adding XY Events
i. Joining Tables
d. Checking/Changing/Matching Projections

3) Manipulating Data within ArcGIS


a. Categorizing Data
i. Changing Layer Properties
1. Symbology
2. Quantitites
ii. Selecting Specific Data
1. Selection within an Attribute Table
2. Selection by Location
3. Selection by Attribute (simple queries)
4. Converting Selection to Shapefiles
b. Useful Tools
i. Buffer Wizard
ii. GeoProcessing Wizard

4) Saving GIS Data


a. Layout View and Saving Graphics as JPEGs, etc.
b. Saving Shapefiles and Projects

5) Exporting GIS Information for Other Uses (i.e. Matlab)


a. Conversion Tools
b. Projection Wizards
c. Creating ArcINFO Interchange Files (e00)
d. Importing to Matlab

1
Downloading Data from Internet Sources

- USGS Water Quality Data: http://waterdata.usgs.gov/nwis

- EPA STORET Water Data: http://www.epa.gov/storet/dbtop.html


1. For Data before 1999, choose the Legacy Database, after 1999, use Modernized

NOTE: Some STORET Data and USGS Data may overlap but you should
make sure of this when combining the data from these 2 sources

See notes on surface & groundwater data acquisition for specific details

- EPA Air Quality Data


1. AQS (Air Quality System) http://www.epa.gov/air/data/aqsdb.html
2. NEI (National Emissions Inventory) http://www.epa.gov/air/data/neidb.html

- Environmental Health Data


1. CDC http://www.cdc.gov/nceh/data.htm

2
Importing Data into ArcGIS

- Setting up the ArcGIS environment


1. Open ArcGIS and go to Customize Toolbars
a. Make sure Spatial Analyst and Editor Toolbars are selected
b. Choose any other toolbars you want to appear
c. If the spatial analyst toolbar is not on your toolbars menu or if everything in it
is grayed out then do the following:
i. Go to CustomizeExtensions check the spatial analyst and click
close
2. Go to File  Map Document Properties  Navigate to a working folder  Click the
silver cylinder with a star in the top right  Create a new geodatabase  Set this a the default
geodatabase
3. Go to File  Map Document Properties  Check the box next to ‘store relative path
names’

NOTE: By Choosing Relative Path Names, You are allowing


Other GIS users on other computers to open the files you create

_____________________________________________________________________________
- New Jersey GIS Database: http://www.state.nj.us/dep/gis/stateshp.html
1. NJ DEP Maintains various statewide Shapefiles for use in ArcGIS
2. On the opening page simply choose the data layer of interest from the dropdown box
3. You can view a GIS image of the data, the Description, or download the files
4. If you click on Download you can download the zip file to your computer
5. Unzip the file and add the shapefiles to your GIS
6. The files you download will contain:
a. Description
b. Shapefiles
c. Associated Attribute Tables

- Pre-viewing the Data and Description (Using ArcCatalog)


1. Open ArcCatalog.
2. Navigate to the directory where your shapefiles/coverages are located
3. In the left window, you can click on various GIS objects to view their attributes
4. When you click on a particular object, the attributes will appear in the right window
5. Generally there are 3 tabs in the right window
a. Contents: basically the type of file (shapefile, coverage, point, etc.)
b. Preview: lets you view the image of the object

3
c. Description: lets you view some details about the data (spatial attributes,
projections, etc.)
Exercise 1: Preview the Data and Descriptions using ArcCatalog
1. Go to http://www.state.nj.us/dep/gis/stateshp.html and download the ‘Watershed
Management Areas’ shape file aka ‘depwmas.zip’ to your local D drive and unzip it

2. Navigate to the directory where your shapefiles/coverages are located


a. If need be, connect to the folder by clicking on the folder with a plus called
‘Connect to Folder.’

3. Preview the data in ArcCatalog- Refer to above directions

- Adding Shapefiles/Coverages
1. Open ArcGIS
2. Click on the Add Data button (yellow square with black + ) or go to File  Add Data
3. Find the shapefile/coverage/table/layer that you would like to add, and Open it.
Note: Arc 10 includes ‘Adding Data from ArcGIS Online,’ which is an online GIS
database supported by ESRI.

- Adding XY Events (i.e. Point Locations)


1. Find the file which contains a list of Lat/Long for your station locations
2. Make sure there are at least 2 columns in the file, one with LAT and one for LONG
3. If the file is not already in DBF format, do the following:
a. Open the file (if it is a text file, import it) into Access
b. Go to External Data tab
c. In the Export section, click on More
d. Export as a dBASE file
e. Save the file as DBF IV (dBase IV)
f. You will have to save it twice
g. Make sure that the cells in the table are formatted as numbers, not text
4. Open ArcGIS go to Tools  Add XY Data
5. Find the DBF file with the location data
6. Specify the X field (LONG) and Y field (LAT)
7. Click OK the points should then appear in your view window in ArcMap
8. If they do not appear, you will need to check the projection (see below)

- Using Attribute Tables


1. Joins and Relates
a. To Join tables right click a layer  join  choose the table and fields to join
b. To Relate tables right click a layer  relate  choose table and fields to relate

NOTE: Use Joins to Add Data to an existing attribute table. Use Relate when

4
You have a 1-many or many-many relationship among data tables

NOTE: You must have an identical field in both tables to do a join/relate

Exercise 2: Adding XY Events


1. Go to the class website (http://www.unc.edu/mserre/teaching/fall2008/envr468/) and
download ‘Phos_Data_and_Locations.dbf’
2. Preview the data in Excel
a. Notice how there are Site IDs with a Phosphorous value and a unique latitude
and longitude location
3. Open ArcGIS if it’s not already
4. Click the ‘Add Data’ Button. Navigate to depwmas.shp and add it.
5. Click the ‘Add Data’ Button. Navigate to the ‘Phos_Data_and_Locations.dbf’ and
add it.
6. In the table of contents, right click on the table. Go to ‘Display XY Data’
7. In the X field select ‘Longitude’
8. In the Y field select ‘Latitude’
9. In the Coordinate System section, click ‘Edit’
10. Click ‘Select’
11. Navigate as follows: Geographic Coordinate System North America North
American Datum 1983.prj
12. Click Add
13. Now your Water Quality is displayed on your map!

2. Editing Tables
a. To edit values in an attribute table, you must open the editor toolbar (under
Customize Toolbar  Editor
b. In the Editor Toolbar, click on Start Editing
c. Open the attribute table of interest and you can now change values and
manipulate columns/rows
a. Click on Stop Editing when finished to save changes

- Checking/Changing/Matching Projected Coordinate Systems


1. You can check the projection of a shapefile/etc. using ArcMap of ArcCatalog
a. In ArcMap:
1. Make sure the layer/shapefile you are interested in is active
2. Right Click on the layer  Properties
3. In the Layer Properties window, select the Source tab
4. The defined coordinate system will appear in the Data Source Box
b. In ArcCatalog
1. Select the layer from the left window
2. Choose the Description tab in the right window
3. Select Spatial Attributes , the coordinate projection will show here
2. To change or define a coordinate system for a layer:

5
a. In ArcToolBox:
1. Go to Data Management Tools  Projections & Transformation
 Define Projection Wizard
2. In the dialog box, find the shapefile/coverage, etc. that you need to
define a projection for and click NEXT
3. Choose Select a Coordinate System
4. Then choose Select to use a predefined coordinate system
5. Navigate through either the Geographic or Projected Coordinate
Systems until you find the one you need. Usually you will determine
which coordinate system to use based on other shapefiles or layers you
are using in your project (look at the Description) or perhaps from the
literature
6. Once you have selected the appropriate coordinate system, it now
becomes one of the attributes of your shapefile and you can match
other layer’s coordinate systems to the one you just defined
b. In ArcCatalog:
i. Right click on the file. Go to Properties XY Coordinate System
Select
4. Matching Coordinate Systems among layers
a. Matching a projection or coordinate system is similar to defining a completely
new projection for a GIS object
b. In ArcToolBox:
1. Go to Data Management Tools  Projections & Transformations 
Define Projection
2. Choose Select a Coordinate System then choose Import
3. Find the layer/shapefile/etc. that already has a projection defined
which you would like to use and click Apply now both projections
should be defined in the same way
c. In ArcMap:
1. Go to View  Data Frame Properties  Coordinate System Tab
2. You can then select either a predefined projection or import a
projection from another shapefile or coverage to match to the existing
layer (using the Import button)

NOTE: Making sure your projections are consistent first will save a lot
of time later when you are combining layers, etc.

6
Manipulating Data within ArcGIS

- Categorizing Data
1. Changing Layer Properties
a. Right click on the layer that you are interested in  Properties
b. Within properties you have several options (most useful are listed):
1. General: Change the layer name
2. Source: View coordinate system/source file
3. Symbology: View Data using categories/quantities/graphs
a. Categories are useful when you have unique values
b. Quantities are useful when you have data you want to
aggregate and represent on the map
4. Fields: List the fields in your attribute tables
5. Joins/Relates: Lists any tables/layers that are joined to the current layer
2. Selecting Specific Data
a. Selection by location
1. Go to Selection  Selection by Location
2. Follow instructions to select features from one layer that interact
(i.e. intersect, contain, etc.) features from another layer
b. Selection by Attribute
1. Go to Selection  Selection by Attribute
2. Use the simple query editor to define your selection
a. double click the attribute on the left
b. select an operator (AND/OR, >, < , =) and create an expression
c. select a value for the expression
c. Selection within a Table
1. Right click the layer and go to Open Attribute Table
2. You can click on a specific row in the table and select that feature
it will then be highlighted both in the table and on the map view
d. Saving Selections
1. Once you have created a subset of selected features from a layer you
can save that selection as a new layer, to do this:
a. right click the original layer you made the selection from
b. go to Selection  Create Layer from Selected Features
c. right click the new layer that was just added  Save As Layer
File
2. A new layer may be automatically created when using Select by Loc.
Or Select by Attribute, in that case just right click this new layer 
Save as layer

7
- Other Useful Tools in ArcGIS
1. Buffer Wizard: Create buffers around features at a distance you specify
2. Geoprocessing Wizard: Lets you merge features in a layer, intersect layers, etc.
3. Geostatistical Analyst: Explore Data with graphs/charts

8
Saving GIS Data

- Saving Individual Layers as Shapefiles & Projects


1. Right click on each layer  Data  Export Data to export data as a shapefile
2. The Layer name should be the same as the file name
______________________________________________________________________________
- Layout View and Graphics
1. For Layout View go to View  Layout View
2. This View allows you to create a map with legends/titles/annotation, etc.
3. In the Layout View go to Insert menu  and add legends/titles/arrows/scale bars
4. Go to File  Export Map to save the layout as a JPEG (or other graphics file type)

NOTE: Before saving shapefiles make sure ‘relative path names’ is set in
File  Map Properties

NOTE: Simply saving a layer will not save the data associated with the layer
(i.e. symbology/categories etc. that you defined) You must save as a shapefile to include all
attributes

3. After you have saved all the shapefiles, you can save all of your work in a project file
which will keep all of your active layers, their attribute tables, and any manipulation
you have done to the files. Go to File  Save As to save a project

Exercise 3: Saving GIS data

1. Save an individual shapefile


a. Right click on the Phos_Events layer Data  Export Data
b. The layer name should be the same as the file name
2. Layout View and Graphics
a. Go to the layout view
i. In the menu go to View  Layout view
b. This view allows you to create a map with a title/legends/titles/annotations/etc.
i. While in the layout view, go to the Insert menu  Title/Legend/etc.
ii. Create a map with a title and legend
1. Go to File  Export Map
a. This allows you to save the map as a .jpeg or other graphic
file types
3. After all of the shapefiles are saved, you can save all of your work in a project file
(.mxd), which will keep all your active layers, their attribute tables, and any manipulation
you have done to the files.
a. Go to File  Save or Save As

9
Exporting GIS Shapefiles to Matlab
For BMElib track

- Importing Shapefiles Directly Into Matlab (v. 7.4 >)


1. In Matlab
a. Use the function ‘shaperead’ to read in the shapefile
b. Type in help shaperead for details on syntax, etc.

- Creating ArcINFO Interchange Files (e00) for use in Matlab:


1. Project Shapefile
a. Open ArcToolbox, click on Data Management Tools to see more options
b. Data Management Tools  Projections & Transformations  Feature 
Project
d. In the dialog box that opens, navigate to the shapefile you wish to convert

NOTE: You cannot have a path name containing spaces

e. Choose a file name for re-projected shapefile


f. Choose a Geographic Coordinate System (typically NAD83) by clicking on
the box next to the ‘Output Coordinate System’ Field
2. Convert Shapefile to Coverage
a. Open ArcToolbox
b. Go to Conversion Tools  To Coverage  Feature Class to Coverage
c. Select the re-projected shapefile from step 1
d. Select a new name for the coverage and click OK
3. Create e00 file
a. Open ArcToolbox
b. Click on  Coverage Tools  Converstion  From Coverage  Export to
Interchange File
c. Select the coverage you want to convert
d. The new file with have the extension .e00 and is ready for import to Matlab

NOTE: You can look at an .e00 file with any text editor (wordpad/notepad)

4. Importing the Graphic into Matlab


a. Open Matlab
b. Navigate to the directory where the .e00 file is located
c. Use the function ‘readARCe00.m’ to read in the e00 file (type ‘help
readARCe00’ for syntax)
d. A variable containing the Lat/Long of the shapefile will be created (called
pVal)
e. Use the ‘plot’ command to plot the shapefile within a matlab figure window
(see help ‘plot’, ‘figure’, ‘readARCe00’)

Exercise 4: Creating Arc Interchange file for use in Matlab


1. If not already projected, define a projection for the ‘depwmas’ shapefile

10
2. Convert the shapefile to coverage
3. Create the .e00 file from the coverage file
4. Open Matlab
5. In the BMELib directory, type ‘startup’
6. Go to the directory where your interchange file is located and type:
pVal=readARCe00(‘filename’);
7. To display the shapefile in a Matlab figure type:
for i=1:length(pVal)
plot (pVal{i}(:,1),pVal{i}(:,2)
hold on
end
8. Your NJ Watershed Management Area shapefile should be displayed!

11

You might also like