gis lecture 4 geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...gis 5 example kaiser family...

79
GIS 1 GIS Lecture 4 Geodatabases

Upload: others

Post on 13-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 1

GIS Lecture 4 Geodatabases

Page 2: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 2

Outline •Administrative Data Example •Data Tables •Data Joins •Common Datasets •Spatial Joins •ArcCatalog •Geodatabases •Editing Tables •Excel Tips

Page 3: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 3

Administrative Data Example

Page 4: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 4

Administrative Data Mission

• What does the organization do? • Transaction event (who, what, where, when)

-must have spatial component

What data is available? • Databases • Spreadsheets

Page 5: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 5

Example Kaiser Family Foundation

•non-profit, private operating foundation focusing on the major health care issues facing the nation

•independent voice and source of facts and analysis for policymakers, the media, the health care community, and the general public

Page 6: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 6

Kaiser Family Foundation State Health Facts

Page 7: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 7

Collects Data on all 50 States •Demographics and the Economy •Health Status •Health Coverage and Uninsured •Medicaid and SCHIP •Medicare •Health Costs and Budgets •Managed Care and Health Insurance •Providers and Service Use •Minority Health •Women’s Health •HIV/AIDS

Page 8: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 8

Data Tables

Page 9: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 9

Download Data

Page 10: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 10

Download Data

Page 11: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 11

Open data in Excel

Page 12: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 12

Data in Excel

Page 13: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 13

Clean Data in Excel •Delete Unnecessary Data

Page 14: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 14

Save Database Saved as .CSV or .DBF

Page 15: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 15

Data Joins

Page 16: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 16

Add Data Table in ArcMap

Page 17: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 17

Add Shapefile

Page 18: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 18

Choose Fields to Join

Page 19: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 19

Join Data

Page 20: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 20

Fields Added to States Table

Page 21: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 21

Problems with Joins

Must remove dashes!

• Data in fields not exactly the same

Page 22: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 22

Common Problems with Joins •Different data field types

Page 23: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 23

Problems with Joins •Saving .DBF and .CSV files in Excel •Avoid special formats •Keep it simple

Page 24: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 24

Number Fields Important •Quantities

Page 25: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 25

Common Datasets

Page 26: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 26

Common Datasets U.S. Census Maps and U.S. Census Tables

Page 27: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 27

Common Datasets Zip Codes

-Use with U.S. Census data or Geocoding

Page 28: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 28

Place Geocodes: FIPS Codes Federal Information Processing Standards Codes

Developed by the National Institute of Standards and Technology

Codes for Place Names Throughout the World •countries •states/provinces •counties •metropolitan statistical areas (MSA’s) •cities •places - indian reservations, airports, and post offices in the US

Page 29: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 29

Place Geocodes: Hierarchy

Country: US

FIPS CODES

County: 003 (Allegheny) State: 42 (Pennsylvania)

Tract: 0501

Block: 12 (US420030501312) Block Group: 3

CENSUS CODES

Minor Civil Division: 85188 (Wilkinsburg)

Parcel (Block & Lot#)

Page 30: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 30

Other Datasets •Contact agencies •Obtain data on-line

Page 31: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 31

Spatial Joins

Page 32: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 32

Spatial Joins Spatially count points within polygons Join tables using Shape field Join points to polygons or polygons to points

Page 33: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 33

Spatial Joins Join municipality name to points spatially

Page 34: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 34

Spatial Joins Resultant point layer (food points) now contains municipality information

Page 35: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 35

Aggregate Data Summarize on spatial join

- Counts the number of points (records) for each municipality

Page 36: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 36

Aggregate Data Resultant Table

- Count of points (food stores) in each polygon (municipality)

Page 37: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 37

Join Summary Table Join summary table of counts (based on municipality name from sum table) back to municipalities for labeling

Page 38: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 38

Label Counts Label the count of stores from the summary join

Page 39: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 39

Label Counts Show counts as a Choropleth Map

Page 40: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 40

Map with Points

Page 41: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 41

Map without Points

Page 42: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 42

ArcCatalog

Page 43: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 43

ArcCatalog

Page 44: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 44

Metadata

Page 45: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 45

Metadata

Page 46: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 46

Metadata

Page 47: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 47

Metadata

Page 48: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 48

Metadata

Page 49: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 49

Geodatabases

Page 50: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 50

Geodatabase •Represents geographic features and attributes as objects and is hosted inside a relational database management system

•Manages coverages, grids, and shapefiles inside a database management system, or DBMS

Page 51: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 51

Enterprise Geodatabases •Requires a ‘host’ DBMS

-SQL Server, Oracle, or IBM DB2

Page 52: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 52

Personal Geodatabases •Based on the Microsoft JET engine

-Appears as an .mdb file (Microsoft’s JET engine is also used by Microsoft Access).

Page 53: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 53

Geodatabase Advantages •Geodatabases have several important advantages over the traditional file-based GIS data models -Makes GIS datasets smarter -More accurately represent the shape of features -Provides a uniform and IT compliant repository for geographic data -Many users can edit geographic data simultaneously

Page 54: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 54

Geodatabases

Page 55: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 55

Importing Shapefiles into Geodatabases

Page 56: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 56

Importing Tables into Geodatabases

Page 57: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 57

dBASE and Tables

Page 58: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 58

dBASE Tables

Page 59: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 59

Editing Tables Field definitions edited in ArcCatalog Layers cannot be in use elsewhere

Page 60: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 60

Calculator Functions

Page 61: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 61

Calculator Functions

Not just for numeric fields

Page 62: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 62

Excel Tips and Tricks

Page 63: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 63

Excel Tips and Tricks •Formatting •Find and Replace •Transpose •MID Function •Concatenate

Page 64: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 64

Formatting and Replace •Delete any Excel formatting (e.g. borders, patterns, etc.)

•Delete unwanted text (e.g. word “tract”) -Find and replace

Page 65: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 65

Transpose Data •Transpose data

-Some census data saves data as rows instead of columns

-You need transpose the data so that tracts will be a column -Select your data in excel and go to Edit menu and select copy -Click on a cell outside of your selected data and go to edit menu to select paste special…

Page 66: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 66

Now you see the data transposed in the right way. All you need to do is to delete the original rows and save your file.

Page 67: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 67

Mid Function Sometimes, a simple replace won’t do for you to substring a column. In this case, you can use Excel’s mid function to get a subset of a value.

For example, if you have the following data want extract two letters in the middle, say 12 from the first row, and 13 from the second row, and so on, the Excel MID function is your choice.

Page 68: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 68

Mid Function You enter: =mid(A1,4,2) in the cell next to A1. What you tell excel to do is: From cell A1, extract 2 characters starting from the 4th character from left.

Page 69: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 69

Mid Function Then you copy and paste the formula from B1 to the rest of the column and you get what you need.

Page 70: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 70

Concatenate Strings Sometimes you need add certain string before or after a value, and sometimes you want to combine two values. The excel CONCATENATE function makes that happen for you.

Page 71: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 71

If you have the below dataset, and want to combine the state ID and county ID together as another variable and you want to make sure the new StateCountyID has the length of 5

For example, you want to add a “0” to State IDs that are only 1 character long, and you want add “00” to county IDs that that is 1 character long and “0” to those that are 2 characters.

Concatenate Strings

Page 72: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 72

Start by adding a new column right to StateID, and enter:

=IF(LEN(A2)=1,CONCATENATE(0,A2),A2)

What you tell excel is: if the length of the cell A2 is 1, add 0 before the original value, otherwise, keep the original value

Concatenate Strings

Page 73: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 73

After that, you copy and paste the formula to the rest of the column, and you will see the following result

Concatenate Strings

Page 74: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 74

Now let’s solve the problem for county ID. In the cell next to C2, you enter:

=IF(LEN(C2)=1,CONCATENATE("00",C2),IF(LEN(C2)=2,CONCATENATE("0",C2),C2))

What this tells excel is if the length of county ID is 1, add “00” before it, if the length is 2, add “0” before it, if the length is 3, keep the original

Concatenate Strings

Page 75: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 75

Now you copy and paste the formula to the rest of the column and you get the above result

Concatenate Strings

Page 76: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 76

Next, you create a new column called StateCountyID, and enter is the cell E2:

=concatenate(B2,D2)

By this, you are telling Excel to combine the two new columns that you created in the previous steps

Concatenate Strings

Page 77: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 77

Now you just need to copy and paste the formula to the rest of the column and you finally get what you want.

Concatenate Strings

Page 78: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 78

Other Excel Functions You might want to learn some other excel

functions that could help you clean the data, such as: • Right() • Left() • Exact()

Page 79: GIS Lecture 4 Geodatabasesdjjr-courses.wdfiles.com/local--files/soc128...GIS 5 Example Kaiser Family Foundation •non-profit, private operating foundation focusing on the major health

GIS 79

Summary •Administrative Data Example •Data Tables •Data Joins •Common Datasets •Spatial Joins •ArcCatalog •Geodatabases •Editing Tables •Excel Tips