{"id":2328,"date":"2019-03-08T10:07:11","date_gmt":"2019-03-07T21:07:11","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=2328"},"modified":"2023-05-07T03:25:22","modified_gmt":"2023-05-07T03:25:22","slug":"default-workspaces","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/default-workspaces\/","title":{"rendered":"Paths to Good GIS: Default Workspaces"},"content":{"rendered":"<p><em>Setting default workspaces is a good data management habit to get into &#8211; it may save you lots of heartache when saving new layers.<\/em><\/p>\n<p>There are lots of things that contribute to doing good GIS work, and practicing good file management has to be near the top.\u00a0 Anyone who has done any amount of GIS will know how important data are, and, often through bad experiences, just how important managing those data is.\u00a0 In this ongoing series, &#8220;Paths to Good GIS&#8221;, I hope to cover some of them.<\/p>\n<p>In a previous post we looked at a number of <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/fixing-common-arcgis-problems\/\">common ArcGIS errors<\/a> that can occur and how to fix them.\u00a0 Good data management is more about maintaining the fence at the top of the cliff rather than the ambulance at the bottom.\u00a0 There are many aspects to good data management, and saving things in the right place is one important part of that.\u00a0 There are few things worse than not being able to find the data you need when you need it; using default workspaces is a helpful way to avoid that.<\/p>\n<p>When running just about any geoprocessing tool, you will usually be saving an output layer or table in a specific place.\u00a0 Setting a default workspace at the start of a project helps to ensure that specific place is always used.\u00a0\u00a0Default workspaces work primarily with geodatabases.<\/p>\n<p><strong>The Default Geodatabase<\/strong><\/p>\n<p>Everyone (who&#8217;s anyone) already has a default geodatabase, usually hidden in your H: drive.\u00a0 If you have a look in your H:\\My Documents\\ArcGIS you&#8217;ll see two geodatabases: Default and scatch.\u00a0 Here&#8217;s what my folder looks like:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/MyDefaultGDB.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2329\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/MyDefaultGDB.jpg\" alt=\"\" width=\"419\" height=\"532\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/MyDefaultGDB.jpg 554w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/MyDefaultGDB-236x300.jpg 236w\" sizes=\"auto, (max-width: 419px) 100vw, 419px\" \/><\/a><\/p>\n<p>Normally, any tool you try and run will want to save the output here &#8211; as shown below in this tool window:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/DGDBBuffer.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2330\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/DGDBBuffer.jpg\" alt=\"\" width=\"663\" height=\"406\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/DGDBBuffer.jpg 875w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/DGDBBuffer-300x184.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/DGDBBuffer-768x470.jpg 768w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/a><\/p>\n<p>Outputs\u00a0can end up\u00a0in this land of lost layers if you&#8217;re not careful.\u00a0 If a layer goes missing on you, chances are it&#8217;s here, but most people don&#8217;t know this exists.\u00a0 Excuse the pun, but by default, this is your default geodatabase (hence the name).\u00a0 As you can see, mine is slowly getting filled up when I use this for in-class demos or when I&#8217;m in too much of a hurry.<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/crowded.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2331 alignleft\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/crowded.jpg\" alt=\"\" width=\"315\" height=\"585\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/crowded.jpg 372w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/crowded-162x300.jpg 162w\" sizes=\"auto, (max-width: 315px) 100vw, 315px\" \/><\/a><\/p>\n<p>(And that&#8217;s not even everything in there . . .)<\/p>\n<p><strong>Setting a new Default Geodatabase<\/strong><\/p>\n<p>It&#8217;s quite easy to\u00a0set a new default geodatabase yourself.\u00a0 First off, you want to be storing all of your project related data in one folder &#8211; this is good practice.\u00a0 All map related\u00a0files should be kept in this folder &#8211; map documents, spreadsheets, layers, everything.\u00a0 Second, if you&#8217;re working with a geodatabase (recommended), create it inside that folder.\u00a0 You can set all these up using the Catalog window in ArcMap.\u00a0 Click the Catalog button, <a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalog.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2332\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalog.jpg\" alt=\"\" width=\"39\" height=\"36\" \/><\/a>, to open this &#8211; a window will open at the right:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalogopen.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2333\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalogopen.jpg\" alt=\"\" width=\"1443\" height=\"796\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalogopen.jpg 1443w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalogopen-300x165.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalogopen-1024x565.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/catalogopen-768x424.jpg 768w\" sizes=\"auto, (max-width: 1443px) 100vw, 1443px\" \/><\/a><\/p>\n<p>Navigate to your new (or existing) geodatabase, right-click it and select &#8220;Make Default Geodatabase&#8221;<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/SetDGDB.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2334\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/SetDGDB.jpg\" alt=\"\" width=\"412\" height=\"671\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/SetDGDB.jpg 491w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/SetDGDB-184x300.jpg 184w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/a><\/p>\n<p><em><strong>(Quick! Save your map!\u00a0 Now!)<\/strong><\/em><\/p>\n<p>Next time you run a tool, it will want to save the output to that location:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/WithDGDB.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2335\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/WithDGDB.jpg\" alt=\"\" width=\"876\" height=\"536\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/WithDGDB.jpg 876w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/WithDGDB-300x184.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/WithDGDB-768x470.jpg 768w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/a><\/p>\n<p>That&#8217;s one less thing I&#8217;ve got to worry about now.<\/p>\n<p>ONE IMPORTANT THING: a default geodatabase\u00a0you set up belongs to that map document so you would need to do this for every new map document you start.\u00a0 You can&#8217;t do it the same way in ArcCatalog BUT you can do it from within tools run in ArcCatalog<\/p>\n<p><strong>Setting Default Geodatabases in ArcCatalog<\/strong><\/p>\n<p>When running tools from ArcCatalog, you can set this default workspace by clicking on the Environments button at the bottom of a tool:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/Environments.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2336\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/Environments.jpg\" alt=\"\" width=\"560\" height=\"71\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/Environments.jpg 560w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/Environments-300x38.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>Clicking this opens up a whole new set of settings;<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/EnvironmentsWindow.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2337\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/EnvironmentsWindow.jpg\" alt=\"\" width=\"878\" height=\"543\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/EnvironmentsWindow.jpg 878w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/EnvironmentsWindow-300x186.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2019\/03\/EnvironmentsWindow-768x475.jpg 768w\" sizes=\"auto, (max-width: 878px) 100vw, 878px\" \/><\/a><\/p>\n<p>Top of the list is &#8220;Workspace&#8221;.\u00a0 \u00a0When expanded this you can set the geodatabase that will be used when tools are run from ArcCatalog in this session.<\/p>\n<p><em>(By the way, a scratch workspace is mainly used to store temporary files when using <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/flow-diagrams-that-work\/\">ModelBuilder<\/a>.<\/em>)<\/p>\n<p>Setting a default geodatabase is one small\u00a0step of good data management but one giant leap to doing better GIS.<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting default workspaces is a good data management habit to get into &#8211; it may save you lots of heartache when saving new layers. There are lots of things that contribute to doing good GIS work, and practicing good file management has to be near the top.\u00a0 Anyone who has done any amount of GIS [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2328","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/2328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/comments?post=2328"}],"version-history":[{"count":1,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/2328\/revisions"}],"predecessor-version":[{"id":4111,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/2328\/revisions\/4111"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=2328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=2328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=2328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}