Is there any way one could store a shapefile inside a geodatabase?

I understand they are two databases from two different times but I recall seeing this done in the past and am curious about how one could replicate it.

  • 2
    It isn't possible to put a shapefile in a geodatabase (personal, file, or enterprise). It is trivial to copy the contents of a non-corrupt shapefile to a geodatbase table. – Vince Apr 30 '19 at 21:30
  • 4
    You can certainly import a shapefile into a geodatabase. The shapefile will still exist, and there will be a feature class in the geodatabase. – mkennedy Apr 30 '19 at 21:51
  • 1
    The answer(s) depend on what you mean by "store" and "inside" and "geodatabase". – Stu Smith May 1 '19 at 2:02

A shapefile is a series of files (*.shp, *.shx, *.dbf, etc). It is not a database.

In theory you can store such files in a relational database as Binary Large Objects (BLOBs) but for considerations when doing that see Should binary files be stored in the database? from the DBA Stack Exchange.

I think a much better approach is to import your shapefile into a geodatabase as a feature class.

| improve this answer | |
  • 3
    Some folks have used the OS file explorer to drop shapefile fragments into a .gdb directory, or create a new .gdb directory for them. Doing so makes it impossible for ArcGIS to access the shapefile, since is is not possible for a file geodatabase table to have a period in the name, and the FGDB dictionary will not have the shapefile's prefix available (unless it was a duplicate, which is extra hairy). After doing this, the fragments must be removed through OS means. – Vince Apr 30 '19 at 23:46
  • @Vince If you get a chance I think your comment would make a great second answer. If not, I'll probably extend my answer to include it at a later date. – PolyGeo May 1 '19 at 0:00

Shapefiles and geodatabases are two different ways of storing feature classes. A shapefile can contain only a single feature class. A geodatabase can store multiple feature classes.

You can copy a feature class between various different storages, including between shapefiles and geodatabases.

To copy a feature class from a Shapefile to a geodatabase in ArcMap, you can use the 'Feature Class to Feature Class' tool.

Ie, 'ArcToolbox' -> 'Conversion Tools' -> 'To Geodatabase' -> 'Feature Class to Feature Class'

For documentation on this tool, see:

Using this tool to copy the feature class doesn't mean that you are copying the Shapefile itself into the geodatabase, but it means that you are conceptually copying the feature class from within the Shapefile into the geodatabase.

Storing an actual Shapefile in a geodatabase doesn't make sense, so I assumed you mean the feature class rather than the Shapefile itself. If you really want to store the Shapefile in a geodatabase, then see PolyGeo's answer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.