USING ARCVIEW

IPM CRSP

VIRGINIA TECH - CARDI JAMAICA

INFORMATION SYSTEMS FOR COLLABORATIVE RESEARCH

GIS WORKSHOP

Revised version for November 1999 workshop

Larry Grossman

Department of Geography

Virginia Tech


NOTE: The materials on these pages--both in printed form and on the World Wide Web--are to be used only in association with the Virginia Tech IPM CRSP. Reproduction or use of these pages, in part or in full, for commercial purposes is strictly prohibited. Those wishing to reproduce or use these pages for non-profit, educational purposes should contact the author at LGROSSMN@VT.EDU for permission.


Acknowledgment: All coverages and part of the data in these GIS lessons are supplied by Glynis Ford of the Rural Physical Planning Division (RPPD), Ministry of Agriculture, Jamaica.

Step 13: Adding, Editing, and Importing Data

We have been using tabular data already stored in our GIS program. We can add tabular data from other sources in a variety of ways.

Adding Manually Entered Data into New Fields

First, we will add a new field to our table and manually enter data into it. A basic problem with manually entering data in tables in ArcView is that the process is slower and more cumbersome compared to working with Excel spreadsheets.

Make sure that our table for "Major Crops" (Attributes of bpkprcl.shp) is open. Add a new field (make sure that you select "Table/Start Editing" first.) Call the new field "Num_Crops" which will represent the number of different crops in a garden.

Click on the Edit button in the second row of buttons at the top of the screen. This button enables us to either enter new data or to edit existing data in our tables. Note that when you place your cursor over the table that it now changes to a hand with a finger pointing.

Put your cursor in the first row, just below our field name, "Num_Crops". Type in a number between 1 and 9 (We could type in any number; we are selecting numbers 1 to 9 just to save time.)

Press the Enter key to enter the data and the cursor automatically moves to the cell beneath the current row. Enter another number and press the "Enter" key. Keep doing this until you come to the last row and have filled all the cells in the column with data.

You have to press the Enter key one more time to enter the last entry. When you do so, the cursor then shifts to the top row of another field. Thus, when you are entering data in a new field, as you approach the bottom of your new field, go slowly, for otherwise you could overwrite data in the first row at the top of another field. (Note: If you do overwrite data in another field, select Edit from the menu at the top and select Undo Edit from the drop-down list.)

(Note: You can also change the entries in one or more cells already containing preexisting data by using the same Edit button.)

Select Table from the menu at the top and choose Stop Editing from the drop-down list. Select Yes when you are prompted if you want to "Save Edits?" Your changes are now saved.

Importing Data from Excel Spreadsheets

Now we will discuss importing data from Excel spreadsheets. The advantage of working in Excel is that it is easier to manipulate data in Excel than in ArcView tables.

There are two methods of working in Excel.
The first is to edit an existing ArcView ".dbf" file that has a table.
The second is to create an entirely new table in Excel and then import it into ArcView.

To edit existing .dbf format files from ArcView in Excel, first import the file into Excel by using the File/Open menu command. At the bottom of the Open window in Excel, there is a drop-down list for Files of type:. Select dBase Files (*.dbf) from the drop-down list. Then open your file.

While in Excel, you can make changes, add fields, perform calculations, etc., in the table. But there is a potential problem here. If you simply saved your current file in Excel as a ".dbf" file and then you tried to open it in ArcView, none of your changes that you made in Excel would appear in ArcView.

To get around this problem is easy. When you have finished making changes to your file in Excel, copy all the columns and rows in your file (whether changed or unchanged) that have data in them and paste them into a new empty spreadsheet in Excel.

(Note: When you copy these cells, DO NOT copy them by selecting the entire spreadsheet for copying; copy only those cells that have data in them.)

Before saving the new spreadsheet in Excel, first be sure to click on one of the cells with data in it so that it is highlighted. If you have highlighted a cell without data in it, you could not save the new file.

When ready to save the new spreadsheet in Excel, select File from the menu at the top and Save As from the drop-down list. The "Save As" window will appear. Give the new spreadsheet a name (I called it "Book2xx.dbf" here.) Also, make sure that it has a ".dbf" extension by selecting from the drop-down list for "Save as type" at the bottom of the window the choice "DBF4(dBASE IV)(*.dbf)". When you click on the "Save" button, the following window will appear:

Click on the "OK" button. When you try to exit from Excel, you will get the message:

Click on the "Yes" button.

The "Save As" window appears again. Click on the "Save" button again. Now you get the message

Click on the "Yes" button.

Another window appears asking if you want to save the changes to the original file you opened in Excel (here it was "mymite.dbf")

Click on the "No" button because you cannot save the changes to the original file anyway. You can now exit from Excel.

You could then rename the original, unchanged dbf. file (here "mymite.dbf") to another, similar name to create a backup file (such as "mymitexx.dbf") and then rename the new file you just created (here "Book2xx.dbf") to the original file name, "mymite.dbf."

When you open the new file in ArcView, all the changes that you have made in Excel will be retained in the file. Sometimes when you open such newly created files in ArcView, they appear distorted. If that happens, save your changes, close the ArcView program, and then restart ArcView. Then the table will appear in its proper form.

