Introduction to Geographic Information Systems in Forest Resources
UW Home GIS@UW Search
Syllabus Schedule Class Meetings Assignments Course Data Internet Search

Current Grades

Contact Us CFR 590 Internet-only section Lab Locations  


Exercise: Project and Data Management

Objectives:

Important note:
If you are not comfortable using hierarchical file structures (e.g., the Windows Explorer), you should remedy this as soon as you can. Using hierarchical file structures effectively is important in GIS as well as any other computer application you will use in the future. There are a number of web resources on hierarchical file structures, such as the notes on webpoedia. Today's notes assume you know something about hierarchical file structures and how to navigate up and down directories and disks.


  1. Create an ArcView 3.x project
  2. Set the Working Directory
  3. Copy a grid theme data source
  4. Copy and rename a TIN theme data source
  5. Delete a grid theme data source
  6. Copy an image theme data source
  7. Convert a coverage theme to a shapefile
  8. Rename and move a shapefile
  9. Archive a set of data
  10. "Move" an ArcView 3.x project

 


Create an ArcView 3.x project

  1. Use the Startup Project to create a new project.

  2. Remember to always use the startup project to reopen projects that have been built using the startup project.


Set the Working Directory

  1. Create a new view in your project.

  2. From the File menu, select Set Working Directory. This menu choice is only available in the View menu.

  3. The Work Directory dialog will appear. Change the value to the path to the root directory of your removable disk. It is important that you become aware of the drive letters of the different disks on the machines you use ArcView 3.x on, as well as the path names to different files and directories. Your drive letter may be different than the one shown below.



    You will also need to become comfortable the relationship between a path name and the graphical representation of the file system structure. For example, in this image you can see the hierarchical file structure in the graphical part of the Windows Explorer, but you can also see the path name in the Address control.




You have just specified the working directory. Whenever ArcView 3.x creates a file, by default it will be placed in the working directory. You will usually have the opportunity to select a different location if you want, but in some operations, data sets are automatically placed in the working directory without any interaction. You should always take the time to set the working directory for each and every project.

 


Copy a grid theme data source

  1. If your computer does not have a C:\temp directory, create one now using the Windows Explorer. Keep the Windows explorer open.

  2. Turn on the Spatial Analyst Extension (File > Extensions > Spatial Analyst from the menu).



  3. Create a new view, and make sure it is the active document.

  4. From the File menu, select Manage Data Sources.

  5. Navigate to the packgis\forest directory on the CD drive.

  6. Select Grid as the Source Type. (Note: your CD drive may have a different drive letter.)



  7. Click on dem and then click the Copy button.

  8. Note that by default the location where ArcView 3.x wants to put the data set is on your removable disk, since that is where you set your working directory.

  9. Navigate to the C:\temp directory and call the new grid pf_dem. Note: you will need to switch drives as well as directories to go from the removable drive to your C:\temp directory.

  10. Click OK to start the copying process.



    You will need to wait a minute or two as the files copy. You will see the computer's disk lights flashing as the files copy. In the mean time you can entertain yourself with the Onion.

  11. After the file copies, you can dismiss the Source Manager dialog.

  12. View the contents of C:\temp in the Windows Explorer to see the effect of the copy. Note that in addition to the pf_dem directory there is an info directory.

  13. Add the new theme to your view. Make sure to select Grid Data Source from the Data Source Types dropdown.



  14. Turn the theme on. This is a grid (raster) data set representing elevation (in feet) for Pack Forest.



  15. Finally, delete the theme from your view and save the project.

 

You have just copied a grid theme data source from the CD to a place on the system hard drive. We will use grid themes extensively during the class sessions on raster analysis. You will use this functionality later on, or if you need to copy a grid data set to a different machine or for a different user.

Remember, never use the Windows Explorer to copy, move, or rename grid data sources. You will corrupt your data.

As you can see, it is not necessary to load the grid theme into the current view before making the copy. Data sources that can be managed by ArcView 3.x do not need to be loaded; in fact, if data sets are loaded into the project, you can copy them, but you will not be able to rename or move the data sets until they are completely removed from the project. ArcView 3.x "holds on" to data sets that are currently loaded in the project.

If you do want to manage grid data sets, you will need to enable the Spatial Analyst Extension.

 


Copy and rename a TIN theme data source

