690 likes | 712 Views
Attribute Tables. Data table format. Rectangular table with one value per cell Columns (fields) are attributes Rows are observations (data). Data table format. First row must have column names that are self-documenting labels e.g., Pop5To17, Area First character is a letter
E N D
Data table format • Rectangular table with one value per cell • Columns (fields) are attributes • Rows are observations (data)
Data table format • First row must have column names that are self-documenting labels • e.g., Pop5To17, Area • First character is a letter • Remaining characters can be any letter, digit, or the underscore character (but no blanks) • All additional rows of a data table must contain only attribute values • None of the rows can be sums, averages, or other statistics for other rows • Sometimes columns can be functions of other columns (sums, averages, etc.)
Primary keys Each data table has a primary key with two properties • Each value in the attribute column is unique • There are no null values
FIPS Geocodes • Federal Information Processing Standards • 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 • See http://www.genesys-sampling.com/pages/Template2/site2/61/default.aspx for additional geocodes.
FIPS Geo codes: Hierarchy FIPS codes Country:US State:42(Pennsylvania) County:003(Allegheny) Minor Civil Division: 85188 (Wilkinsburg) Tract: 0501 Census codes Block Group: 3 Block:12(US420030501312) Parcel (Block & Lot#) Local government cadastral data
ANSI Codes • American National Standards Institute (ANSI) • Codes • www.census.gov/geo/www/ansi/ansi.html • Replaces FIPS codes • In many cases, the codes are the same (e.g. Pennsylvania, Allegheny County = • 42003)
External table file formats for import to ArcGIS • Plain ASCII text with comma separated values (.csv) • Very transportable format, very large files • Each table record is a row terminated with a line-break character • Has values separated by a delimiter, usually a comma • For data values that contain the delimiter, enclose the value in double quotes • Sometimes columns get wrong data type on import (use double quotes to force text data type for digits, say for house numbers)
External table file formats for import to ArcGIS • Excel (.xls, .xlsx) • Excel 2003, up to 65,000 rows and 256 columns • Excel 2007, up to 1,048,576 rows and 16,384 columns • dBase database table(.dbf) • Legacy format • ArcMap truncates field names to 1st 10 characters • dBase IV has max of 255 columns • Can open dBase file in Excel but cannot save Dbase from Excel • Microsoft Access database (.mdb) • Up to 2GB file size • See following for other limits: http://www.databasedev.co.uk/access_specifications.html
Field calculator (numeric) • Calculate acres to square miles
Field calculator (text) • Concatenate house number and street fields
Field calculator (text) • Populate field with county name
Joins • Feature attribute tables, data tables • Puts two tables together, on the fly, to make one table • One-to-one join • One-to-many join
Example join • U.S. Counties GIS layer • + • Unemployment databases • =
Join Data • Right-click Counties layer > Joins and Relates > Join
Classifying Unemployment • Values will only appear with number fields
Final Map Percentage Unemployment by U.S. Counties, 2005
Problems with Joins • Field types are different (e.g. one is numeric and one is text)
Must remove dashes! Problems with Joins • Data is different
Problems with Joins • Too much formatting in Excel • Keep it simple!
Spatial Joins • Joins using shape (not attribute field) • Enables data aggregation (counting or summing points by polygon) • Common Spatial Joins • Points to Polygons (counts) • Polygons to Points (adds text) • Points to points (distances)
Points to polygons How many convenience stores are in each neighborhood? • Start with: • Store points • Neighborhoodpolygons
Points to polygons • Right-click neighborhoods > Joins and Relates > Join
Spatial join result • New polygon layer with count of points (number of stores)
Spatial join result • Show as a choropleth map, with labels, or table
Polygons to points What neighborhood is a store in? • Start with: • Store points • Neighborhoodpolygons
Polygons to points • Right-click business points> Joins and Relates > Join
Spatial join result • Point shapefile with neighborhood data on each store
Points to points • How close is a school to a store? • Start with: • Store points • School points
Points to points • Right-click school points> Joins and Relates > Join
Geodatabases A geodatabase is a container used to hold a collection of datasets (GIS features, tables, raster images, and other objects). • Country layer • World.gdb • Graticule layer
Geodatabase types • File geodatabase (.gdb) • stores datasets in a folder of files • each dataset a file up to 1 TB in size • can be used across platforms • can be compressed and encrypted for read-only, secure use • ESRI’s recommended choice
Geodatabase types • Personal geodatabase (.mdb) • stores datasets in a Microsoft Access format • storage sizes between 250 and 500 MB • limited to 2GB • only supported on Windows • ArcSDE geodatabase • stores datasets in a number of optional DBMSs: • IBM DB2, IBM Informix , Microsoft SQL Server , Oracle, or PostgreSQL • unlimited size and users
New file geodatabase ArcCatalog
Import into geodatabase Shapefile features
Import into geodatabase • Tables
View geodatabases • Cannot identify names in Windows Explorer • Must use ArcCatalog
Compact geodatabases • File and personal geodatabases • Reduces size and improves performance • Compact personal geodatabases > 250 MB. • Geodatabases with frequent data entry, deletion, or general editing • Open geodatabases in ArcMap cannot be compacted • remove any layers with a source table or feature class in that database from the TOC
Compress geodatabases • File geodatabases • Once compressed, a feature class or table is read-only and cannot be edited • Compression is ideally suited to mature datasets that do not require further editing • Compressed dataset can be uncompressed to return it to its original, read-write format