laptop and a wrench

Error

In ArcGIS Pro, when opening a layer file (.lyrx) from a network drive and uploading it as an item to Portal for ArcGIS, an error message is returned, "Need to Repair data source of layer."

Última publicación: July 13, 2021 Portal for ArcGIS
Número de ID del error BUG-000140521
EnviadoJune 7, 2021
Última modificaciónJune 5, 2024
Relacionado conPortal for ArcGIS
Versión encontrada10.6.1
Sistema operativoWindows OS
Versión de sistema operativo10.0
EstadoAs Designed

Información adicional

The behavior described is correct based on how ArcGIS Pro is designed. If the workflow described and care has not been taken to access data in the original map via UNC paths, it is expected that the map layers break when the layer file (.lyrx) is added to map after sharing it to a portal. In an ArcGIS Pro project, paths to datasets are handled as either relative paths or as absolute paths depending on where the project and the data are stored. Data stored on the same disk as the project are referenced by relative paths. Data stored on other disks or in a network location are referenced using absolute paths. This same method of accessing data applies when a map or a layer is saved to an external map file (.mapx) or layer file (.lyrx) in this scenario. For example, if the project is stored at C:\Data\MyProject and the data is stored elsewhere on the C:\ drive, the project accesses the data on C:\ by relative path and any data stored on a T:\ drive is accessed by absolute path. When the definition of a map layer to a layer file (.lyrx) is saved, if the layer file (.lyrx) is stored to the same C:\Data\MyProject location as the project, it uses the same relative path as the project. However, if the layer file (.lyrx) is stored in C:\Test instead, the relative path is recalculated and the layer file (.lyrx) uses a different relative path to access the data than the project. Similarly, if the layer file (.lyrx) is saved to the T:\ drive, then any data stored on the C:\ drive is accessed by absolute path and data stored on the T:\ drive is then accessed by a path relative to the storage location of the output layer file (.lyrx). After creating a layer file (.lyrx), the layer file (.lyrx) is uploaded as-is to the portal. When 'Open in ArcGIS Pro' is clicked from the item details page in a browser, the layer file (.lyrx) ends up being downloaded to the local machine in the {userName}\Documents\ArcGIS\Packages folder by default, or some other location designated on the local machine. This process merely downloads the file. These paths in the layer file (.lyrx) remain exactly as they were at the time in which the original layer file (.lyrx) is created. However, the location in which the layer file (.lyrx) is stored is not the same as its original location even if both locations are on the same computer. Any relative paths that are originally calculated for the original location are broken because they are not calculated for the layer file's (.lyrx) current location. To share the map layer with other people without having to repair the broken map later, there are two options: 1) Create a layer package and upload the layer package to the portal instead of sharing a layer file (.lyrx). 2) Take care when building the original map in ArcGIS Pro to access all data using a UNC path that can be accessed from any computer used by anyone who has access to the portal item. Data from mapped network drive is accessible if everyone in the organization uses the same drive letter to access the same data on the network. Save the output layer file (.lyrx) to the local machine and upload the local file to the portal. This ensures all network data is accessed via absolute paths. There are other existing enhancements in the backlog requesting more information about how data is accessed in projects, and to provide other capabilities to better assess the data referenced by a project so people can make better decisions about how to build, move, and share their projects. See ENH-000137919 and ENH-000084097.

Solución alternativa

Repair the layer manually by pointing it to the correct data location.

Pasos para reproducir

ID del error: BUG-000140521

Software:

  • Portal for ArcGIS

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga