#NEWLINE# def county_import( county_shp ) : #NEWLINE# #INDENT# if ( ( '2015' in county_shp ) or ( '2014' in county_shp ) or ( '2013' in county_shp ) or ( '2012' in county_shp ) or ( '2011' in county_shp ) ) : #NEWLINE# #INDENT# county_mapping = { #NEWLINE# #INDENT# 'state_fips_code' : 'STATEFP' , #NEWLINE# 'fips_code' : 'COUNTYFP' , #NEWLINE# 'county_identifier' : 'GEOID' , #NEWLINE# 'name' : 'NAME' , #NEWLINE# 'name_and_description' : 'NAMELSAD' , #NEWLINE# 'legal_statistical_description' : 'LSAD' , #NEWLINE# 'fips_55_class_code' : 'CLASSFP' , #NEWLINE# 'feature_class_code' : 'MTFCC' , #NEWLINE# 'functional_status' : 'FUNCSTAT' , #NEWLINE# 'mpoly' : 'POLYGON' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# county_mapping = { #NEWLINE# #INDENT# 'state_fips_code' : 'STATEFP10' , #NEWLINE# 'fips_code' : 'COUNTYFP10' , #NEWLINE# 'county_identifier' : 'GEOID10' , #NEWLINE# 'name' : 'NAME10' , #NEWLINE# 'name_and_description' : 'NAMELSAD10' , #NEWLINE# 'legal_statistical_description' : 'LSAD10' , #NEWLINE# 'fips_55_class_code' : 'CLASSFP10' , #NEWLINE# 'feature_class_code' : 'MTFCC10' , #NEWLINE# 'functional_status' : 'FUNCSTAT10' , #NEWLINE# 'mpoly' : 'POLYGON' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# lm = LayerMapping ( County , county_shp , county_mapping , encoding = 'LATIN1' ) #NEWLINE# lm . save ( verbose = True )