Copy:

  1. Turn on the 3D Analyst Extension.



  2. Reset your working directory to C:\temp. This will make the default location for new data sets switch from your removable disk to C:\temp.

  3. From the File menu, select Manage Data Sources.

  4. Navigate to the packgis\cfr250 directory on the CD drive.

  5. Select TIN as the Source Type.

  6. Select the TIN pf_tin.



  7. Copy the pf_tin TIN to the C:\temp drive as pf_tin.
    1. To do this, select pf_tin, then
    2. Click the Copy button, then
    3. Navigate to the C:\temp directory and click OK.



      It will take some time to copy the TIN.

  8. Dismiss the Manage Data Sources dialog.

  9. Again, view the contents of your directory in the Windows Explorer.

Rename

  1. Save the project now in case of a crash.

  2. From the File menu, select Manage Data Sources.

  3. Navigate to the C:\temp directory and select the TIN pf_tin.

  4. Click the Rename button.

  5. Navigate to the C:\temp directory and call the new TIN pf_tin_bk.



  6. ArcView may crash here with



    If this happens, close ArcView and re-open (remember, you just saved a few steps ago).

  7. Dismiss the Manage Data Sources dialog.

  8. Again, take a look at your Windows Explorer.

  9. Finally, add the data set to your view.



  10. Turn the theme on.

 

You have just copied a TIN data source from the CD to the hard drive and then renamed the TIN data source. TINs are surface models, which can also represent any numerical phenomenon across the landscape. TINs are generally smaller in file size than grids, so the copy occurs much more quickly. In order to use or manage TINs, the 3D Analyst must be enabled. We will use TINs later in the course during the module on 3D display and analysis.

Remember, never use the Windows Explorer to copy, move, or rename TIN data sources. You will corrupt your data.

You can also use the Rename function to rename grid, TIN, or shapefiles to other file system locations or to different names at the same location.

When you rename data sets, if you select a different directory, the data set will be moved to the target directory. You can combine the move with a rename if you specify both a different target directory and a new name, which we will do soon.


Delete a grid theme data source

  1. From the File menu, select Manage Data Sources.

  2. Navigate to the C:\temp directory.

  3. Select Grid as the Source Type.

  4. Select pf_dem.

  5. Click Delete.

  6. Authorize the deletion by clicking Yes.



  7. Dismiss the Manage Data Sources dialog.

  8. View the contents of your C:\temp directory in the Windows Explorer to see the effect of the deletion.

 

You have just deleted a grid data set from the hard drive. Once a data set is deleted using the Manage Data Source in ArcView 3.x, the deletion cannot be undone, so make sure that you are aware of what you are doing! This is the only way you can correctly delete grid data sources. Also, be aware that the grid needed to be removed from the project and (usually) the project saved before deleting from the file system.

Though we have not covered grid processing yet, you need to use this method of deleting grid data sets whenever you want to delete grids. Using any other method (e.g., deleting the grid directory using the Windows Explorer) will cause data corruption or other strange problems.

 


Copy an image theme data source

  1. Open a Windows Explorer.

  2. Navigate to the packgis\forest directory on the CD.

  3. Hold down the <CTRL> key, then click each of the ortho_91.* files to select them all.
    [Note: the notation file.* means all files matching the pattern "file, dot, any characters." In this example, the file is ortho_91, and the "*" means any file extension (here, this matches the file extensions bil, bilw, hdr, and stx)].



  4. Select Edit > Copy from the menu.

  5. Navigate to the C:\temp directory and select Edit > Paste. Note that the main image file is large (22 MB), and will take awhile to copy.

  6. Now add the newly copied theme to the view. You should see that it draws more quickly (because the hard drive has faster access speed than the CD).

  7. Add this theme to the view, making sure to specify Image Data Source.



  8. Turn the theme on.

 

You have just copied an image theme source from the CD to the system hard drive. Note that you have used an OS tool, rather than the ArcView 3.x Manage Data Sources tool to do this. All files except ArcInfo data sets (i.e., coverages, grids, and TINs) can be managed with OS tools. However, if you use this functionality, you will need to make sure that you copy or move all files associated with the data source, or you may corrupt your data. To aid in selecting all the necessary files, use the Find function in the Windows Explorer.

 


Convert a coverage theme to a shapefile

  1. Use the Add Theme button to add the roads theme from the packgis\forest directory on the CD.

  2. Do not double-click on the name of the data source, but single-click on the folder icon for the data source. Remember from the last assignment? The roads data source contains feature data sources for arcs and nodes. We are interested in the arcs as well as the nodes.

  3. Press the <SHIFT> key and select the two themes from the roads source.



  4. OK the addition of these themes. Two themes will be added to the view.

  5. Of these two new themes, make the line theme active.

  6. Select Theme > Convert to Shapefile from the menu.

  7. Save the new theme data source as roads.shp on the removable disk.



  8. Do not add the new theme to the view when ArcView 3.x asks (we will rename this in a moment, and if the shapefile is present in the project, it will be "locked").

 

