Presentation is loading. Please wait.

Presentation is loading. Please wait.

Attributes & Queries Reading Assignment: Bolstad, Ch. 8 (p. 307-346)

Similar presentations


Presentation on theme: "Attributes & Queries Reading Assignment: Bolstad, Ch. 8 (p. 307-346)"— Presentation transcript:

1 Attributes & Queries Reading Assignment: Bolstad, Ch. 8 (p. 307-346)

2 Attributes 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? –Where environmental areas are 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? –Which areas of the most fire fuels (dead wood)?

3 Attributes To answer questions we need information: –Counts of species –Counts of people, animals, houses, etc. –Height of trees, buildings, etc. –Size and perimeter of areas –Length of streams, roads –Ownership of parcels These are held in attributes

4 Census Scope An organization making census information available http://www.censusscope.org 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 at a county level (i.e. a polygon layer of counties).

5 Queries and Calculations We also need to select (query) certain types of information: –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

6 Attributes, Queries, Calculations Attributes are associated with features –In the Attribute table Queries “Select” data –Available in “Select by Attribute” –Based on Structured Query Language (SQL) Calculations available in: –Geometry calculator –Field (column) calculator

7 Attributes Table attached to each layer Each row tied to a feature –Point –Polyline(s) –Polygon(s) Each column (field) represents a different attribute and has: –Name –Type –Other properties

8 Attribute Terminology Attribute “Table” Row or Record - One per feature Column or Field Feature, Object, or Record ID

9 Attribute Terminology Esri borrows from four disciplines for labels for attributes Spatial DataSpreadsheetDatabaseOOP Attribute TableSpreadsheetTable- An attributeColumnFieldProperty Feature ID?Row NumberRecord IDObject ID Attributes for one feature RowRecordObject’s properties Attribute valueCellEntryProperty Value FilterSelectionQuery-

10 Attributes Vector Attributes (very common) Raster Attributes (when available) Examples of attributes: –Name –Population/Census numbers –Vegetation characteristics –Dates –Coordinates –Ownership –Park Type

11 Vector Attributes Used For: –Labels: Direct: Names of cities, states, etc. Results of “expressions”: City with it’s population –Symbology: Size city by it’s population –Selection Select cities over a certain size –Sub-setting Create a new layer with cities over 1 million

12 Types of Attributes Qualitative –Nominal: No order, types Quantitative –Ordinal: Ordered set of classifications –Interval: Values along arbitrary scale –Ratio: Values along non-arbitrary scale –Cyclic: Values repeat

13 Types of Attributes (examples) Qualitative –Nominal: Land Cover Type Quantitative –Ordinal: Fire danger low, medium, high –Interval: Temperature –Ratio: Population Density (floating point) Number of People / Area –Cyclic: Directions (0 to 360 degrees)

14 Examples of Attributes Names Taxonomic Identification: –Scientific Names, common names, codes (NRCS codes) Organism characteristics Population values Distance, Area Dates Collector’s names Coordinates

15 Structured Query Language (SQL) Comes from the database industry “INSERT”, “DELETE”, and “SELECT” rows in tables Very rich syntax Portions of “SELECT” grammar used heavily in ArcGIS: –Selecting attributes –Raster calculator –Geodatabases

16 Select by Attributes SELECT * FROM TableName WHERE: –“WHERE Clause” or Filters Available from the Attribute Table

17 Attributes in ArcGIS

18 Filter Examples WHERE: –FID = 1 –“Area” < 10000 –“Area” <= 10000 –“Name” = ‘Crater Lake’ (case dependent) –“Name” LIKE ‘Crater Lake’ (ignores case) Notice: –Fields have double quotes –String values have single quotes

19 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

21 Boolean Operators ABA AND BA OR BNOT ANOT B TTTTFF TFFTFT FTFTTF FFFFTT

22 More Complex Filter Examples WHERE: –“Name” LIKE ‘Hawaii’ AND Area < 10000 –“Species” LIKE ‘Ponderosa’ AND DBH > 1

23 Select by Location Proximal Topological –Identical –Adjacent –Within –Share segment

24 Table Queries: The selection of a subset of features that meet some criteria. “Area” > 20.0“Landuse” = ‘Urban’ AND “Municip” = ‘City’ Expression: A sequence of operands and operators constructed according to the syntactic rules of a symbolic language (SQL)

25 Boolean Operators: Used to combine expressions 1)And 2)Or 3)Not 4)Xor “AREA” > 10000 AND “IMPR” = 0 “RAINFALL” 35 NOT ("STATE_NAME" = ‘Colorado’) [RAINFALL] > 20 XOR [SoilType] = ‘X’ 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

26 Boolean Operators: Used to combine expressions 1)And 2)Or 3)Not 4)Xor “AREA” > 10000 AND “IMPR” = 0 “RAINFALL” 35 NOT ("STATE_NAME" = ‘Colorado’) [RAINFALL] > 20 XOR [SoilType] = ‘X’ Order matters: (A AND B) OR C is not the same as A AND (B OR C) OperatorDescription < less than > greater than <= less than or equal to >= greater than or equal to = Equal to <> not equal to Comparison Operators: Used to compare values

27 Two ways to combine tables: Joins Used for 1-to-1 relationships, or many-to-1 relationships between attribute table and external table. Relates Used for 1-to-many relationships, many-to-many relationships between attribute table and external table.

28 Table Join: Combines two tables based on the value of a field that can be found in both tables (a “common field”). Parcel-IDOwner 2John Smith 5Bruce Martin 6Anne Davis 1Steve Arnold 8Rick James Parcel-IDAcres 22 51.5 66 13 81.6 Parcel-IDAcresOwner 22John Smith 51.5Bruce Martin 66Anne Davis 13Steve Arnold 81.6Rick James Table A Table B

29 Joins and Relates  Join A Join lets you join data from an external table to your attribute table based on the value of a field that can be found in both tables.

30 + Attribute table External Tabular File (immigration) External Tabular File (immigration) Example of 1:1 relationship

31 Results of Join Operation

32 Example of Many-to-1 relationship Join

33

34 Example of 1-to-many relationship Relate

35 Joins and Relates  Relate

36 Options  Related Tables

37 Example of 1-to-many relationship Relate

38 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. Group together All records that have the same State name. Get summary stats on the values in the rain field.

39 Summarize Find combined (total) area for each “covertype” Summarize Quantitative By Qualitative!


Download ppt "Attributes & Queries Reading Assignment: Bolstad, Ch. 8 (p. 307-346)"

Similar presentations


Ads by Google