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##
- create new personal geodatabase (e.g. foo.mdb)
- file -> new -> personal geodatabase
- 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
- create featureclass (.shp files) from xy table
- open foo.mdb
- right click map.csv table --> create featureclass from xytable
- 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)
- import feature classes to geodatabase (multiple)
- select shp files created in prev. step -> add -> okay
Open ArcMap
- Add data
- select foo.mdb -> CTL + select tables -> open
- Spatial Join
- ArcToolbox -> Analysis Tools -> Overlay -> Spatial Join ->
- Target Features: counties.lyr
- Join Features: xyz table map
- Output Feature Class: filename_spatialjoin
- Join Operation: JOIN_ONE_TO_ONE
- Match Option: Closest
- Field Map of Join Features: remove unwanted fields (only STATE_FIPS, CNTY_FIPS, z-values required
- Search Radius: 30km
- click
OK
- Z value = yield; select 'mean' (or alternative statistic)