You have just exported a coverage data source to a shapefile data source. That shapefile is much easier to manage than the original ArcInfo coverage data source. You can export any vector data to a shapefile, regardless of the data source type. You can use the Manage Data Sources tool to copy, move, rename, or delete this new shapefile. We will move and rename the shapefile in the next step.

 


Rename a shapefile

  1. From the File menu, select Manage Data Sources.

  2. Navigate to the removable drive directory.

  3. Select Shapefile as the Source Type.

  4. Select roads.shp.

  5. Click Rename, and navigate to the c:\temp directory, then enter the new name road_line.shp.



    Renaming a data set by assigning it a new directory will simultaneously move/rename the data set and delete the original copy.

  6. Click OK to rename the shapefile.

  7. Add the new shapefile to your view and turn it on.

 

You have just renamed and moved an ArcView 3.x shapefile. Using this functionality in ArcView 3.x renames all individual system files comprising the shapefile. You have also used this method to move the shapefile to another directory. You could optionally have done this using the Windows Explorer, but that would have necessitated renaming and moving at least 3 separate files, whereas in ArcView 3.x you can perform this in one step.

 


Archive a set of data

  1. If you want to use WinZip, continue from here (you'll need to download and install). If you don't want to install WinZip, you should jump ahead to using Zip.

    1. Download the WinZip installation file (from WinZip. When you go to the WinZip page, follow the link to Download Evaluation Version).

    2. After you download the file, run it from the Windows Explorer and follow the installation instructions.

      [Note: This may not be possible, based on the privilege level you have on the machine you are working on, so if the installation fails, jump ahead to using Zip.]

    3. Accept all the default choices in the installation.

    4. Choose to open with the WinZip Classic Interface.

    5. Using the Windows Explorer, navigate to the C:\temp directory, where you have been saving files.

    6. Select all the road_line.* Files You should see 5 files.



    7. Right-hand click and select the Add to zip option.

    8. Accept the licensing agreement from WinZip.

    9. Click New on the WinZip Add dialog.




    10. Check to see that you have a directory called C:\temp. If this directory does not exist, create it now.

    11. In the File name text entry control, type in road_line.zip and then click OK. [Note: you do not need to provide a path name if you are in the directory where you want the new zip file to be created.]



    12. Click Add in the WinZip Add dialog. WinZip will add the 5 files to a new zip archive.



    13. Close the WinZip application.

    14. Using the Windows Explorer, verify that there is a file called road_line.zip in the C:\temp directory.



    15. Using the Windows Explorer, move the new zip file to your removable disk.

    16. Double-click the road_line.zip. When the file opens, you should see all of the 5 source files for the road_line.shp shapefile theme source. Click the Extract button to uncompress and extract the component files to your removable disk.





  2. Use Zip to archive and extract the data. If you want to be a "power user," try this method instead of WinZip.

    1. Open a Command Prompt. If there is no obvious shortcut to be found, the fastest way to do this is to press the <Windows> key, then tap the <R> key.

    2. When the Run dialog opens, enter cmd in the Open control and click OK.



    3. Change directories to C:\temp with the command

      cd \temp

    4. Use the zip command from the CD. The command (make sure and alter your drive letters accordingly if your CD is not drive E) is shown here:

      e:\unix\zip     roadline.zip     road_line.*

      This instructs the command prompt to use the zip executable on the CD, to create a file in the current working directory called roadline.zip from all the files matching the pattern road_line.* in the current directory.

      This is what your command prompt should look like. [Your commands will not be shown in red, but are displayed here for the sake of clarity.]



    5. Change drives to the removable drive (in this case, assuming the removable drive is drive D, the command is just)

      d:

    6. Unzip the zip file, using the command

      e:\unix\unzip c:\temp\roadline.zip

      This tells the command prompt to unzip the roadline.zip file from the C:\temp directory into the current directory (now D, the removable disk). [Your commands will not be shown in red, but are displayed here for the sake of clarity.]



  3. Add the newly uncompressed shapefile to a view to verify that the process occurred without error.

  4. Close ArcView 3.x.

 

You have just created a zip file archive of the files comprising a shapefile. The zip file can be copied around the file system or from system to system. Unzipping the file will restore the shape file data source, which can be added to a new or existing ArcView 3.x project. This is a good method of archiving and moving a large number of files, because you will only need to manage the one zip file rather than a number of individual files.

 


"Move" an ArcView 3.x project

  1. Open ArcView 3.x. Do not use the cfr250.apr project.

  2. Create a directory called myname in C:\temp on the hard drive. (Use your name, not the string "myname".)

  3. Create a new view and add the Boundary and Streams themes from the CD.

  4. Convert both of these themes to shapefiles (menu: Theme > Convert to Shapefile), saved in the directory you just created.
    Use the same names as the original themes, so that you have a new shapefile called boundary.shp and one called streams.shp.

  5. When asked if you want the converted themes in the project, choose Yes.

  6. Delete the original Boundary and Streams themes from the view. If you have opened any tables, delete these from the project as well.

    [You have just made shapefile copies of the Boundary and Streams ArcInfo coverage data source themes, and saved them on the hard drive.]

  7. Create a directory on your removable drive called proj_mgmt.

  8. Save the project on your removable drive in the proj_mgmt directory, as move_proj.apr.

  9. Close the project.

  10. Using the Windows Explorer, move the \temp\myname folder to your removable drive into the myfile directory. Make sure you have deleted the \temp\myname folder from the hard drive.

  11. Open the project again, from its new location. It will begin to ask you where the files are. This may have happened to you before (e.g., if you did not use the cfr250.apr to open one of the course projects). Click Cancel All. Because the project contains pointers to data that no longer exist where the project expects, the project cannot find the data sets.

  12. Close the project without saving.

  13. In the Windows Explorer, find your move_proj.apr project. Select (don't open) the project and from the menu, select Edit > Copy, then Edit > Paste. This will create a safe backup copy of your project, called Copy of move_proj.apr. Always copy the project file before you attempt an edit.

  14. Open WordPad (<Windows> + <R>, enter write).

  15. Drag the project file from the Windows Explorer onto WordPad's title bar (not onto the editing part of the window). This will open the project as an ASCII file, which is just what an ArcView 3.x project file is. You will see a lot of text that will mean nothing.



  16. From the menu, select Edit > Find and search for the string Path:. This will scroll you through the file until the first occurrence of the search string. Note that the Path statement shows the location of one of the files loaded in the project. Use the <F3> key to find the next occurrence of Path:



    Keep this up until you find a text line pointing to the Boundary or Streams theme, then dismiss the Find dialog.



    Note that the Path of the data set now points to a file that no longer exists (remember, we moved the directory myname from C:\temp on the hard drive to the removable drive).

  17. Select the text from the start of the line through the directory, but not including the theme name, as shown below.



  18. From the menu, select Edit > Copy. This copies the text into the Windows clipboard.

  19. From the menu, select Edit > Replace. The Find what: control will already be filled in with the search string. Click on the Replace with: control and use the keystroke combination <CTRL-V> (which will paste from the Windows clipboard into the Replace with: control.).

  20. Alter the Replace with: string to point to the new location of your data (which is the proj_mgmt directory on the removable drive), and then click Replace All. After all replacements have been made, click the Replace All button again in case the originally selected text was not replaced. Dismiss the Replace dialog. Make sure to keep the tab character (thick vertical bar) in both the Find and Replace controls.



    You are instructing WordPad to find any text in the project file pointing to a nonexistent directory, and replace it with text pointing to the now correct location.

  21. Save the changes to the file and close WordPad. If you get a warning from WordPad about saving in text-only format, click OK.

  22. Open the project in ArcView 3.x (without using the cfr250.apr project) and it should load all the files it needs to, since the project has the correct locations of all the files. If you still get error messages from ArcView 3.x, you will need to reopen the project file and make necessary changes. Ask for help if you need assistance.

 

You have just moved a project from one place to another on the file system. You can use this technique to manage projects, but it is important that you know exactly where all the source files are located, where you have moved them to, and what they are called. The project files include Path: statements that are absolute, including the drive letter of the data source. When projects are moved, if the drive letters have changed, ArcView 3.x will not be able to find the data sets.

If you make sure to always use the Startup Project, and save new files on the removable disk, you will avoid needing to go through this process. The Startup Project accomplishes this by substituting variables for drive letters. Always use the startup project to reopen projects created with the startup project.

Continue on to Data Export....


Syllabus Schedule Class Meetings Assignments Course Data Internet Search

Current Grades

Contact Us CFR 590 Internet-only section Lab Locations  

 

The University of Washington Spatial Technology, GIS, and Remote Sensing Page is provided by the College of Forest Resources and the College of Ocean and Fisheries Sciences through Unit-Specific UIF. Site administrator: Phil Hurvitz.
Copyright © Phil Hurvitz, 1998-2003