1 / 39

Attributes & Queries

GSP 270. Attributes & Queries. Reading Assignment: Bolstad , Ch. 8 (p. 307-346). 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?

Download Presentation

Attributes & Queries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GSP 270 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” Feature, Object, or Record ID Row or Record - One per feature Column or Field

  9. Attribute Terminology • Esri borrows from four disciplines for labels for attributes

  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

  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 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. Operators Boolean Operators: Used to combine expressions • And • Or • Not • Xor Order matters: (A AND B) OR C is not the same as A AND (B OR C) “AREA” > 10000AND“IMPR” = 0 “RAINFALL” < 20 OR “SLOPE” > 35 NOT ("STATE_NAME" = ‘Colorado’) [RAINFALL] > 20 XOR [SoilType] = ‘X’ And – Must meet both criteria Or – Can meet either criteria

  26. Operators Boolean Operators: Used to combine expressions • And • Or • Not • Xor Order matters: (A AND B) OR C is not the same as A AND (B OR C) “AREA” > 10000AND“IMPR” = 0 “RAINFALL” < 20 OR “SLOPE” > 35 NOT ("STATE_NAME" = ‘Colorado’) [RAINFALL] > 20 XOR [SoilType] = ‘X’ Comparison Operators: Used to compare values

  27. Joins and Relates 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 Table Join: Combines two tables based on the value of a field that can be found in both tables (a “common field”). Table B Table A

  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. External Tabular File (immigration) Attribute table + Example of 1:1 relationship

  31. Results of Join Operation

  32. Example of Many-to-1 relationship Join

  33. Example of 1-to-many relationship Relate

  34. Joins and Relates  Relate

  35. Options  Related Tables

  36. Example of 1-to-many relationship Relate

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

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

More Related