How can I "store relative pathnames" in ArcGIS Pro?

42676
26
Jump to solution
08-30-2017 04:09 AM
SabineSchnichels
New Contributor

Are absolute pathnames the default option? Does ArcGIS Pro always store absolute pathnames or is there a possibility to change this to relative?

26 Replies
ZaferDefne
New Contributor III

My experience is that if you set things up consistently under a parent folder you can move it around (copy/paste to another location, even rename it) in Windows and things don't break. 

See "current settings" under "project" menu. In this example "CHES_shorelines" is my parent folder. 

"Current Settings" under Project menu

0 Kudos
DavidWheelock2
Occasional Contributor II

That's not Relative Pathnames from ArcMap. 

In ArcMap, if you check the checkbox for Store relative pathnames to data sources in the Document Properties window, then pathnames will be stored in notation relative to the current location of the ArcMap MXD, anywhere in the file structure.  It enables the user to copy a file structure to another computer or network location and still have everything work perfectly.  This is a VERY useful and important feature.  If you do not check the box then ArcGIS Pro uses fixed paths which is also very useful.

What the author is asking is, "Where in Pro is the equivalent setting?"  It appears that this setting has not yet been migrated to Pro.

ArcMap Document Properties window:

DavidWheelock2_0-1614379796390.png

You can find documentation for this here:

https://desktop.arcgis.com/en/arcmap/latest/map/working-with-arcmap/referencing-data-in-the-map.htm

and, more specifically, here:

https://desktop.arcgis.com/en/arcmap/latest/map/working-with-arcmap/referencing-data-in-the-map.htm#...

This is an ArcMap equivalence issue.  Yet another important feature that hasn't yet been migrated.

... BUT ...

I just tested all of this and it appears that Relative Pathnames functionality is there and is the default and there's no way to turn it off.  I just created an ArcGIS Pro document with data stored on the same file structure in a folder external to the home folder.  Then I copied both the home and external data folders to a server folder and moved the original source folders so they couldn't be found.  When I open the Pro project from the server copy, it finds all of the data in the new location and everything works fine.

So, how is absolute paths handled?

SUMMARY QUESTION
In summary, from experience with ArcGIS Pro up till now I have observed that:

  • If you copy just the APRX file then fixed paths are used,
  • If you copy the entire home folder and folder structure then Pro uses relative pathnames. 

It appears that Pro is doing this on-the-fly without telling us or giving us the option to choose.  Is this what the rest of you are observing?

Tags (1)
MHeadley
New Contributor

In my experience when doing this and going to run a tool, unless I navigated my export to the new folder location but rather just attempted to run the tool - when you hovered over the "default database" it was still pointing to the original location of the "parent directory".  Also, when I went to expand the folder connections the folders did not appear as they should - they got all wonky and were showing a nested grouping closer to the new location.  I ended up just opening my original template aprx and saving it (copying over) the one in the new location and then manually navigated any exports to the new folder location work area.  Not ideal.

BarryFosberg
New Contributor III

I seem to have come into this problem somewhere in the middle of what some here are addressing. I am using ARCGIS Pro 2.8. I cannot believe this is that hard. Therefore there has to be something I am missing.

I have been creating an involved project on a common drive. This avoids the C:\ issue. Within the home folder for this project I have saved different versions of the project (save as, a new .aprx). This was done to minimize the damage if something got corrupted. This approach is of limited value because the copy is still tied to the original project geodatabase.

 One goal is to create a clean copy of the project, minus the various intermediate, test and otherwise no longer needed model, layer files and etc. To be clear, I want my original project map geodatabase intact, and the new copy to have only the minimum of features and associated materials. There are a few more things to be done, like designing my layer files for symbolizing. At that point I will want to create a final template. It must allow a future user to begin with all the base files, models and symbology .lyr files associated with this assignment. These copies, hypothetically can be anywhere, but are intended to be stored on the common drive, in a project folder.

All without damaging the latest, working map project:

Goal 1 Clean up and finish a project map

Goal 2 create a Project Template for sharing.

At some point I want to delete older copies and perhaps the working map project, but that should be a matter of deleing copies, at no risk to later versions.

First I created another copy of the project map. To it I added a 2nd copy of the original project geodatabase and renamed it. Then changed the source property for each layer to be the new geodatabase.

The project toolbox was still the original project toolbox. Also, every step in a project model/tool pointed to the original project map. The output appears in the new map project. It seems a toolbox either cannot be renamed or copied or doing so requires some not obvious steps.

Finding this unwieldy-

 I reopened the last working copy of the map project and shared it as a project template.

Upon opening the template and saving a new project; it has two geodatabases, one empty and one with the original layers. Both appear to be tied exclusively to the new map project. It also has two tool boxes, both with the original project models/tools.

The good news is that the project models/tools look to be tied to the new map project.

This is a lot of steps. This cannot be the intended process.

KeithOlson
New Contributor III

In my experience, the relative paths functionality in Pro only works within the project's Home Folder. In the case where data is stored on the same drive, but outside your project's Home Folder (like with shared data for multiple projects), relative paths does NOT work.

For example:

- Project Location:  X:\Projects\MyProject\MyProject.aprx

- Home folder:  X:\Projects\MyProject\

- Some layers sourcing X:\Data\SharedData.gdb

In this case, if your colleague has that same drive mapped to a different letter, all the layers sourcing X:\Data\SharedData.gdb will be broken.

curtvprice
MVP Esteemed Contributor

Once the damage is done, this help article points you to various methods of fixing the dreaded red exclamation points in your map or layout Contents, Catalog pane, or Catalog view.

Repair project items

 

0 Kudos
BarryFosberg
New Contributor III

At this point I have project templates.  I will be posting a further question on a thread about Templates verses Packages, but this one is about relative path names.

long set up :

My Goal is a template or package that will allow a particular project to be loaded onto  another machine and run a map project from that machine. In this project the user will supply one data table and it along with one pre-existing feature layer will be put through two models.  The other user should be able to function without any path to any existing data source.

A further complexity is that we are in a One Drive environment. ESRI has not solved all of the problems associated with One Drive. That again is a separate issue.

The one feature that the user must have to run either of this project's two tools is stored in a geodatabase. It looks like the geodatabase is recreated in each new project made from the template. So far so good.

What I cannot test, for the moment, is how well this works from another computer. 

Almost there:

The tools that calls for the feature class seems to work with a path to the geoodatabase like this:

C:\Users\MYLoginName\OneDrive(localDirectory)\HomeDirectory\Map1FmTemplate3_21\MapProject1.gdb .

 

Un fortunately the tool opens in the new project map asking for the feature class with the path:

C:\Users\My long in name\OneDrive - HPD\(Subfolder where the original map project was developed\MapProject1\MapProject1.gdb\feature name

Footnote, the subfolder: OneDrive(localDirectory) is always on my computer and in the cloud, apparently solving some ESRI/ArcPro issues. I am using my C: drive to save computer operating time as our server connection is not that robust.  

 

Actual Question:

In the Template, I think I need to change the path to the geodatabase to something like:

C:\Users\%anyones login name%\

OneDrive(localDirectory)\HomeDirectory\Map1FmTemplate3_21\MapProject1.gdb .

For %anyones login name%

I have tried %name% and %username%

Any suggestion as to the right inline variable to allow a path to whatever C drive is the host drive for their new map project?

 

Bonus Question

The feature class is in the geodatabase in the newly created map project. How do I design the model so that it does not look to the geodatabase back in the original, project development geodatabase?

0 Kudos
curtvprice
MVP Esteemed Contributor
Be very careful with use of OneDrive and Pro (or ArcMap)
More details here:
Esri Tech article 25605: Problem: ArcGIS Pro and Cloud Storage Services
https://support.esri.com/en/technical-article/000025605

BarryFosberg
New Contributor III

Thank you for posting the link. 

I am aware that Pro and One drive are not fully integrated. Part of what I am attempting is to see if I can use the Home Drive with the setting , always stored at this location. I think it could work, but, the testing is beginning to take too much time, when we have common drive that avoids One Drive. 

0 Kudos
PaulRabatin1
New Contributor II

where's the solution?   for relative path?

 

Tags (1)