Earthtime gis data source9/26/2023 ![]() Using connectionProperties for updating data sources requires that you work with a dictionary of connection properties. ![]() Using the connectionProperties dictionary Common updateConnectionProperties examplesĪprx = arcpy.mp.ArcGISProject(r'C:\Projects\YosemiteNP\Yosemite.aprx')Īprx.updateConnectionProperties(None, r'C:\Projects\YosemiteNP\DBConnections\Server.sde')Īprx.saveACopy(r"C:\Projects\YosemiteNP\YosemiteNew.aprx") To change a layer's dataset to a feature class with a different name, see the Changing a layer's dataset section below. If no matches are found when you replace the current_connection_info parameter with the new_connection_info parameter in the updateConnectionProperties function, your script may complete, but nothing will be updated. In these cases, the data appears broken in the associated maps. This can be useful for scenarios that require data sources to be updated ahead of the data being created. If the validate parameter is set to False, the data source is set to that location regardless of whether it exists. If that is the case, set this parameter to False.īy default, the updateConnectionProperties method only updates a data source if the new_connection_info is a valid data source. There may be times, especially when updating all data sources at the project level, that you do not want these associated sources to be updated. The auto_update_joins_and_relates parameter allows you to control whether joins and relates associated with a layer or table should be updated. Feature datasets are part of the workspace. If an empty string or None is used in current_connection_info, all connection properties will be replaced with the new_workspace_info, depending on the value of the validate parameter.ĭo not include the names of geodatabase feature datasets in the current_connection_info or the new_connection_info parameters. These parameters can be either a full path to a workspace, a partial string, a dictionary that contains connection properties, a partial dictionary that defines specific keys, or a path to a database connection (. The updateConnectionProperties function can be thought of as a find-and-replace function with which you replace the current_connection_info parameter with the new_connection_info parameter.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |