Error Repairing The Layer
Contents |
for Developers Tools to build location-aware apps ArcGIS Solutions Free template maps and apps for your industry ArcGIS Marketplace Get apps and data for your organization Documentation Pricing Support Esri Sign In user My Profile arcgis repair data source Sign Out Go ArcGIS Pro HomeGet StartedHelpTool ReferenceArcPySDKCommunity Repair broken data links When you
Arcgis Batch Change Data Source
open a map or scene in a project, ArcGIS Pro looks for the data referenced by each of the layers in findandreplaceworkspacepaths the map. When a data source cannot be found for a particular layer, that layer doesn't draw, and its broken status is indicated in the Contents pane with a red exclamation point . A layer repair data source arcpy needs repairing if the data source it references has been moved, renamed, or deleted or is inaccessible for some other reason. If you don't know the new location of the data source used by a layer that needs to be repaired, or if that data source is no longer available, you can leave the broken layer as is and continue to work with the map. The broken layer will continue to
Arcmap Set Data Source
be shown in the Contents pane with a red exclamation point. If you no longer need the layer, you can remove it. If the connection to a web layer is broken, you will not be able to repair the data source; instead, remove the broken web layer and add the new web layer to your map or scene.Tip:You can also repair data source links with arcpy.mp. For more information, see Updating and fixing data sources.View all layers with broken linksYou can filter the view of the Contents pane to show only those layers with broken data source links. In the Contents pane, click and click Broken data link. Repair a broken link for one layer If you only want to repair a broken link for a specific layer, you can change the data source property. In the Contents pane, right-click a layer, and click Properties to open the Layer Properties dialog box.Click the Source tab.Click Change data source and browse to the source.Click OK.Repair broken links for multiple layers You may find that several layers in your map need repairing. For example, if a geodatabase containing data sources that are used for multiple layers in your map has been moved or renamed, all these layers will need to be repaired.
Early Adopter Program ArcGIS Ideas Esri Support Services ArcGIS Blogs ArcGIS Code Sharing Product Life Cycles Manage Cases Request Case Start Chat Back to results Print Share Is explain why it might cause problems to run arccatalog and arcmap simultaneously This Content Helpful? Search on GeoNet Submit to ArcGIS Ideas Problem: Repairing arcpy replacedatasource a layer in ArcMap does not restore joins and relates Description When repairing a layer with a broken link, joins and relates that were defined for that layer are not repaired. Cause Joins are not automatically repaired if the join table's workspace differs from the target layer's http://pro.arcgis.com/en/pro-app/help/mapping/map-authoring/repair-broken-data-links.htm workspace. Relates are not repaired when the layer is repaired. Solution or Workaround There are two options for restoring joins and relates.Save the map document using relative paths. With relative paths layers, tables, joins, and relates are automatically repaired if the data has the same directory structure.For more information on relative paths, see Desktop Help > Contents > http://support.esri.com/technical-article/000002959 ArcMap > Creating maps > Referencing data on the map > Storing relative pathnames to data for an entire map.Move the data to the same directory. The join will be restored if the data and the join tables are in the same directory. Created: 5/5/2016 Last Modified: 5/5/2016 Article ID: 000002959 Software: ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcInfo 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1 Is This Content Helpful? Is This Content Helpful? Yes No We're glad to know this article was helpful. How can we make this better? Submit Contact our Support Team Request Case Start Chat Questions or issues with the site? Send Feedback Contact Support USA +1-888-377-4575 Name Email URL Please rate your online support experience with Esri's Support website.* Poor Below Satisified Satisfied Above Satisfied Excellent What issues are you having with the site? How can we improve? Submit Feedback sent successfully. Error while sending mail. Loading
Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business http://gis.stackexchange.com/questions/18607/repairing-broken-links-for-new-paths-of-layers-to-shapefiles-using-arcpy Learn more about hiring developers or posting ads with us Geographic Information Systems Questions Tags Users Badges Unanswered Ask Question _ Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Repairing broken links for new paths of data source layers to shapefiles using ArcPy? up vote 4 down vote favorite I have an .mxd with broken link layers and each layer has a different new path. I know the python script for repairing the broken links of the layers, but I want to put all the new paths of the layers and then let python do and finish all the process. The script that I have does it one at a time. I know if all the repair data source shapefiles are in one path then it's done by performing it once. but what if they al have different paths? To clarify, let's say I have 3 layers with broken links and each one has a different new path now. I'd like to have a GUI with 3 inputs for the new paths altogether or let script do the process one by one and each time asking for the next path to input. arcgis-desktop arcgis-10.0 arcpy share|improve this question edited Jun 8 '14 at 5:26 PolyGeo♦ 39.2k1357144 asked Jan 9 '12 at 9:36 Matt 437417 1 Can you show us what code you have now? –Chad Cooper Jan 9 '12 at 13:03 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted Unfortunately the GUI by itself doesn't know how many broken layers you have, the easiest way to do this might be through the Python promt with a script similar to the following (See the Layer Class documentation for more on the replaceDataSource method): import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") for lyr in arcpy.ListBrokenDataSources(mxd): print "Datasource %s does not exist" % lyr.dataSource workspace_path = raw_input("New Workspace: ") workspace_type = raw_input("Workspace type: ") #See http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer/00s300000008000000/ dataset_name = raw_input("Dataset name (enter for %s): " % lyr.datasetName) if len(dataset_name) == 0: dataset_name = lyr.datasetName #Note, there's no error checking above, so we set validate to True arcpy.mapping.replaceDataSource(workspace_path, worksp