Is it possible to create relative links to local files residing in a project structure?

3642
5
07-04-2016 01:00 AM
LR
by
Occasional Contributor III

When linking files in ArcMap, I can simply point to a file folder in my (self-created) project structure, which creates the following link:

file:///drive:/pathToMXD/fileFolder/file.extension

However, when I try to do this in AGP, I get this link instead:

file:///C:/Users/%USERNAME%/AppData/Local/Temp/ArcGISPro5924/fileFolder/file.extension

Obviously, this is rather useless. Is there any way to replicate ArcMap's behavior?

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

how did your organize your project? see the copy/move the project section at the bottom of this link

Save a project—ArcGIS Pro | ArcGIS for Desktop

and this link as it relates in general and specifically to scripting, tool access etc.

0 Kudos
LR
by
Occasional Contributor III

The AGP project is in a project folder on a drive and was created through the new project option within AGP. It looks like this:

  • D:\AGP_Projects\myProject\
    • project.aprx
    • vectordata.gdb
    • raster_data (folder)
    • file_folder (containing data I want to link)

The manually set up ArcMap project is more or less the same:

  • D:\AM_Projects\myProject\
    • project.mxd
    • vectordata.gdb
    • raster_data (folder)
    • file_folder (containing data I want to link)
0 Kudos
curtvprice
MVP Esteemed Contributor

(UPDATE: I reread the help and clarified some things. Thanks Dan Patterson‌ for your comments)

This is important. I'm surprised this thread went dark. The issue here is how do you zip up a project with its data.

Dan's link to the help is definitely where this information is stored. I think they need another article compare/contrast with ArcMap 10x to help clarify how it works in Pro. I added some emphasis below. Note the "home folder" concept - similar to the scheme in ArcMap, the home folder is the system folder in which the .aprx resides. 

If you copy or move only the project file to a new location, for example, using Windows Explorer, connections to all items accessed by a relative path will be broken; however, ArcGIS Pro will try to locate the item in its original location. (...) Items accessed by an absolute path will still be accessible if those paths can be resolved (exist) when the project is opened in its new location. (...) To fix a broken connection, remove the broken item and add it to the project again using an appropriate path.

HOWEVER it seems relative paths work within the project:

If you copy or move the project's home folder to a new location using Windows Explorer, relative paths used to access the default geodatabase, the default toolbox, and other items stored in the home folder  along with the .aprx file will not be broken. To save a copy of the current project that includes a copy of all the data and items referenced by the project, create a project package. This is the best way to share a project you have been working on with someone else.

I'm not such a big fan of the project package idea because everything gets unpacked in to the users home folder, which for many organizations could be a network folder (%HOMEDRIVE%%HOMEPATH%\Documents\ArcGIS) and could gradually get filled with many gigabytes of .aprx files opened once. Unless I'm missing something.

I would really like a GP tool and maybe an app to handle user connections in ArcMap and project connections in Pro.

Discuss.

DanPatterson_Retired
MVP Emeritus

Not only dead... deleted ...

I have never had problems finding data... I store locally, if it is that important to me.  Everything is in a subfolder within the folder containing the mxd or aprx.  I keep mxd's and aprx' in the same folder if I am using both on a project.  The gdb's for each are in a separate folder.... duplication perhaps, but no screw ups for sure.  Ditto for rasters and shapefiles.  I have a common script folder since I use python 3.4 or above (conda).  I know from teaching that there is a 'misconception' some times that 'relative' means on the same machine or in the horrid c:\users\blah folder.  In short, I use no defaults... everything is organized so I can zip the whole structure... copy to a usb/cloud location and unzip and continue anywhere else I have to go.  Just don't try to use stuff of usb drives, I copy to a machines local drive and unzip.  Works for me

MattWilkie3
Occasional Contributor II

This is great! Dan, if/when you have time and willingness, would you consider expand on and describing your structure here? https://community.esri.com/message/830901-folder-structure-for-shared-pro-and-map-projects 

0 Kudos