0% found this document useful (0 votes)
12 views63 pages

Lecture_8_Attribute_Data

The document provides an overview of Geographic Information Systems (GIS), focusing on attribute data, database management systems (DBMS), and the relationships between tables. It explains different types of tables, data relationships, and cardinality, as well as the importance of statistical exploration and data storage formats. Additionally, it covers field types in ArcGIS and the significance of geometry fields in geodatabase attribute tables.

Uploaded by

hecho.394
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views63 pages

Lecture_8_Attribute_Data

The document provides an overview of Geographic Information Systems (GIS), focusing on attribute data, database management systems (DBMS), and the relationships between tables. It explains different types of tables, data relationships, and cardinality, as well as the importance of statistical exploration and data storage formats. Additionally, it covers field types in ArcGIS and the significance of geometry fields in geodatabase attribute tables.

Uploaded by

hecho.394
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Winter 2024

LDA 150/ABT 150

Introduction to
Geographic Information Systems (GIS)
Instructor: Isaya Kisekka

Attribute Data
Learning objectives

Learn about attribute data in GIS


Learn about DBMS
Learn about joins, and relates
Learn about statistical exploration of data in attribute tables
Learn about field properties in attribute tables
Review questions
Types of tables

GIS tables come in two main types

• Attribute tables store data associated with a spatial feature class


or raster.

• Standalone tables simply store tabular data from any source.


• Excel, text files, CSV files, and database files are common sources of
standalone tables.
Field
Tables

Record

Source: Esri

• A table is a data structure to store attributes


• This table stores attributes for a counties feature class
• Rows are called records
• Columns are called fields
• The Feature ID or Object ID is a unique integer managed by the software to
identify the record
Example from my research mapping almond yield

• An attribute table contains only ONE row for every spatial feature. In this
example every point on the map represents almond yield as a point feature
class with thousands of points following the path of the almond harvester
(picker).
• Row is linked to the spatial feature using the FID or OID.
Raster attribute table
A value attribute table lists the attributes of value and count. The value field
refers to the cell value, and the count field refers to the number of cells.
Typically used for rasters

https://help.arcgis.com/en/geodatabase/10.0/sdk/arcsde/concepts/rasters/entities/r
asters_attr.htm
Flat file DBMS

A flat file database

• Stores data as rows of information in files.

• Is simple and robust.

• Is efficient for search and query.

Customers

Service calls

Electric usage

Service personal
Hierarchical DBMS

Stores data in multiple tables


The tables have defined parent-child
relationships
• Customer table is linked to a table of
service calls.
Defines pre-set hierarchy of table
relationships
• Service personnel are linked to service
calls but not to customers.
Very efficient for specific queries, but the
allowable queries are limited by the
structure
Relational DBMS

Stores data in multiple tables


Table relationships are defined as
needed
• Service personnel can be linked
to customers if needed.
Very flexible
Ideal for open-ended applications
when types of queries not known
beforehand
Most common type used in GIS
applications
Joining tables

Source: Esri

• Table joins allow two tables to be used as a single table


• Records are linked using a common field, or key, like STATE_FIPS
• The target table receives the additional information
• The join table provides the additional information
Multiple joins

• More than two tables may be joined to a target table


• Two tables with only a state name or state abbreviation field can
be joined using a common table with both fields
• The same table must be the target for all multiple joins (a table
cannot be both a target table and a join table)
One-to-one joins

Source: Esri

• Joining must take into account the cardinality between the two
tables, or how many join records match each target record
• In a one-to-one join, one record in the join table matches one
record in the target table
Many-to-one joins

Source: Esri

• In a many-to-one cardinality, one record in the join table


matches many records in the target table
• The join record is repeated as many times as needed in order to
fill out the target records
One-to-many joins

Source: Esri

• In a one-to-many cardinality, many records in the join table match one record
in the target table
• It cannot be displayed as a single table, because there are multiple records
matched to each target record
• A relate is used instead, in which the tables remain separate but are linked
together, so that a selection in one table can be used to select the linked
records in the other table
Rule of Joining

Source: Esri

• Each record in the target table must match one and only one
record in the join table
• This rule is satisfied for one-to-one and many-to-one cardinality,
but not for a one-to-many cardinality
Many-to-many cardinality

In a many-to-many
cardinality, multiple records in
one table match multiple
records in another table
• Each student takes many
classes, and each class has
many students.
These complex relationships
are rarely satisfactorily treated
in GIS, although a relate is
one way to handle them
Four types of data relationship between tables: one-to-one,
one-to-many, many-to-one, and many-to-many.
Summary of cardinality types

One-to-one One-to-many
• States to Governors. • States to cities.
• Countries to capitals. • Districts to schools.

(Target table on the left)

Many to one Many-to-many


• Cities to states. • Students to classes.
• Schools to districts. • Stores to customers.

In evaluating cardinality, always put the target table first.


Unmatched records in joins

Source: Esri

Sometimes a target record has no match in the join table


• The earthquakes table has records for Puerto Rico, but the states table does
not.
Records without a match will show <Null> values in the fields from the join
table
If all of the join fields have <Null> values, the join may have been
performed incorrectly, resulting in no matches
Adding a join

• This Add Join tool is joining


113th Congress to the 114th
Congress target table
Target
• The key field can have
different names in each
table, as long as the
Join information matched
• Uncheck the Keep All Target
Features box if you don’t
want to display records
Source: Esri
without matches
Thinking critically with statistics

Source: Esri

Exploring data with statistics helps you think critically about your data and
identify potential issues
• Zero magnitude earthquakes represent missing values and will impact
statistics calculated for the quakes.
• Actual earthquake distributions have many more low magnitude quakes than
large ones. This data set has been screened to show only the large quakes.
Charts

Source: Esri

Charts are another great data exploration tool


This scatterplot shows the strong correlation between average
temperature and latitude
ArcGIS Pro charts are linked to the map
• Warm or cold outliers selected on the graph will also be selected on
the map.
Summary statistics

• The Summary Statistics tool


is used to calculate statistics
for one or more fields

• The results are stored in a


new table

• This tool configuration will


calculate the total population
of each minority group in
the United States

Source: Esri
Statistics with a case field

Source: Esri

• When calculating statistics, a case field can be used to group


features first

• Instead of calculating the sum of deaths or damage for all quakes


in the table (a), using STATE as the case field yields a table with
sums for each state (b)
Creating fields
Each field must be defined before placing any data in it

Once defined, the field type cannot be changed

Fields have stringent naming rules to ensure that they work with
many different types of databases

No more than 13 characters.

Use only letters and numbers.


Field
Binary data
0
• Computers store data as binary numbers in base 2 1
10
• Base 2 numbers are sequences of 0’s and 1’s
11
• Each binary digit is called a bit 100
• Bits are grouped into sets of 8 to form a byte, which can 101
store numbers from 0 to 255 110
• More bytes are added to store larger numbers 111
• A megabyte (MB) is 1 million bytes. 1000
1001
1010
In base 2:
1 bit 1111111111111111 = 65,565 1011

00000000 = 0
⎯ ⎯⎯→
10011101
216 = 65,566
one byte
11111111= 255
two bytes
2 = 256
8
ASCII data storage

American Standard Code for Information Interchange (ASCII) is


how computers store text
Each letter, character, and symbol is represented by a unique 7-bit
binary code
• For example, the letter C is represented by 1000011 in binary (or
67 in decimal).
• Upper and lower case letters have different ASCII codes.
CAT = {67,65,84} decimal = 100001110000011010100
cat = {99,97,116} decimal = 110001111000011110100
148 = {49,52,56} decimal = 011000101101000111000
Storing data

• Text data are always stored in ASCII format.


• Numeric data may be stored in ASCII or binary format.
• Binary is generally more efficient for numbers.

ASCII stores “106” as three codes of 1 byte each = 3 bytes


106 = {49,48,54} decimal = 011000101100000110110
Binary stores “106” as a single 1-byte binary number
106 = 01101010
Prove mathematically that 106 is equivalent to 01101010 in
binary.

