[GIS] ArcMap creates unnecessary file types when saving shapefile (.cpg .prj, lock, etc.)

arcgis-desktoparcmapshapefile

When saving shapefiles, geocoding results or even exporting data in ArcMap, many different files are created. Most of the time when I save a shapefile, I want only the shapefile and not a .cpg, .prj, lock file, etc.

Is there a way to tell ArcMap (desktop version) using either the UI or Python code, to only save one file when saving shapefiles, dBase tables, etc.

Best Answer

You may have some "unnecessary" files being created but ArcMap requires 3 files at a minimum for a shapefile to be usable. The absolute minimum is: SHP, SHX and DBF. The PRJ is also very helpful because it defines what coordinates system your shapefile is in.

Some of the others are related to spatial features and are not strictly necessary, but ArcMap will recreate them the next time you open the shapefile in ArcMap anyway, so deleting them won't do you any good in the long term.

Two options for better organization of your files are:

  • Use ArcCatalog to view your files, instead of Windows Explorer - this way you will only see one item for each shapefile. All of the files will remain in Windows Explorer but you will have a much cleaner view in ArcCatalog
  • Store your data in a Geodatabase rather than in shapefiles - Storing your data in a GDB will clean up the look and function the same way in ArcMap. It will appear as one MDB file/folder in Windows Explorer - if you look inside it is messy but you don't want to do anything with it in Windows Explorer, use ArcCatalog or ArcMap.
Related Question