HowTo: Write an ArcPy script to find maps throughout a folder tree and re-path layer data sources
【相关信息】
Article ID: 41415
Software:
ArcGIS - ArcEditor 10
ArcGIS - ArcInfo 10
ArcGIS - ArcView 10
ArcGIS for Desktop Advanced 10.1
ArcGIS for Desktop Standard 10.1
ArcGIS for Desktop Basic 10.1
Platforms:
Windows XP, Server 2003, Vista, Server 2008, Windows 7, Windows 8, Server 2012, Server 2008 R2
【问题描述】
When data servers are upgraded or replaced, maps with layers that reference data on those systems may need to be updated to refer to data on a different system. The following is an example of a script to replace data sources of raster layers in maps residing in many different subfolders.
As an example, suppose the data sources for all color images were located in:
<drive>:<folder tree>/images/color
Suppose the raster data sources for all black-and-white images were in:
<drive>:<folder tree>/images
The sample script accepts two parameters: the root folder under which there are various subfolders containing maps, and the new path to the image files (all the way down to the /images subfolder).
If this example does not match the file organization in the prevailing environment, the functions illustrated may be helpful in developing a custom workflow.
Article ID: 41415
Software:
ArcGIS - ArcEditor 10
ArcGIS - ArcInfo 10
ArcGIS - ArcView 10
ArcGIS for Desktop Advanced 10.1
ArcGIS for Desktop Standard 10.1
ArcGIS for Desktop Basic 10.1
Platforms:
Windows XP, Server 2003, Vista, Server 2008, Windows 7, Windows 8, Server 2012, Server 2008 R2
【问题描述】
When data servers are upgraded or replaced, maps with layers that reference data on those systems may need to be updated to refer to data on a different system. The following is an example of a script to replace data sources of raster layers in maps residing in many different subfolders.
As an example, suppose the data sources for all color images were located in:
<drive>:<folder tree>/images/color
Suppose the raster data sources for all black-and-white images were in:
<drive>:<folder tree>/images
The sample script accepts two parameters: the root folder under which there are various subfolders containing maps, and the new path to the image files (all the way down to the /images subfolder).
If this example does not match the file organization in the prevailing environment, the functions illustrated may be helpful in developing a custom workflow.
1 个回复
易智瑞技术支持
赞同来自:
The following screenshot shows the Parameters page of a toolbox script object for this Python script.
Related Information
Created: 7/18/2013 Last Modified: 8/26/2013
【原文链接】
http://support.esri.com/en/kno ... 41415
要回复问题请先登录或注册