• Step 1: Divide 106 successively by 2 until the quotient is 0:


• 106/2 = 53, remainder is 0 LSB
• 53/2 = 26, remainder is 1
• 26/2 = 13, remainder is 0
• 13/2 = 6, remainder is 1
• 6/2 = 3, remainder is 0
• 3/2 = 1, remainder is 1
• 1/2 = 0, remainder is 1 MSB
Step 2: Read from the bottom to top to get binary equivalent as
1101010.
Byte storage limits

A single byte can store a value from 0 to 28 − 1

Larger numbers require more bytes


• 1 byte 28 − 1 = 255. In base 2:
• 2 bytes 216 − 1 = 65,535. 00000000 = 0
• 3 bytes 226 − 1 = 16,777,215. 11111111= 255

• 6 bytes 2 − 1 = 4,294,967,295.
32 28 = 256

Signed numbers require a bit to store positive or negative, so


storage limits are smaller

• 2 bytes 215 − 1 = − 32,767 to + 32,767.


• 4 bytes 231 − 1 = − 2,147,483,647 to + 2,147,483,647.
Integer versus float storage

Scientific notation 3.2957239  10 4

Binary stores whole numbers (integers)

To store decimal values, the computer stores a form of scientific


notation with a mantissa and an exponent

• 3.2957239e04 = 32957.239.

• − 3.2957239e04 = − 32957.239.

• 3.2957239e − 04 = 0.00032957239.
Float precision

Large numbers start to lose precision because the number of


significant digits in the mantissa is limited.

• 3.2957239e12 = 3295723900000.

A double-precision floating point allots more storage to the


mantissa value

• 3.295723956249723e12 = 3295723956249.723.
Database storage

Database fields are typically defined by


• ASCII versus binary type storage.
• Bytes of storage allocated.
• Integer versus floating point.
The definition limits the values that can be stored
• It is important to match the type to storage requirements.
• Try to minimize storage space while making sure all potential
values will fit in the field.
Text (ASCII) field with 10 bytes “Mississipp”
Binary 2-byte signed integer: −32,767 to +32,767
Single-precision floating point x.xxxxxxxeyy
ArcGIS field data types

ArcGIS Pro has six basic field types: short and long for integers,
float and double for decimal values, text, and date

Field type Explanation Examples


Integers stored as 2-byte binary numbers 255
Short
Range of values −32,000 to +32,000 12001
Integers stored as 10-byte binary numbers 156000
Long
Range of values −2.14 billion to +2.14 billion 457890
Floating-point values with eight significant digits 1.289385e12
Float
in the mantissa 1.5647894e − 02
Double-precision floating-point values with 16 1.12114118119141e1
Double
significant digits in the mantissa 3
‘Maple St’
Text Alphanumeric strings
‘John H. Smith’
07/12/2008
Date Date/time format for calendar dates and times
10/17/1963 13:24:06
The rows in an attribute table are called_________.
A)fields
B)ranks
C)keys
D)records
E)attributes
1. The columns in an attribute table are called_________.
1. fields
2. ranks
3. keys
4. records
5. attributes
Because GIS requires compact and flexible underlying data storage
capabilities, most use a_________ database as a foundation.
A)flat file
B)spreadsheet
C)relational
D)hierarchical
The_________ database is the simplest type of database, but is
not efficient for retrieving data.
A)flat file
B)spreadsheet
C)relational
D)hierarchical
Field used to join or relate two tables is called a(n)_________.
A)key
B)object ID
C)feature ID
D)shape ID
The_________ table remains the table of interest and receives the
information appended during a join, whereas the_________ table
provides the additional information.
target, join
join, target
source, target
source, destination
destination, target
The numerical relationship between objects in one table and
matching objects in another table is called the_________.
A)property
B)cardinality
C)hierarchy
D)default
The Rule of Joining states that_________.
A)every target table must be joined to at least
one join table
B)for each record in the target table there
must be one and only record in the join
table
C)for each key in the target table there must
be a single attribute in the join table
D)for each field in the target table there must
be a matching field in the join table
Suppose you have a polygon feature class of states and a standalone table of McDonald's franchises.
A common state abbreviation field exists in both tables. Which one of the following is a true
statement?
A)You can join the tables, but only if franchises is the target
table.
B) You cannot join the tables at all.
C) You can join the tables, but only if states is the target
table.
D)You can join the tables regardless of whether states or
franchises is the target table.
The best field type to store someone's YEAR of birth would
be_________.
A)float
B)long
C)short
D)date
Geometry fields

Source: Esri

• Geodatabase attribute tables have special geometry fields called


Shape_Length and Shape_Area
• These fields are updated automatically if the feature shape changes, as during
a generalize (a) or dissolve (b−c) operation
• All user-defined geometry fields must be updated manually
• Shapefiles have no automatic geometry fields, so all must be updated
manually with the Calculate Attribute Geometry tool
Domains

Source: Esri

Domains are rules about what can be placed in a field


Coded domains provide lists of values to pick from
• Choose Coniferou or Deciduous instead of typing it each time.
• A shorter code can be stored, saving space, while the user gets an
understandable term to select.
Range domains specify the range of numeric values permitted
• A percent field should have values from 0 to 100.
Domains are especially useful when editing or when collecting data in the field
on a GPS or mobile device
Examples of domains

Field Domain
Domain name Coded values
type type
Things Text Coded Tree, Bench, Lightpole, Sign, Sculpture, Other
ConditionClass Text Coded Good, Fair, Poor
LineCategories Text Coded Sidewalk, Street, Trail, Powerline, Other
Concrete, Asphalt, Gravel, Dirt, Grass, Matting,
SurfaceMaterials Text Coded
Bark, Sand, Other
Parking, Athletic field, Pool, Landscaping,
LanduseClass Text Coded
Playground, Game court, General use, Other

• This table shows coded domains for collecting features that one
might find in a park or on a campus
• Coded domains save time and reduce typing and data entry
errors
Creating domains

Source: Esri

• Domains are created for a geodatabase rather than a feature class, so they
can be reused for many fields
• Domains are given field types that must match the fields to which they are
assigned
• This SymbolType coded value domain is for a text field, and two codes for
solid and dashed lines have been created
• Split and merge policies control the behavior of the fields if they are edited
Assigning domains

Source: Esri

Once created, the domain must be assigned to the field using the Fields view
• This ParcelType coded domain is being assigned to the Bldgtype field in this
Buildings feature class.
The field type must match (Short, Float, and so on)
Domains can be reused for many fields if desired
• True/False, or Yes/No, or, Good/Fair/Poor are examples of often-reused
coded domains.
Schema

Source: Esri

The structure of a table, including its fields, their definitions, its


domains, and so on, are called the table schema
• This buildings feature class schema has four text fields of
various widths, one domain, and two default values.
A schema can be saved without any data in it and used as a
template to create another empty table with the identical
structure
Table views

Source: Esri

Tables are displayed and manipulated in a Table view


• Rows are called records, and columns are called fields.
• Right-clicking a field name opens a menu of actions.
• The Table Options button provides additional functions.
• The Status bar can be used to view selections.
Table views can be sized and docked like other views
Table view properties

Like layers, table views have properties that affect how the tables
are viewed and displayed
The settings are cosmetic and do not affect the source table
Some common table view settings include
• Aliases for field names to make them more understandable.
• Formatting of fields for consistent decimals or significant
figures.
• Displaying only some of the fields.
• Changing the field order.
Table view properties are set in the Fields view
Fields view

The Fields view is used to view and modify


the properties of tables
• In the default layer mode, shown as US
States, the changes are to the table view
and are only cosmetic.
• If you switch the Fields view to Data
Source mode, the changes affect the
source table and are permanent.
It is critical to be aware of what types of
changes are being made to fields when
using Fields view
• In Data Source view, renaming this
WHITE field is a permanent change.
Source: Esri
Types of changes in Fields view

Cosmetic edits affecting the Permanent edits affecting the


table view properties source table
• Displaying a field. • Adding/deleting a field.
• Setting read-only status. • Changing a field name.
• Changing the display width. • Changing the defined storage
width.
• Formatting numeric options.
• Creating domains.
• Highlighting a field.
• Creating subtypes.
• Changing an alias (in one
table view). • Changing an alias (in all
maps, table views, and
projects).
Editing fields

• To edit a field value, click in


the value box and type a
new value

• Be careful not to change


fields accidently

• The List By Editing panel of


the Contents page can be
used to disable editing of a
layer and avoid accidental
Source: Esri
changes
Calculating fields

The Calculate Field tool can be


used to enter an expression to
calculate new values for a field in a
table
• Existing fields can be used in the
expression.
• Many numeric and string
functions are also available.
• Snippets of Python code can be
used for more complex
calculations.
Source: Esri
Importing Excel data

Source: Esri

Excel worksheets can be read directly by ArcGIS Pro, provided that certain formatting
requirements are met
• The first row must contain legal field names.
• Every column contains one type of data.
• Don’t use n/a or x to indicate missing values in a number column.
• There are no formulas, blank lines, or merged cells.
• A dummy row may help the data type be determined correctly as text, integers, or
floating point values.
NAME, NUM, STREET, CITY, STATE, ZIP, PERCENT
ddd, 999, 999, ddd, ddd, 99.99
Smith, 527, W. Main St., Peoria, Il, 45098, 38.3
A comma-delimited C SV file may work better in some cases
Importing text

Text tables may come in several


formats

a) tab-delimited file
b) comma-delimited file (CSV)
c) fixed-column file
AcGIS Pro cannot read the fixed-
column format, but Excel can be
used to convert one to a CSV

Source: Microsoft, National Climatic Data Center


Review questions

1. What is a feature attribute table?


A feature attribute table is a table associated with a vector data set, which has access to
the data set’s spatial features.
2. Provide an example of a nonspatial attribute table.
An example of a nonspatial attribute table is a table that contains soil attributes but does
not have direct access to the geometry of soil polygons.
3. How does the geodatabase differ from the shapefile in terms of storage of
feature attribute data?
The geodatabase stores feature attribute data in the same table as feature geometries. In
contrast, the shapefile stores feature attribute data in a dBase file, separate from the file
for feature geometries.
Review questions

4. Define a relational database.


A relational database is a collection of tables, also called relations, which can be
connected to each other by keys.
5. Explain the advantages of a relational database.
A relational database has two distinctive advantages. First, each table in the
database can be prepared, maintained, and edited separately from other tables.
Second, the tables can remain separate until a query or an analysis requires that
attribute data from different tables be linked together.
6. Why is a GIS database called an extended relational database?
A GIS database is an extended relational database because it includes spatial data
such as the position and extent of spatial features, in addition to attribute data.
7. Define a primary key.
A primary key represents one or more attributes whose values can uniquely identify
each record in a table.
Review questions

8. Explain the similarity, as well as the difference, between a join operation


and a relate operation.
A join operation brings together two tables by using a key that is common to both
tables, and a relate operation temporarily connects two tables but keeps the tables
physically separate. The two types of operations are similar in that they both link
tables together, but they differ in terms of how the linkage is performed.
9. Suppose you have downloaded a GIS data set. The feature attribute table
has a field that contains values such as 12, 13, and so on. How can you find out
in ArcGIS Pro if these values represent numbers or text strings?
In ArcCatalog, right-click the data set in the catalog tree and select properties. Click
on the Fields tab, and read the Data Type of the field.
Review questions
10. Prove mathematically that 106 is equivalent to 01101010 in binary in 8 bit format.

• Step 1: Divide 106 successively by 2 until the quotient is 0:


• 106/2 = 53, remainder is 0
• 53/2 = 26, remainder is 1
• 26/2 = 13, remainder is 0
• 13/2 = 6, remainder is 1
• 6/2 = 3, remainder is 0
• 3/2 = 1, remainder is 1
• 1/2 = 0, remainder is 1
Step 2: Read from the bottom to top to get binary equivalent in 8 bit
format as 01101010.
Recommended reading:

Price 2nd ed.:Chapter 7

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy