I've inherited a large somewhat messy database and am attempting to clean it up a bit. Does anyone know if it is possible to search a database to see what arcGIS map documents use a feature class? I'd like to delete old versions of my feature classes, but don't know if they are in use in a mxd somewhere. This would also be useful to see what mxds need to be updated because they're using old versions of data. I'm envisioning a search in ArcCatalog that specifies a feature class and returns a list of mxds and maybe relationships that use said feature class.
Any suggestions appreciated. Thanks in advance!
Answer
Funny this as I've just spent the last few days developing Python code to do this... Chad's link is definitely the page you need to be looking at and PolyGeo's link to the walk
function is useful too.
I developed 3 scripts: one for trawling the drive space searching for datasets, a second to trawl for MXDs then extract all the layer information and a third to fix broken links (after everything had been moved to a new folder structure).
Top tips:
- You may have 1 or more dataframes to search.
- You may have the same dataset duplicated but different featurelayer names.
- You may have layers with no featurelayer names.
- You may have datasets that are not in any mxds.
- You may have datasets referenced in the MXD but do not exist anymore or inaccessible locations such as document and settings.
- You will almost certainly have crazy names with superscripts or commas which need dealing with in Python.
- I found that the dataset name referenced in the mxd is not necessarily in the same case as what's on the drive so making text matching problematic.
- A raster dataset may be simply an image such as a logo so you need to exclude these from your search.
- When you use the
da.walk
function and ask for tables it will return any text file and even asc files for some reason.
You'll need to consider all these scenarios and probably more for your setup.
No comments:
Post a Comment