Hi all,
I'm trying to mass replace datasources. I have my dictionary, I have my general workflow, and initial testing is working fine on the test files I'm using, all of which are feature classes in file gdbs. I'd like to expand it to other file types.
Where I'm running into trouble is using arcpy.mapping.replaceDataSource() , specifically the workspace type parameter.
It seems that arcpy can't figure out the workspace type by itself, so we have to provide it.
- ACCESS_WORKSPACE — A personal geodatabase or Access workspace
- ARCINFO_WORKSPACE — An ArcInfo coverage workspace
- CAD_WORKSPACE —A CAD file workspace
- EXCEL_WORKSPACE —An Excel file workspace
- FILEGDB_WORKSPACE —A file geodatabase workspace
- NONE —Used to skip the parameter
- OLEDB_WORKSPACE —An OLE database workspace
- PCCOVERAGE_WORKSPACE —A PC ARC/INFO Coverage workspace
- RASTER_WORKSPACE —A raster workspace
- SDE_WORKSPACE —An SDE geodatabase workspace
- SHAPEFILE_WORKSPACE —A shapefile workspace
- TEXT_WORKSPACE —A text file workspace
- TIN_WORKSPACE —A TIN workspace
- VPF_WORKSPACE —A VPF workspace
I thought that I could use arcpy.Describe on the workspace, but that is less than ideal :
- FileSystem —File-based (coverage, shapefile, and so forth) workspaces and in-memory workspaces
- LocalDatabase —Geodatabases that are local (a file or personal geodatabase)
- RemoteDatabase —Geodatabases that require a remote connection (enterprise, OLE DB, and so forth)
As you can see, that gives me a very vague idea of what I'm working with.
I also thought that maybe I could Describe() on the new data sources themselves, but for example, a coverage just says "Coverage", rather than the coverage type.
Is there an easy way to determine workspace type?
Thanks!