Select to view content in your preferred language

Table of Contents Feature Class Source Link Update in ArcGIS Pro

134
1
07-17-2024 11:29 AM
Labels (2)
GISUSER6
Regular Contributor

Hello,

I have an aprx project that is a part of a template I have developed for a specific mapping purpose. The template folder that contains an ArcGIS Pro project is supposed to be copied over to the project folder on a different drive and the APRX opened to have scripts ran to complete the mapping. One of the first things the script does is update the source links for the layers. On my computer all of the feature classes hold the source link location in the properties but for my coworker, the link will update to the currently project location plus part of the original source path resulting in a location that does not exist. This is problematic because the script is looking for the template folder location to  update the source links to the new location and if the source link gets updated, it will not recognize the location. Any idea why this would be different between our computers?

0 Kudos
1 Reply
AlfredBaldenweck
MVP Regular Contributor

Yes!

This is because Pro uses relative paths to store layer data sources. That is, it doesn’t remember the address of a file, but how to get to it from the project’s location. 

https://desktop.arcgis.com/en/arcmap/latest/tools/supplement/pathnames-explained-absolute-relative-u....

A way to describe it is like, I don’t know my local library’s address, but I know it’s two blocks north and one block west from my house. 

When you use Windows file explorer, rather than aprx.saveAs(), to move your aprx or copy it, the computer hasn’t caught on to what happened. It’s like you picked up the house and moved it overnight, and the computer wakes up the next morning and still tries to go the library the way it did yesterday: two blocks up, one west. This is now taking it to the vacant lot. What it really needs is to be told “hey actually, it’s three blocks north and seven blocks to the east now”

 

So, how do we fix this issue?

1) Try using arcpy to copy the aprx (or the Save As button on the Project tab).This makes Pro reevaluate the directions to get your data.

2) Try an actual pro project template file. One of the issues with this is that it’s actually just a project package, which means your data gets duplicated unless it’s in an enterprise gdb. (Maybe also a service? Idk.) There’s an idea out there to change this behavior.

https://community.esri.com/t5/arcgis-pro-ideas/project-templates-aptx-have-option-to-store-only/idi-...

 

3) Try using files like LYRX, MAPX, and PAGX instead of a full APRX file. PAGX is pretty sweet since it pulls in your layout canvas and any maps that were in the layout.

https://pro.arcgis.com/en/pro-app/latest/help/layouts/layout-files.htm

 

4) There’s an idea out for giving us the option of absolute paths, like we had in ArcMap. Add a kudo to it. 
https://community.esri.com/t5/arcgis-pro-ideas/need-absolute-path-names-in-pro/idi-p/938348

 

I hope this helps!

 

 

0 Kudos