GIS Exercise

28 Nov 2004

Thomas Gumbricht

 

 

 

Introduction to Data Capture with GPS

 

Requirements

This exercise requires a handheld (Garmin) GPS and PC interface cord, a (laptop) PC with Windows 95/98/2000, Windows NT, or later and the freewares DIVA-GIS 2.5 and DNRGarmin. To download and install ArcExplorer and DNRGarmin GPS see appendix 1. The necessary data are available on the Okavango_DVD1.0 CD. Sources of internet available data is given in appendix 2.

 

Recommended prerequisites

It is recommended that you do the exercise GIS and satellite image data analysis – Okavango Delta, Botswana before doing this exercise.

 

Objectives

This exercise will give an introduction to data capture, editing and importing, and data quality . The objective of the exercise is that the students should understand how data is entered into GIS, and how attribute and vector data are related. After completing the exercise students should be able to use GPS for capturing data to a GIS.

 

Task

To pass the exercise a map showing field sites visited in the Nakuru area should be handed in.

 

Prepare your GPS

 

This exercise is written for an eTrex Venture of the Garmin personal navigator series. If you do have another GPS receiver you need to consult your instruction book. If you do not have a Garmin handheld GPS it is unlikely that the computer interface will work.

 

In this exercise we are working with geographical coordinates (latitude and longitude), and the WGS 84 datum. The default format for storing geographical coordinates in most GIS is as decimal degrees (i.e. full degrees, and minutes and seconds as ratios) rather than as degrees, minutes and seconds. I recommend that you use your GPS set to decimal degrees, and then let the GIS and interface program to the GPS handle the coordinate transformations. There are some advantages with setting the projection directly in the GIS, especially if you use want to upload other data to use in real time in your GPS while out in the field. All the maps in the Okavango project are projected using the following parameters:

 

Projection: UTM S34

Longitude of origin: 21

Datum: WGS-84

Scale factor :0.9996

False Easting: 500 000

False Northing: 10 000 000

 

You can set this manually in your GPS (although mine can not take the figure 10 000 000, so I enter 9 999 999 instead, but that meter error is negligible. The rest of this instruction will assume that your GPS is set to decimal degrees.

 

Start your handheld GPS. Go to the Main menu of the GPS and then to the Setup, in the Setup menu select Units. Make sure the Position Format is decimal degrees (e.g. hddd.dddddo ). In the Setup menu also check that the Interface is GARMIN. 

 

When travelling in the field it is often useful to track the movements, and hence you need to clear the set up the track log (and empty it if you have too much data in it). Go back to the Main menu and select Tracks. If you have Saved Tracks or data in the Track Log it is better if you can Clear these data. For the travel to out field area, use the Setup Track Log to set an Interval of 200 m. This will later give us a nice road map (which you will use for evaluating the accuracy of the road networks captured from Digital Chart of the World, or elsewhere). Make sure the Track Log is active (i.e. the On button appears pressed down in Tracks menu). Put the GPS inside the front screen of the car.

 

If your GPS can not hold large amounts of data, you can use a laptop computer for real time capture of GPS data (demands ArcView though). For long trips the battery capacity of most laptop computers is, however not sufficient. A good thing to have when doing field work involving computers is to have a 12 to 220 volt converter that plugs in to the cigarette lighter of the car.

 

Install the GPS interface software

 

In this exercise we will use a freeware for interfacing the computer with the GPS. The freeware is called DNR-garmin. Before continuing you must install DNR-garmin on your computer. Once that is done you will have the icon for DNR-Garmin,  on your desktop. Connect your GPS to the port you are using on your computer and start DNR Garmin. The first time DNR Garmin starts it will prompt you for setting various properties, most important the projection.  If you directly get the main interface (sown below to the left) you have to open the DNR Garmin Properties dialogue from the menu instead – it is under File and then Set Projection (as shown below to the right).

 

 

Below you see how I have set up my interface in DNR-Garmin. The most important is the settings under the Projection tab. I have also chosen to have fewer fields transferred between the GPS and my computer, both concerning Waypoints and Tracks, as shown below. The first six fields (type, Ident, lat, Long, Y_proj, x_proj – and new_seg for Track) are compulsory. I also transfer altitude, comment  and unused1 (for WP) and time (for track).  The inclusion of unused1 is important as I use that field for adding dates. If you also want to add time of day, you should also include unused2. You must decide which fields you want to keep, it depends on how you use your GPS.

 

 

 

Prepare your database

 

In this exercise you will download data from the GPS and create several new map layers, we will also upload digitised data to the GPS. To distinguish your own data from that supplied on the DVD I recommend that you create a new directory under oka-delta were you can store and manipulate your own data. In my examples I have used a directory called my-gps. The exercise assumes that you have some data in your GPS that you want to download to your computer. If, in fact, you do not have any data you can start with the paragraph on Uploading data to the GPS, and then use then go back to section on Downloading, using the uploaded data instead of field captured data.

 

Downloading Waypoints form the GPS

 

This exercise will rely on DNR-Garmin, and the use of DIVA-GIS for capturing and displaying data tracks and waypoints from the handheld GPS. If you have not already installed DnrGarmin you must do that now.

 

Make sure the handheld GPS is connected and the Interface is set to GARMIN (see above), and then start the program DnrGarmin,  from the desktop. If the DnrGarmin icon is not on the desktop you must locate the source program, and start it from there. The program automatically searches for a connected GPS unit.

You can see the status of the search in the lower left corner of the DNR-Garmin program interface. It should say Connected if successful.

 

Choose Waypoint from the DNR-Garmin Menu and then Download. In the bottom centre of the interface you can see how data is transferred to the memory of the computer.

 

All your Waypoints (WP) will be displayed in DNR Garmin, together with the fields you selected to include.

 

 

 

To save the downloaded tracks chose File in the DNR-Garmin menu. Navigate to the “my-gps” directory and give a logical filename (remember long and informative filenames will help you later). Save as type ArcView Shapefile (Projected) (*.shp), as shown below.

 

 

Adding Waypoints to the GIS

 

Now we are eager to see if everything is correct so far. So start DIVA GIS again, . Use the Add Theme tool,  to get your newly created file with Waypoints. If it displays in the view that is the first step. But we also want to see if the projection worked. So you must also a theme or image that you know is correctly positioned. I have used the Landsat image in natural colors from 2000 (..\oka\Oka-Delta\Landsat\2000-etm\oka_2000_etm_natural).

 

 

Have a look at the attribute table (use the Table tool, ), to make sure you got all the attributes you wanted with the download.

 

Downloading tracks from the GPS

 

To download a track is very similar to the downloading of Waypoints. The only differences is that you can choose

To download a track is very similar to the downloading of Waypoints. The only differences is that you can choose which type of vector you want to create (Point, Line, Polygon). I used Line in my example.

 

Editing Waypoints and Tracks

 

First an important note and recommendation. When you are manipulating your data you should turn off DIVA GIS – otherwise you might compromise, or even loose the data. It is hence strongly recommended that always have an up to date backup of your GPS datafiles.

 

Assume that over an intensive day you have captured 50 Waypoints representing different observations you are interested in (e.g. lion, wattled cranes, the progressing floodwave, a poachers kill, a photograph). In the evening you download them and give a logical name including the date to the file. The next day you are off again, and sure enough, the lions have moved, the floodwave is another km down the channel etc. You are then meeting the problem of how to put your different GPS observations together. There are actually two separate problems; the first is to add your attribute (field notes) data to each observation record (what you observed and when). If you only make one kind of observation (or have one GPS per thematic observation) this is not a problem, because then all observations regard the same phenomena, and only time and place matters. Then comes the second problem – how to store your data in the computer. For this problem there are several ways to go:

 

  1. Just download each period (day, week, month, when the GPS gets full) separately and attend to it all at a later time (which seldom arrives), or
  2. Append all your data in one large file that just gets bigger and bigger, or
  3. Separate your observations thematically, and append each separate type to the file containing all previous observation in covering this theme.

 

Let us first have a look at the problem of editing data and adding attribute information to each record. The first alternative is to add the data directly into the GPS in the field. You can use the Waypoint  (or Track) name, comment and/or symbol field to do this. This is rather straight forward, and saves a lot of work when you get home again. In reality, it is however very seldom that one has time to use the slow entry system for writing text in the field. Other travellers in the company want to get on, the floodwave is sweeping you away, or the lion has discovered you. Probably the next generation of GPS receiver will have better systems for adding attribute information in realtime. I, however, still rely heavily on pen and paper. In the meanwhile, I still have a feeling you will need to address your data once back at camp, or home. There are two ways to go:

 

    1. Edit the Dbase file (dbf) that holds the attribute data using e.g. excel, or
    2. Export your data as a text file and edit it with a text editor (word, notebook, UltraEdit).

 

Both ways are equally good or bad.

 

Updating your database in Excel

 

 Let us first look at using excel. Start excel and Open File, navigate to your directory and change File of type to dBase Files (*.dbf) as shown below. Open the Waypoint file.

 

The dBase opens without problem in excel and you can now edit and update your observations. Note that even if you had a more fancy GIS, this is not a more easy step to them in them compared to here – rather the other way around. Having said you must be careful though, not to add or delete any record (row) or field (column). And you must also be careful with not writing text in fields meant for numbers. Here is what I suggest that you do in order to keep a tidy attribute table and facilitate future data analysis:

 

1. Use the TYPE field for defining some logical categories. I suggest species level categories for living things, water and photographs. You can agglomerate at various levels, say to birds or types of birds (waders, vultures etc) instead of species level. The fields for IDENTIY, LAT, LONG, Y_PROJ and X_PROJ should be kept intact. In comments you can add your observation. Note that if you want your database to be useful, you need to enter the same observation (e.g. individual animal) in exactly the same way each time you enter it (spelling etc, and never any extra comment then you must add a field for that). I also use the SYMBOL field for duplicating or refining the information added in the TYPE field. SO I can have codes for animal species (individuals even – in which case I can use the Comment field for additional information). In UNUSED1 I enter the date – as a complete number without blanks or strokes or these silly things – just a straight 8 number digit YYYYMMDD. This will facilitate a lot when querying and analysing the data in the future. Well, after all this, here is my update table for the observations of 20041126:

 

 

Once you are through, just click the save tool (or press ctrl+s), and when asked for name, choose the same file name (did you remember to do a backup?).

 

 

Click Save, and excel will ask if you want to replace the existing file. Click Yes.

 

 

Excel will next warn you that your file may contain features that are not compatible with DBF. It does not, so just click Yes.

 

 

Before getting the file to DIVA GIS you must close excel. When you do this excel asks you if you want to save the changes that you made. The answer is No. You already did that, but excel thinks you might have had incompatible feaures (which you did not).

 

 

Now you can open DIVA GIS again and your GPS theme will be updated.

 

 

 

 

As your dBase file contains the projected coordinates (Y_PROJ, X_PROJ) you actually do not need to keep the link with the pre-defined shape (.shp) file.  DIVA GIS can import the dBase file and project it using the Y-PROJ and X_Proj fields.

 

Import the dBase file for the Tubu Waypoints, use the projected fields (X_PROJ and Y_PROJ) rather than LAT and LONG for projecting the data. You can preview the file under the View Input File tab. Compare the imported shape file with the original downloaded with Garmin-GPS. They should look exactly the same. Hence the way to delete or add points or change label names is to use this import function rather tan update the database associated with a pre-defiend shape file. If you change the labels, type of field, or number of records the link between the shape and the dBase file will be corrupted.

 

 

Updating your database in a text editor

 

In principle you can use any text editor to update your database as DIVA GIS can read several text file formats and convert them to vector files (or even grid files). What you need to do tin order to use a text editor is to save your downloaded track as a textfile. DNR-Garmin gives you that option, . You can choose from several ways to delimit each field – comma delimited (csv) is a standard format that both excel and DIVA GIS can read. Only remember that you can not enter a comma in any field – then your database structure will collapse. Here is the same Waypoint file as before – but this time updated in Notepad.

 

It looks rather messy, and it is. But some people are good at handling this type of files.

 

 

To import this file into DIVA GIS, go via Data in the main menu and then Points (TXT) to Shapefile.

 

In the dialogue box that appears you can actually define the attribute data table rather nicely, and even add new fields to your table. Make sure you select the correct Field Delimiter and the fields defining the coordinates in the projection you use (DIVA chooses fields named Lat and Long as default, so you need to change this in our example). You will see the table structure in the Create Shapefile from Text File dialogue box. As you will have understood by now, writing a simple text file like this (or creating it in excel) is a another way of entering data – so if your GPS have no cable for connecting to the computer this is the way to go. It is elaborated further down in the exercise. By reimporting the data and defining coordinates from the attributes also allows you to add and delete Waypoints without problems. This is an advantage compared to updating in the dBAse file and keeping its relation with a pre-defined shape (.shp) file.

 

 

Tracks can be edited in much the same way; only you work with lines (which may contains hundreds of vertices, or points) in each record. To edit individual vertices in lines and polygons you can upload the shape file to DNR-Garmin and do it inside that program (see below).

 

Adding and deleting points

 

 

Assume that we have captured some more Waypoints and Tracks in our GPS since last time, and that the old Waypoints and Tracks were removed from the GPS once we downloaded them. DNR-GARMIN now allows us to append the added records to the existing records. And this works regardless of which type of file you have been working with – shape, dBase or text. That is a very useful tool. The only thing you need to do is to select the existing file when DNR-Garmin asks for the filename to save the downloaded Waypoints/Tracks in. If you then answer yes to the question (to the right) the new records will be appended to the existing file.

One thing to keep in mind is that it works best if you do keep the field definitions constant and do not change the field names or fields to be downloaded (even if this to can be overcome).

 

If you want to delete and individual point, or vertices in a line/polygon vector, DNR-Garmin is your best option. Look again at the downloaded file in DNR-GARMIN. To the left of the records you have some options. You can add,  or delete,  records. You can also copy,  and paste,  the whole matrix. E.g. directly to excel. Click the blank upper left cell and use the copy tool, then just go to any cell in excel and do paste – and the whole datasheet is transferred. You can then edit it all in Excel before saving it as dBase or text file and importing to DIVA GIS. Quite a handy tool once you get into the GIS. Also note that DNR-Garmin can display all vertices in a line/polygon theme which allows you to delete single points along lines or in polygon boundaries.

 

Editing and selecting merged records

 

In my example I have now appended Waypoints from several periods into the same file, but while doing so I have made sure to update al records with my own observations. I hence have a very large file, but as long as I can keep track of my doings that is not a problem. Let us assume that I have collected data over an annual cycle, with an average of ten points a day my database now holds 3650 records. That is not so bad, and can easily be handled by excel. If I have kept my records neat and tidy I can simply separate them directly in excel by sorting out those that contain a certain code, name or identification (this can be all lions, an individual lion, all flood related points etc). I can also sort all the data using time (the unused1 field). Doing so I can then create a Dbase or .csv (comma delimited text) file by exporting that format from excel, and importing the same file to DIVA GIS, as explained above. The other alternative is to do the query direct in DIVA GIS and then generate the new file with records pertaining only to a specific feature. In my example I appended all my GPS derived Waypoints (e.g. over the year 2004) in one file, that I maintained by using excel. I then exported the file from excel (either as dBase or comma delimited text file – I prefer the latter as that gives more control) and imported it to DIVA GIS. In DIVA GIS I can now query my database for e.g. animals, mammals, lions or an individual lion.  Here is the result showing my observations of the prime male in our area – Russel. I had given a special SYMBOL for Russel (345 – 3 for mammal carnivore, 4 for lion, 5 for Russel), and I had also entered ‘Lion – Russel’ as a comment in most cases. So I used these fields to extract my Russel-observations from the database.

 

 

 

 

DIVA GIS displays the selected records as yellow. We can now save the selected records in a separate vector (Shape) file. Under Data in the menu you find the option Selection to New Shapefile. This is a very useful option that lets you save any query as a separate file. In my example I can now save my Russel-obseravations for 2004.

 

To get an idea of how Russel has moved around his home range over the last 12 months I then used the field containing the date of observation information for symbolising my data. I can then see that Russel seems to have favoured different habitats over the year. This is where the really interesting part starts, combining the animal information with data on floods, vegetation growth, and prey (predators in the form of poachers?). Some of this data is already on the Okavango DVD, and some you must assist in capturing. So, unfortunately the exercise can go no further in this respect, as Russel is only a fantasy lion.

 

 

Data recording without GPS

 

If you do not have a GPS, or lack the connection cable to the computer, you can still capture observation data to the GIS. If you have a GPS but no cable the alternative is to create an attribute table directly in excel or a text-editor, using a GPS for entering coordinates, and manually creating fields for other entries.

 

If you do not have a GPS, but know your area well enough, you can enter your observations by digitising them on screen using one or several of the satellite images as backdrop. If DIVA GIS is not running, get it running. From the Data menu choose Draw Shape.

 

Choose Type to be point in the drop down menu (= default selection). Then just digitise today’s observations directly in the map. This example is from Duba plains, and we are observing lions and buffalo. Duba is the classical place for lion and buffalo interaction, and we want to know more about the dynamics and rules behind this ecological game. DIVA GIS allows you to enter one numerical value and one text label for each entry. We will later use excel to add more attribute data, in the example I have chosen to have one coding system (numerical value) and one explicit text label for each observations (the numerical values could be hundred for family, tens for species and singles for individuals or herds).

 

 

When I have added the observations for today I click Save and give the newly created vector (shape) file a nice long logical name. Then I can look at my records in the attribute table – click the Table, , tool to open it. One advantage with DIVA GIS is that the projected coordinated are always displayed as fields in the attribute table.

 

To add more information we need to open our table in another program – the easiest is to use excel. The attribute table is in dBase format. From the Open file dialogue box in excel, hence choose Files of Types to be “.dbf”, as shown to the right.

 

Once imported to excel you can add more columns (Fields) of data.  I recommend that you at least add one field for dates, and one for comments.

 

 

Save the updated file, either as a dBase or a comma delimited file.

 

Finally you can import your updated file to DIVA GIS and display it. I recommend that you use one excel file for all your entries, copying and pasting in new data each time you digitise new observations. In that way you can at any time export the excel file as a .dbf or .csv file, and import it to DIVA GIS. You can also separate your observations and have one active file per observation feature (individual, herd, species, photographs etc). 

Uploading GPS data

 

There are occasions when it might be of interest to upload data from the GIS to the GPS. With a complete year of observations you want to revisit the locations where you made the observations of a particular species or  individual.


 

In my example I will use the observations of Russel, the lion. Connect your GPS, switch it on and start DNR-Garmin, . Under File in the menu, use the Load From option.

 

Navigate t o the my-gps directory, and you should see the files that we have created during this exercise. There are three formats in which you can upload the data, ArcView Shapefile, DBase and Text File. The easiest is to upload a shapefile, with the other options you ned to define which fields contains the coordinates. This, however, gives you better control over the uploading. Use Shape file for now.

 

 

The Waypoint file is uploaded to Garmin-GPS. You can now edit the Waypoints directly in the DNR-Garmin interface. So if you want to limit your Waypoints you can select those not needed by pressing the row nr, and then use the delete tool, .

 

 

 

Once you have a selection that you are happy with, use the Waypoint – Upload function in the main menu of DNR-Garmin (as shown above).

 

 

Finally let us use the GIS and GPS to identify interesting spots and how to get to them. This time we will use the Chobe area at Linyanti, and identify mopane ponds around Linyanti Tented Camp (LTC). The mopane ponds are depressions that holds water also during part of the dry season, and hence can see congregations of wildlife of interest both for tourists, managers and scientists alike. The mopane ponds are often situated in mopane dominated woodland, positioned next to ancient channel systems. The mechanisms which has created the mopane ponds and how ground water flows in and around them is still debated.

 

The mopane ponds are relatively easy to identify in the satellite image, and they also nicely illustrate some of the additional information that can be generated from multi-spectral (“color”) satellite images. Start DNR-Garmin and use the Add Theme tool,  to load all five images available in the  ..\oka\Oka-Delta\Landsat\2000-etm directory. The files represent different physically intelligible parameters derived from the original Landsat ETM scene:

 

Parameter

Comment

Usefulness

Brightness

The total amount of light, like a black and white photograph.

Identify water and salt pans

Greenness

Amount of green stuff in the image

Vegetation on land and in water

NDVI

Normalised Difference Vegetation Index

Vegetation on land

Wetness

Moisture content in the top surface

Flooding, water availability for plants

 

As can be seen the indexes have a clear physical meaning and are hence useful for interpreting the landscape. The files available on the Okavango DVD are further symbolised so that the physical meaning of the parameter is highlighted. We will use the images to find the mopane pans around Linaynti Tented Camp, in Chobe (the red box in the figure below).

 

 

The 2000 images are from early April, that saw heavy rainfall, which filled the mopane pans with water. The water in those pans is more salty than the wawters in the rivers, and thus it comes out in a light blue color. If you look carefully you can see a lot of small blue dots Southeast of the faultline that defines the Linaynti swamp.

 

2000 natural colors

2000 brightness

2000 greenness

2000 NDVI

2000 wetness

1994 natural colors

1994 brightness

1994 greenness

1994 NDVI

1994 wetness

 

The wet ponds are easily seen in the upper row of images, representing April 2000. The brightness is low, as water absorbs most light, and hence the pans appear dark.