Skip to content

Instantly share code, notes, and snippets.

@maptastik
Created December 6, 2018 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/64550a3b41bc8f3bc79a744de4b8cd85 to your computer and use it in GitHub Desktop.
Save maptastik/64550a3b41bc8f3bc79a744de4b8cd85 to your computer and use it in GitHub Desktop.
Function that takes a list of shapefiles and adds them to a File Geodatabase
import arcpy
def shp_to_fgdb(shps, out_fgdb):
if isinstance(shps, str):
shps = [shps]
for shp in shps:
out_fc_name = shp.split('\\')[-1].split('.')[0]
print('Working on {}...'.format(out_fc_name))
arcpy.FeatureClassToFeatureClass_conversion(shp, out_fgdb, out_fc_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment