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.
I thought that I could use arcpy.Describe on the workspace, but that is less than ideal :
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!
As an update to this, I solved my original question by just brute-forcing it. I run through a loop of possible workspace types until it works.
If you look at the helpfile on describing a workspace it shows how to get finer granularity with workspace types using the property workspaceFactoryProgID.
Thanks for the response.
I've looked at that property as well, but it doesn't actually give me what I'm looking for.
For example, that would return an empty string for things like Shapefiles, or even standalone rasters.
It wasn't a big deal for ArcMap, but as I turn my attention to Pro with the absolutely awful updateConnectionProperties(), changing datasets requires you to know the workspace type.
Just testing so far, there are at least two types of workspace factory that are unaccounted for.
Is there a full list of potential types floating around somewhere?
Sounds like your research into the issue is good evidence for an ESRI Idea, to improve the list of identifiable workspace types?
Just posted an idea here: Improved documentation for updateConnectionPropert... - Esri Community