Are absolute pathnames the default option? Does ArcGIS Pro always store absolute pathnames or is there a possibility to change this to relative?
The concept of relative paths is a bit different. When you create a project you can have a structure set up for you
so in theory, your geodatabase, home folder etc is already created.
Can you be specific about what it is you are trying to do. When you move 'stuff' if everything is moved 'relative' to the aprx, then there shouldn't be a problem
Check this link...
you may wish to set up a project template for current and future use so your connections are maintained.
Does ArcGIS Pro always store absolute pathnames or is there a possibility to change this to relative?
As far as I understood it, it is exactly the opposite of what you are writing: Pro defaults to using relative paths. This is why there is no setting for relative paths like in ArcMap.
The only "but..." is that, of course, as with ArcMap, in order to have Pro save relative paths, both your data and your project must reside on the same drive. If a certain data set used in your project is on C: and your Pro project (*.aprx) is on D:, there is no other option for Pro than to save the particular data source with an absolute path. This is no different than ArcMap.
I just tested this out to be sure by moving a Pro project of mine from my D: to my C: drive (with all my data referenced from D originally). The project opened fine on C:, and the layer properties show the C: drive as data source. This is a clear indication of default relative paths in the project.
Dan Patterson et al.
We (+Alix Vezina) are working on a shareable ArcGIS Pro "template" but have hit two major issues.
1) Project Template: When using a Project Template, ArcGIS Pro Tasks could not find the models we built and totally broke. Let's skip this for now because maybe templates are not a good approach.
2) Zip and Ship: When we use a more "classic" approach of zipping up all of the resources (ArcGIS Pro Project File, Toolbox, GDB, Folders) - this problem is resolved but we run into another similar relative path issue.
If our Task references a geoprocessing tool or model, the predefined inputs / outputs are still pointing to the original PC. What is the best way to resolve this?
Screenshot below shows it references C:\Users\avezina but this is Alix' PC not mine Note inputs that point to feature layers in the web map are not broken, just the local feature classes stored in the .gdb. Whether it is the Default .gdb or other.
Any help you can provide would be fantastic! As a non-profit we do not get access to Esri Support for ArcGIS Pro
We have an expression in our teaching labs... "Users is for Losers" if you want to lose data, have difficulty accessing data, use your 'users' folder . Sadly it is the default for many programs for installations of 'clones' and other such beasts.
The solution is to ensure that you are aware of the pitfalls and try to avoid them from the get-go.
Here are some examples below, with more at...
Filenames and file paths in Python
# ---- success 1, use 'raw' encoding (small 'r' in front of path)pth = r"C:\Users\avezina"print(pth)C:\Users\avezina# ---- fail 1, \U is a unicode no-nopth = "C:\Users\avezina" File "<ipython-input-3-6108ffe99c8b>", line 1 pth = "C:\Users\avezina" ^SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape# ---- success 2, use forward slashes, but hard to set up without reading a bad pathpth = "C:/Users/avezina"print(pth)C:/Users/avezina# ---- fail 2, you get quasi-smart and switch folders, but discover that there# are other fails, like \a, \t, \n plus otherspth = "C:\other_folder\avezina"print(pth)C:\other_foldervezina
If you were running a script in a tool in a toolbox, I would have a direct option.
I always set my 'paths' relative to the running script
script = sys.argv
This gives the path to the running script... I just parse off the bits I don't want and append the location of such things as other folders and gdb's because I have everything to be contained in one folder when I 'zip and ship'
Dan Patterson thank you for the quick reply. As soon as I clicked "Post" I thought of this myself. When I used to teach ArcMap I encouraged the use of C:/GIS and will go back to that here for this lesson. I just had hoped ArcGIS Pro somehow fixed this since it defaults to the "Documents" folder. It just shows, sometimes you have to go back to basic GIS101!
Has anyone figured out how to use relative links in Pro? This is what my links like in ArcMap. The hyperlink lightning bolt is there.
This is what the look like in Pro.
Do the links need to be in a different format. I want to move my clients to Pro but how will links relative links work?
Retrieving data ...