gis update? lecture 17 lab 8: music festival, part 2 – spatial analysis

62
GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Upload: kory-reeves

Post on 25-Dec-2015

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

GIS UPDATE?Lecture 17Lab 8: Music Festival, Part 2 – Spatial Analysis

Page 2: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 3: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 4: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Attributes and Queries: An Introduction

To make decisions, we need information about the spatial areas in Shapefiles:

* Which parcels are big enough for my house? * Which areas have more poverty for development funds? * Are environmental areas threatened by encroaching development? * How many endangered species are in each area? * How many fish are in each stream? * Who borders the streams we need to restore? * What areas have the most fire fuels (e.g. dead wood)?

Page 5: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

To answer these questions, we need information:

* Counts of species. * Counts of people, animals, houses, etc. * Height of trees, buildings, etc. * Size and permieter of areas. * Length of streams or roads. * Ownership of parcels.

This type of data can be found within the Attributes of a shapefile.

Page 6: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Example: Census Scope

Census Scope is an organization that makes census information available. Navigate to this site and check out the variety of maps, charts, and tables they have made available from US Census Data. These are computed using attributes of the census data by county level (i.e. a polygon layer of counties).

Page 7: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Queries and Calculations

In order to answer the questions raised in Attributes: An Introduction, we also need to select (query) certain types of information, such as: * People over 60 years old. * Parcels over 1 acre. * Areas with 1 or more endangered species.

And compute new values: * Number of animals per meter. * Density of trees. * Board feet per acre. * Fish per meter.

Page 8: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Attributes, Queries, and Calculations

• Attributes are associated with features and are located within the Attribute Table. Queries "Select" data through the "Select by Attribute" tool, which is based on Structured Query Language (SQL). Calculations can be made through Calculate Geometry and Field (column) Calculator.

• Each layer has a table attached to it, where each row is tied to a particular feature (point, line, or polygon) within that layer. Each column (field) represents a different attribute, such as: Name, type, or some other property.

• The Attribute Table is similar to Microsoft Excel, in that each row is tied to a feature, you can add and delete columns, and adding and deleting rows will add or delete features.

Page 9: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Test Your Knowledge

What is each row tied to?• Height of trees• Ownership of parcels• A different attribute (name, type, or some other property)• A particular feature (point, line, or polygon)

A particular feature (point, line, or polygon)

Page 10: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Attributes: Terminology

Page 11: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

ESRI borrows labels from four disciplines for attributes:

It's fairly common to find Attributes within Vector data, but Raster data is not so likely. Some examples of attributes are: * Name * Population/Census numbers * Vegetation characteristics * Dates * Coordinates * Ownership * Park Type

Page 12: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Vector Attributes

Vector Attributes are used for labels, symbology, selection, and sub-setting.

Some examples of Labels are: * Direct: Names of cities, states, etc. * Results of "expressions;" e.g. city with its population.

Symbology: * Size city by its population.

Selection: * Select cities over a certain size.

Sub-setting: * Create a new layer with cities over 1 million residents.

Page 13: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Test Your Knowledge

Vector attributes are used for all of the following, EXCEPT:• Labels• Records• Symbology• Selection• Sub-setting

Records

Page 14: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Attributes: Types

There are two types of Attribute Data: Qualitative and Quantitative. Qualitative data is nominal, meaning types, but no specific order to them. Quantitative data is either Ordinal (ordered sets of classifications), Interval (values along non-arbitrary scale), or Cyclic (values that repeat).

An example of Qualitative Data is:• Nominal - Land Cover Type

Some examples of Quantitative Data are:• Ordinal - Fire danger low, medium, or high.• Interval - Temperature.• Ratio - Population Density (floating point), or number of people per area.• Ratio is similar to Interval, except that it has a meaningful "0" value (i.e. population

density)• Cyclic - Directions (0 to 360 degrees)

Page 15: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Examples of Attributes:

* Names * Taxonomic Identification * Scientific names, common names, codes (NRCS codes). * Organism characteristics * Population values * Distance or area * Dates * Collector's names * Coordinates

Page 16: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Test Your Knowledge

What is NOT an example of Quantitative data?

• Ordinal• Ratio• Cyclic• Nominal• Interval

Nominal

Page 17: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Structured Query Language (SQL)

SQL comes from the database industry, and you can "INSERT," "DELETE," and "SELECT" rows in tables. It comes with a very rich syntax, and portions of "SELECT" grammar are used heavily in ArcGIS:

* Selecting attributes * Raster calculator * Geodatabases

Page 18: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Select by Attributes

• SELECT * FROM TableName WHERE:• "WHERE Clause" or Filters

• Available from the Attribute Table

Fields

Records

Page 19: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Filter Examples

• Where:• "FID" = 1• "Area" < 10000• "Area" <= 10000• "Name" = 'Crater Lake' (case

dependent)• "Name" LIKE 'Crater Lake' (ignore

case)• Notice:• Fields have double quotes• String values have single quotes

SQL Comparisons

• Equals: =• Greater than: >• Less than: <• Greater than or equal: >=• Less than or equal: <=• Not equal: <>• Like: case independent string

comparison with wild cards (%)

Page 20: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Boolean Values

True = T = 1False = F = 0

Boolean Operators:

Page 21: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

More Complex Filter Examples

Where:• "Name" LIKE 'Hawaii' AND Area < 10000• "Species" LIKE 'Ponderosa' AND DBH > 1

Select by Location

• Proximal• Topological• Identical• Adjacent• Within• Share segment

Page 22: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Table Queries:

The selection of a subset of features that meet some criteria.

Page 23: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

OperatorsBoolean Operators: Used to combine expressions.

1. And "Area" > 10000 AND "IMPR" = 0

2. Or "RAINFALL" < 20 OR "SLOPE" > 35

3. Not NOT ("STATE_NAME"='Colorado')

4. Xor [RAINFALL] > 20 XOR [SoilType] = 'X‘“Xor” a logical operation that outputs true whenever both inputs differ (one is true, the other is false).

Order Matters:(A AND B) OR C is not the same as A AND (B OR C)!And - Must meet both criteria.Or - Can meet either criteria.

Page 24: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Boolean Operators: Used to combine expressions.

Comparison Operators: Used to compare values.

Operator Description< Less Than> Greater Than<= Less Than or Equal to>= Greater Than or Equal to= Equal to<> Not Equal to

Page 25: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Test Your Knowledge

AND can meet either criteria• False• True

FalseOR can meet either criteria; AND must meet both criteria.

Page 26: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Joins and Relates

There are two ways to combine tables: Joins and Relates.

Joins are used for 1-to-1 relationships, or many-to-1 relationships between the attribute table and an external table.

Relates are used for 1-to-many relationships, or many-to-many relationships between the attribute table and an external table.

Page 27: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Table Join:Combines two tables based on the value of a field that can be found in both tables (a "common field").

Page 28: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Join Examples in ESRI ArcMap

Page 29: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 30: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 31: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 32: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 33: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Relate Examples in ESRI ArcMap

Page 34: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 35: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 36: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 37: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Summarize creates a new table containing one record for each unique value occurring in a selected field along with statistics summarizing the data in any of the other fields.

Page 38: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 39: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Test Your Knowledge

Relates are used for 1-to-many relationships.• False• True

TrueRelates are used for 1-to-many, or many-to-many relationships.

Page 40: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Adding Fields

When adding a new field into a Shapefile, you must make sure that the Shapefile is not marked as Read-Only and that you are not presently in an Edit Session. 1. Select "Add Field" from the Options Menu. 2. Name the Field. 3. Select the type of data. 4. Be careful with "Precision.“

Checking the Edit Session 1. Right-Click on the menu bar. 2. Select "Editor" 3. If "Start Editing" is grayed out: a. Select "Stop Editing."

Page 41: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Adding Fields

Page 42: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Naming Fields

Arc only allows 10 characters when naming fields. Remember, you will be using the Name in calculations and queries!

Page 43: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Select the Field Properties

Types:

Short Integer 16-bit Integer (5 digits)Long Integer 32-bit Integer (9 digits)Float 32-bit Floating PointDouble 64-bit Floating PointText Up to 254 CharactersDate MM/DD/YYYY Format

Precision: Describes the number of digits that can be stored in the field. All digits are counted no matter what side of the decimal they are on.Scale: Sets the number of decimal places stored in a field. This parameter is only used in Float and Double data field types.

Page 44: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Precision Can Change "Type"

Short Integer 16-bit Integer (5 digits)Double 64-bit Floating Point

Page 45: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Delete a Field

You must be outside of an edit session to delete fields within the attribute table.

Page 46: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Editing Attribute Values

The attribute "table" contains rows and columns similar to a spreadsheet. However, it's history and future are based on databases, where Columns are Fields, and Rows are Records.

We can add and delete columns (fields), and adding and deleting features adds and deletes rows.

Page 47: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Calculate Geometry

Page 48: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Editing Attribute Values

• If attributes won't change:• Make sure you're in an edit session

• Double-click on the cell to type in a new value

• Use the "Field Calculator" to change entire columns

Page 49: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Start Editing

Without an Edit Session - ArcGIS will not track your changes, so "Undo" will not work!

Page 50: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Making Changes

• Click (or double-click) in the cell• Type changes - Easy!• Dates are in MM/DD/YYYY format

Page 51: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

If you do not select "Stop Editing," than your changes will not be saved.

Page 52: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Coordinate Attributes

It is common to see Lat/Lon or Easting/Northing in attribute tables for point layers. These are not the values used to render the spatial data! These values are not updated when you project, edit, or transform the spatial data!

To update these columns...Selection

• Selection tab on TOC• Manual Selection• Click to select• Shift-click to add/remove from selection

• Select by Attributes• Select by Location• Right-click on layer --> Selection --> Create Layer from Selected Features• Then, "Export" the data to a new file

Page 53: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Select by Attributes

Page 54: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 55: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 56: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Select by Attributes• SELECT * FROM TableName WHERE: • "WHERE Clause" or Filters

Page 57: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis

Test Your Knowledge

Attribute Table values are updated when you project data.• False• True

FalseAttribute Table values do NOT update when you project data. This must be done manually with ArcMap tools such as Calculate Geometry.

Page 58: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 59: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 60: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 61: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis
Page 62: GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis