# A workflow used to generate county level shape file with mean(z) in each county from an xyz data table in ArcGIS #

*note* this is based on @MLowry's suggestion, adding almost step-by-step instructions. 

--------------
##  Open ArcCatalog##

1.  create new personal geodatabase (e.g. foo.mdb)
1. file -> new -> personal geodatabase 
1.  add data
 * right click on map.csv -> export to geodatabase (single) -> foo.mdb (*note* not clear if this needs to be exported to geodatabase, but this is how I made a table from the csv)
 * right click on counties.lyr -> export to geodatabase (single) -> foo.mdb
 * select map.csv file --> select output geodatabase --> ok

1.  create featureclass (.shp files) from  xy table
 * open foo.mdb
 * right click table
 * input fields x = lon, y = lat, z = yield
 * coordinate system of input coordinates import -> from counties.lyr (or, equivalently,  -> geographic .. -> world -> wgs_1984 -> open -> ok)

1.  import feature classes to geodatabase (multiple)
 * select shp files created in prev. step -> add -> okay

## Open ArcMap ##

1.  Add data
 * select foo.mdb -> CTL + select tables -> open

1.  Spatial Join 
 * ArcToolbox -> Spatial Statistics -> Spatial Join -> Join counties.lyr to xyz table map
 * Z value = yield; select 'mean' (or alternative statistic)