The second method of working in Excel is to create an entirely new spreadsheet that can be incorporated into ArcView. The key here is to have one column in your Excel file that matches exactly a preexisting column in the ArcView .dbf file that is associated with the theme that you are examining.

If we look at our table for Attributes of Bpkprcl.shp, we see that there is one column that would be easy to re-create and match in our Excel file.

The field Bpkprcl has a series of identification numbers that would be easy to replicate in Excel using Excel's Edit/Fill/Series commands in the menu at the top.

You must add such a column to your spreadsheet in Excel with the exact same series of numbers (starting in row 2) as exists in our Bpkprcl.dbf table in ArcView. However, the name of the field in the column heading in Excel (put in row 1) can be different from that in our ArcView table.

You then add your new data in subsequent columns, as I have done with data on mite counts.

You then save the new Excel file as a .dbf file, which can now be imported into ArcView.

Let us see how this works. I have added the above "Excel.dbf" file to our "cardi" directory. The file has two columns. One column has data on BPKPRCL# (which match exactly the data in the field "Bpkprcl" in ArcView) and the other has data on the number of mites per garden.

To import the file into ArcView, first go to the Project Window, click on the Tables icon and then click on the Add button, which brings up the Add Table window. Navigate to the "cardi" directory and double-click on the file "Excel.dbf."

The file then opens in ArcView.

We need to join our new table, Excel.dbf, with a pre-existing table in ArcView because only the pre-existing ArcView table is referenced spatially so that it can be displayed in one of our maps of themes. Joining tables means combining the contents of the two tables.

To join our two tables, we need to highlight the names of the fields that have the same data in both tables, in this case, the field "Bpkprcl#" (in Excel.dbf) and "Bpkprcl" (in Attributes of Bpkprcl.shp).

But the order in which we highlight the fields in the two tables is crucial. When ArcView joins two tables, it abandons the table in which we first highlight the field heading and only keeps the table in which we highlight the field heading last.

Thus, go ahead and first click on the field name "Bpkprcl#" in Excel.dbf, which causes the cell containing the name of the field to be darker than the other field.

Then, open up the table "Attributes of Bpkprcl.shp" and click on the field name "bpkprcl" in the table .

To join the two tables, click on the Join button at the top of the screen below the menu.

Our two tables will be joined and our table Excel.dbf will be closed, with only "Attributes of Bpkprcl.shp" remaining. "Attributes of Bpkprcl.shp" now contains the additional field concerning the number of mites at the far right of the table.

Now the number of mites can be displayed on the map, just like our other fields.

If you had a problem joining the two tables, be sure that you are not in Edit mode in the tables. You cannot join tables while in Edit mode.

Saving Joined Tables

An important note is warranted here concerning our joined table. If you searched for this new table in a single ".dbf" file (ArcView tables are stored in ".dbf" database format) on your hard drive, you would not find it because ArcView actually merges separate tables when you bring up a table that has been joined.

After you join a table, you can only edit the original part of the table, not the part that you joined, because they are really separate tables.

To save our joined file as a single file that can be brought up for editing, go to the menu at the top of the screen and select File and then Export from the drop-down-list.

From the Export Table window, select dBASE as the format. dBASE files have the ".dbf" file extension.

Click on the OK button and the Export Table window will appear asking you for the name of your new .dbf file.

I will call it "table1.dbf" and will place it in our CARDI directory.

Click on the OK button.

To bring our new "table1.dbf" into our project, close the current table and go to the menu at the top of the screen above the map. Select Window and proj1.apr from the drop-down list .

(Note: If this were not saved as a project yet, you would select Untitled from the drop-down list.)

This brings us back to the Project Window.

Click on the Tables icon, which brings up a list of the tables that have been used in our project (My list will be more extensive than yours.)

Click on the Add button, which brings up a list of available .dbf files in the Add Table window.

(Note: You may need to navigate to the "cardi" directory in the window.) Double-click on "table1.dbf" on the left.

Then, table1.dbf will appear.

(Note: We do not now see the new field that we created, "Mite_count". To see our new field, you need to scroll to the right to the end of table1.dbf.)

If you go back to the Project Window, you will also see table1.dbf listed as well.

To go back to our map, click on the Views icon in the Project Window and click on the Open button.

Importing ARC/INFO Files

Our last task with importing data is to incorporate pre-existing data created in ARC/INFO. Such data from ARC/INFO are exported with the extension ".e00". To import such data into ArcView, we need to click on the Windows 95 Start button, select Programs and from the pop-up list choose ESRI; from the ESRI list, select Import71.

The Import71 Utility window now appears, with two blank boxes. One asks for the Export Filename. Here you need to enter the name of the ARC/INFO file, which you can enter by searching for it using the Browse button on the right. The second box asks for the Output Data Source. Here you need to create a name for a subdirectory in which ArcView will place the converted files so that they can be used in ArcView; the subdirectory will be located in the same directory in which the ARC/INFO file is located. I have entered examples here.

After you press the OK button, the window will indicate that ArcView is processing the file. Do not do anything until a small Import71 Utility window appears with the message "Import Complete." Click on the OK button to close it. Then you can add the new theme to your map; the theme will have the same name as the name you entered for "Output Data Source."

[Return to beginning]

[GO TO STEP 14]