{"id":299,"date":"2011-10-29T20:16:43","date_gmt":"2011-10-30T00:16:43","guid":{"rendered":"http:\/\/www.gis.mtu.edu\/?p=299"},"modified":"2015-05-01T09:04:54","modified_gmt":"2015-05-01T13:04:54","slug":"store-relative-path-names-to-layers-in-arcgis","status":"publish","type":"post","link":"https:\/\/www.gis.mtu.edu\/?p=299","title":{"rendered":"Store relative pathnames for layers in ArcGIS"},"content":{"rendered":"<p>By default in ArcGIS 10, <em>full pathnames<\/em> are stored for all layers you add to a map. This means if you have a file located at c:\\data\\hydro\\rivers.shp that&#8217;s used in a map, the full pathname (c:\\data\\hydro\\rivers.shp) to the layer is stored in the map document. ArcMap will always look in c:\\data\\hydro for the file rivers.shp. Using <em>relative pathnames<\/em> allows you to move map documents and layers around, as long as the relative locations of the map document and the data don&#8217;t change, e.g., as long as the <em>map.mxd<\/em> map document and the folder <em>data<\/em> (containing a subfolder hydro with the file rivers.shp, shown below) are moved together, ArcMap will still be able to open the map without issues.<\/p>\n<p><a href=\"https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/folderstru.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-322 aligncenter\" title=\"folderstru\" src=\"https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/folderstru.png\" alt=\"\" width=\"131\" height=\"69\" \/><\/a><\/p>\n<p>To make the change to relative paths for a single map, choose <strong>Map Document Properties&#8230;<\/strong> from the <strong>File<\/strong> menu and check <strong>Store relative pathnames to data sources<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-319 aligncenter\" title=\"srp\" src=\"https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/srp1-300x26.png\" alt=\"\" width=\"300\" height=\"26\" srcset=\"https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/srp1-300x26.png 300w, https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/srp1.png 322w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>If you want all your new maps to be stored with relative paths you will need to specify relative paths as the default. To do so, click <strong>Customize &gt; ArcMap Options&#8230;<\/strong> to open the ArcMap Options dialog box, and then click the <strong>General<\/strong> tab. Check the option to <strong>Make relative paths the default for new map documents<\/strong>. This setting is stored in the registry.<\/p>\n<p>Why should you care about these settings? If you move map documents and data around, say on a flash drive or portable hard drive, these devices can be assigned different drive letters (e, f, g, i&#8230;) depending on what computer they are plugged into. If the drive letter changes between sessions and you are using full path names, ArcMap will be unable to find some, or all, layers in your map, and you will be presented with an exclamation point next to the &#8216;missing&#8217;\u00a0layers:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/nofind2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-307 aligncenter\" title=\"missing\" src=\"https:\/\/www.gis.mtu.edu\/wp-content\/uploads\/2011\/10\/nofind2.png\" alt=\"\" width=\"36\" height=\"23\" \/><\/a><\/p>\n<p>\u00a0Speaking from personal experience, it is a pain to have to re-connect more than a few missing layers, and some maps have dozens. What&#8217;s the process to fix a missing layer?<\/p>\n<ul>\n<li>Open the layer&#8217;s properties, either by double-clicking on the layer name or right-clicking on the layer and choosing <strong>Properties&#8230;<\/strong><\/li>\n<li>Click the <strong>Source<\/strong> tab and then the <strong>Set Data Source&#8230;<\/strong> button, browse to the layer&#8217;s location on your computer, select it, click <strong>add<\/strong>, then <strong>OK<\/strong>.<\/li>\n<li>Repeat for each missing layer.<\/li>\n<\/ul>\n<p>To avoid having to repair any map documents in this fashion, you should either a) never move your map documents and associated files around, or b) use relative pathnames, and store your map documents and data in the same directory (or subdirectories).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default in ArcGIS 10, full pathnames are stored for all layers you add to a map. This means if you have a file located at c:\\data\\hydro\\rivers.shp that&#8217;s used in a map, the full pathname (c:\\data\\hydro\\rivers.shp) to the layer is &hellip; <a href=\"https:\/\/www.gis.mtu.edu\/?p=299\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4],"tags":[17,18,19],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-how-to","category-information","tag-arcgis","tag-paths","tag-tips"],"_links":{"self":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299"}],"version-history":[{"count":19,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":1052,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions\/1052"}],"wp:attachment":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}