Create large GDB?

660
6
Jump to solution
02-23-2017 12:19 PM
MichaelLenore1
New Contributor III

I am trying to create a geodatabase with many (15000+) shapefiles in it. I have a folder with all the .shps, and I have an empty gdb. I have tried the feature class to geodatabase tool, but it hangs forever - over 45 minutes last time I tried it. What is the fastest way to do this? 

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

You could try python:

import arcpy
arcpy.env.workspace = r"C:\shapefiles_workspace"

shapefileList = []

#Append shapefiles to list
for shapefile in arcpy.ListFeatureClasses("*"):
    shapefileList.append(shapefile)

#Reference output File Geodatabase
out_location = r"C:\file_geodatabase_path\Data.gdb"

#Import Shapefiles
arcpy.FeatureClassToGeodatabase_conversion(shapefileList, out_location)

View solution in original post

6 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Michael,

With 1500+ shapefiles, this may take a few hours depending on the size of all the shapefiles.  I would recommend letting the Feature Class to Geodatabase run overnight and see if it completes by morning.

MichaelLenore1
New Contributor III

Will do - but actually the place it hangs isn't the tool operation, it's the selection of input features. I selected them all (shift click) but arcmap is not responding - that is, I can't click "add" if that makes sense. 

0 Kudos
JakeSkinner
Esri Esteemed Contributor

You could try python:

import arcpy
arcpy.env.workspace = r"C:\shapefiles_workspace"

shapefileList = []

#Append shapefiles to list
for shapefile in arcpy.ListFeatureClasses("*"):
    shapefileList.append(shapefile)

#Reference output File Geodatabase
out_location = r"C:\file_geodatabase_path\Data.gdb"

#Import Shapefiles
arcpy.FeatureClassToGeodatabase_conversion(shapefileList, out_location)
MichaelLenore1
New Contributor III

It's running, and pretty fast! Thanks!

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Go with Python scripting as suggested by Jake if you have worked in Python.

Another alternative would be using Model Builder using iteration.

Examples of using iterators in ModelBuilder—Help | ArcGIS Desktop 

Iterate Feature Classes—Help | ArcGIS Desktop 



Think Location
0 Kudos
BruceHarold
Esri Regular Contributor

Hello Michael

Data Interoperability extension can help you, use a shapefile reader with a directory input and wildcard "*" and write to a single geodatabase feature class.  If you can share data I can give you a sample tool.  You can obtain an evaluation license of Data Interoperability.

0 Kudos