Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "GIS UPDATE? Lecture 17 Lab 8: Music Festival, Part 2 – Spatial Analysis."— Presentation transcript:

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

2

3

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

5 To answer these questions, we need information: * Counts of species. * Counts of species. * Counts of people, animals, houses, etc. * Counts of people, animals, houses, etc. * Height of trees, buildings, etc. * Height of trees, buildings, etc. * Size and permieter of areas. * Size and permieter of areas. * Length of streams or roads. * Length of streams or roads. * Ownership of parcels. * Ownership of parcels. This type of data can be found within the Attributes of a shapefile.

6 Example: Census Scope 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). Census Scope

7 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. * People over 60 years old. * Parcels over 1 acre. * Parcels over 1 acre. * Areas with 1 or more endangered species. * Areas with 1 or more endangered species. And compute new values: * Number of animals per meter. * Number of animals per meter. * Density of trees. * Density of trees. * Board feet per acre. * Board feet per acre. * Fish per meter. * Fish per meter.

8 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. 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. 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. 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.

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

10 Attributes: Terminology

11 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 * Name * Population/Census numbers * Population/Census numbers * Vegetation characteristics * Vegetation characteristics * Dates * Dates * Coordinates * Coordinates * Ownership * Ownership * Park Type * Park Type

12 Vector Attributes Vector Attributes are used for labels, symbology, selection, and sub-setting. Some examples of Labels are: * Direct: Names of cities, states, etc. * Direct: Names of cities, states, etc. * Results of "expressions;" e.g. city with its population. * Results of "expressions;" e.g. city with its population.Symbology: * Size city by its population. * Size city by its population.Selection: * Select cities over a certain size. * Select cities over a certain size.Sub-setting: * Create a new layer with cities over 1 million residents. * Create a new layer with cities over 1 million residents.

13 Test Your Knowledge Vector attributes are used for all of the following, EXCEPT: Labels Labels Records Records Symbology Symbology Selection Selection Sub-setting Sub-setting Records

14 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 Nominal - Land Cover Type Some examples of Quantitative Data are: Ordinal - Fire danger low, medium, or high. Ordinal - Fire danger low, medium, or high. Interval - Temperature. Interval - Temperature. Ratio - Population Density (floating point), or number of people per area. 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) Ratio is similar to Interval, except that it has a meaningful "0" value (i.e. population density) Cyclic - Directions (0 to 360 degrees) Cyclic - Directions (0 to 360 degrees)

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

16 Test Your Knowledge What is NOT an example of Quantitative data? Ordinal Ordinal Ratio Ratio Cyclic Cyclic Nominal Nominal Interval Interval Nominal

17 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 * Selecting attributes * Raster calculator * Raster calculator * Geodatabases * Geodatabases

18 Select by Attributes SELECT * FROM TableName WHERE: SELECT * FROM TableName WHERE: "WHERE Clause" or Filters "WHERE Clause" or Filters Available from the Attribute Table Available from the Attribute Table Fields Records

19 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 (%)

20 Boolean Values True = T = 1 False = F = 0 Boolean Operators:

21 More Complex Filter Examples Where: "Name" LIKE 'Hawaii' AND Area < 10000 "Name" LIKE 'Hawaii' AND Area < 10000 "Species" LIKE 'Ponderosa' AND DBH > 1 "Species" LIKE 'Ponderosa' AND DBH > 1 Select by Location Proximal Proximal Topological Topological Identical Identical Adjacent Adjacent Within Within Share segment Share segment

22 Table Queries: The selection of a subset of features that meet some criteria.

23 Operators Boolean Operators: Used to combine expressions. 1. And"Area" > 10000 AND "IMPR" = 0 1. And"Area" > 10000 AND "IMPR" = 0 2. Or"RAINFALL" 35 2. Or"RAINFALL" 35 3. NotNOT ("STATE_NAME"='Colorado') 3. NotNOT ("STATE_NAME"='Colorado') 4. Xor[RAINFALL] > 20 XOR [SoilType] = 'X‘ 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.

24 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

25 Test Your Knowledge AND can meet either criteria False False True True False OR can meet either criteria; AND must meet both criteria.

26 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.

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

28 Join Examples in ESRI ArcMap

29

30

31

32

33 Relate Examples in ESRI ArcMap

34

35

36

37 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.

38

39 Test Your Knowledge Relates are used for 1-to-many relationships. False False True True True Relates are used for 1-to-many, or many-to-many relationships.

40 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. 1. Select "Add Field" from the Options Menu. 2. Name the Field. 2. Name the Field. 3. Select the type of data. 3. Select the type of data. 4. Be careful with "Precision.“ 4. Be careful with "Precision.“ Checking the Edit Session 1. Right-Click on the menu bar. 1. Right-Click on the menu bar. 2. Select "Editor" 2. Select "Editor" 3. If "Start Editing" is grayed out: 3. If "Start Editing" is grayed out: a. Select "Stop Editing." a. Select "Stop Editing."

41 Adding Fields

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

43 Select the Field Properties Types: Short Integer 16-bit Integer (5 digits) Long Integer 32-bit Integer (9 digits) Float 32-bit Floating Point Double 64-bit Floating Point Text Up to 254 Characters Date 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.

44 Precision Can Change "Type" Short Integer 16-bit Integer (5 digits) Double 64-bit Floating Point

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

46 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.

47 Calculate Geometry

48 Editing Attribute Values If attributes won't change: If attributes won't change: Make sure you're in an edit session Make sure you're in an edit session Double-click on the cell to type in a new value Double-click on the cell to type in a new value Use the "Field Calculator" to change entire columns Use the "Field Calculator" to change entire columns

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

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

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

52 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 Selection tab on TOC Manual Selection Manual Selection Click to select Click to select Shift-click to add/remove from selection Shift-click to add/remove from selection Select by Attributes Select by Attributes Select by Location Select by Location Right-click on layer --> Selection --> Create Layer from Selected Features Right-click on layer --> Selection --> Create Layer from Selected Features Then, "Export" the data to a new file Then, "Export" the data to a new file

53 Select by Attributes

54

55

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

57 Test Your Knowledge Attribute Table values are updated when you project data. False False True True False Attribute Table values do NOT update when you project data. This must be done manually with ArcMap tools such as Calculate Geometry.

58

59

60

61

62


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

Similar presentations


Ads by Google