School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

31
School of Geography FACULTY OF ENVIRONMENT Working with Tables

Transcript of School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Page 1: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

School of GeographyFACULTY OF ENVIRONMENT

Working with Tables

Page 2: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Viewing Attribute Data

• attribute data are organised in database tables

ArcMap

• Right click a data layer in the data frame

• Open Attribute Table

OR create a report or graph

ArcCatalog

• Click on a layer and preview the table

Page 3: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Table Window

• Rows (Records) + Columns (Fields)

• Features or standalone table

• Dynamic contents – move fields, change fonts, freeze

Columns (Fields)Rows (Records)

Unique

ID

Page 4: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Tabular Data Field Types

• Different field types store different kinds of values

• Choose the right field type for the right value

• Field types vary according to table format

• Text, date, short, long, BLOB (graphics), double

• CNTRY_NAME: Russia – text

• POP_CNTRY: 151,827,600 – long

• COLOR_MAP: 3 – short

• SHAPE_AREA: 321294461992.126 – double

• Layer Properties Field tab

Page 5: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Navigating Tables

• Show All or Show Selected features

• Highlight records within show selected view

Show selected and show all views

Navigate rows

Page 6: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Table Window Menus

Menus for row, columns and cells – right-click

Page 7: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Options Menu

Options menu is drop down

Page 8: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Row Context Menu - Identify

Page 9: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

ArcToolbox

• Access this through the ArcToolbox icon:

• Contains a variety of geoprocessing tools

• Functions in ArcToolbox can sometimes be carried out in context menus (right-clicking)

• Extensions will also appear

• Will be looking at some of the Analysis Tools tomorrow

Page 10: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Creating A New Field

• Suppose you want to calculate a value in a table based on existing data

• Need to add a new field

• Can add a field through the Data Management Tool

• Can add a new field through the Options menu in the table

Page 11: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Calculations in a New Field

• Can do this either through ArcToolbox or the Column Context Menu (right-click on column name)

• Both present you with a Field Calculator

• Can also delete the field if you are not happy with it = permanent!

Page 12: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Editing Data in the Table

• Enable the Editing Toolbar (View Toolbars Editor)

• Open the attribute table you want to edit

• Start Editing – headings of the table will go white

• Make changes

• Stop Editing and choose whether you want to save

Page 13: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Working with Tables

Hands-on Exercise #5

Page 14: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Basic Statistics on a Field

• You can generate basic statistics on any field in the table

• Click on the name and right-click to select Statistics

• Does NOT work on text fields

Page 15: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Statistics Summary

• Can move between fields using the drop down box

• Will only see fields that are numerical

Page 16: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Statistics on a Selection

Page 17: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Summarise by a Field

• Might want to sum up occurrences of an event in an area

• Might want to find out the min or max value of an event in an area

• E.g. summarise the number of pupils by LEA

Page 18: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Calculations with Tables

Hands-on Exercise #6

Page 19: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Mapping Spatial Data from External Sources

• Added by user with editing tools (tomorrow)

• Postcode data

• convert to Easting, Northing

• Data from a GPS receiver

• Depends on the GPS, e.g. the GPS might come with a facility to export a route to a shapefile

• Excellent source of information:

http://www.ordnancesurvey.co.uk/oswebsite/gps/

Page 20: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Bringing Data into ArcMap

• Can load Excel files directly into ArcGIS

• Use the Add Data button and select the sheet where the data are located (sheets are given a $)

• Excel files are read only and can only be viewed

• Need to conform to basic conventions:

• One header line

• No spaces in header names

• Do not start headers with a number

• Don’t format cells as %

• KISS principle

One Line Header

No extra data over here

Page 21: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

How to Map the Data - Points

• Geocode your data – turn your postcodes into X,Y coordinates

• Put these values into Excel – two columns with a single header

• For version 9.1, create a .csv, .txt or .dbf file

• Create X,Y data for points

• Tools Add X,Y Data

Page 22: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Mapping Attribute Data from Another Table

• Target table (map) + Source table (which you want to map)

• Joins

• 1 to 1

• Many to 1

• Relates

• Above plus: 1 to Many + Many to Many

• Relationship Classes

Page 23: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Example of a Relational Database

Page 24: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Attribute Join

• Physical connection between two tables

• Appends the attributes of the two tables

• Assumes a 1-to-1 or many[target]-to-1 relationship

Page 25: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Attribute Join Options

• Keep all rows – defaults

• Keep only matching rows

Page 26: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Connecting Tables with Relates

• Defines relationship between two tables

• Tables remain independent

• Can also have 1-to-many and many-to-many relationships

• Make selection and then open related table

• Discovers any related rows

Page 27: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Relate vs Relationship Class

• Relate

• Across different database tables

• Created on the fly in ArcMap, saved in .MXD and .LYR files

• Relationship Class (managed by the geodatabase)

• Permanent relate

• Within the same geodatabase

• Only exists in a geodatabase

Page 28: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Steps on How to Map the Data

• Join the data to a map file so that you can plot it

• Create the file in Excel (and export to .dbf, .csv or .txt if 9.1)

• Follow these basic rules:

• Have a single line header, one name per column

• Avoid spaces or strange characters in the header line

• Avoid formatting as percentages

• Avoid having any extra data outside of the rows and columns of your data

• Avoid starting headings with a number

Page 29: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Steps on How to Map the Data

• In ArcMap, open the file to which you want to add the data

• You can open the .dbf/.csv/.txt file in ArcMap or browse

• Right-click on the layer Joins and Relates

• Choose the column for joining on from the map file that matches the one in the .dbf/.csv/.txt file

• Select or browse for the .dbf/.csv/.txt file

• Select the column in the .dbf/.csv/.txt file that is in common with the map file and then join

• Save the map if you want the join to become permanent (right-click Data Export Data)

Page 30: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Troubleshooting

• <Null> values – can occur if there are features in the map that did not occur in your .dbf/.csv/.txt file – become 0 when join is made permanent

• <Null> values across the board – join was not successful

• Check that you have chosen the correct columns on which to do the join

• Make sure there are no spaces in the name/ids in one column but not the other (hidden spaces)

Page 31: School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.

Bringing Data into ArcMap

Hands-on Exercise #7