the shapefile, gridfile and image file formats for spatial databases and
the dBaseIV (DBF) format for reading and writing external (non-spatial)
Shapefiles are so-called vector databases, describing the location of points (e.g.,
collecting locations), polylines (e.g., roads) and areas (or polygons, e.g., soil types,
countries). A shapefile actually consists of three separate files with the same name
but with different extensions (SHP, SHX and DBF), but they are treated as one file.
There are some shapefiles with additional files (extensions SBN and SBX), but these
are not essential and are not used in DIVA-GIS. The shapefile format was developed by
ESRI, a leading GIS software company. They were initially developed for use in
ArcView, but now nearly all GIS programs can either use them directly, or import
Grids are central to the analytical capabilities of DIVA-GIS. A grid divides (a part of)
the world into equal-sized cells. The advantage of using grids as opposed to areas such
as countries or other administrative units is that grid cells of the same size and shape
allow more objective comparisons.
For grid databases, in which an area is divided into equally sized rectangles, DIVA-GIS
gridfiles are used. A gridfile consists of two separate files *.GRI and *.GRD, but DIVA-
GIS treats them as if they were one file. The *.GRI file has the actual data, and the
*.GRD file has metadata and a number of parameters that are needed to read the
*.GRI file properly.
From these two files, DIVA-GIS creates two more files, *.BMP and *.BPW. These files
are derived from the *.GRI and *.GRD files and are used to visualize the data on the
map, but are otherwise not essential. If the BMP and BPW are absent, DIVA-GIS creates
these files automatically when opening a gridfile.
The BMP and BPW files can also be used to visualize gridfiles in ArcView and in
ArcExplorer (as images). Unlike in DIVA-GIS, however, the underlying grid data will not
be accessible in these programs, and it will not be possible to change their legend
categories. If you want to use the grid data in another program, you should export the
gridfile to a suitable format (Chapter 3).
Gridfiles with the same extents and gridcell size can be manipulated together in a
“stack.” Stacks are discussed in Chapter 9.
Image files are special kinds of grids that can be displayed but not used for analysis, as
the data associated with the different colours in the file are not accessible. A typical
example of such a file would be an air photo or satellite image. DIVA-GIS supports
three image formats: TIFF, JPEG and mrSID.
DBF (version IV) is a commonly used database format. DIVA-GIS uses it to import and
export tabular data. You can create a DBF file by exporting it from a database
program such as Access. It used to be possible to easily do this from Excel but this is
no longer the case, although it may still be possible with some third-party plugins.
Fortunately you can use the (free and open source) OpenOffice spreadsheet Calc
If you use Calc, you must take care not to lose data, particularly not to lose precision
(decimals) of coordinate data, or to create a DBF file with unsupported
The field names (variable names) should be in the first row, and only there. Each
column with data should have a field name. The names of fields may not be repeated,
may not start with a number, and should only consist of letters and numbers. Field
names should NOT contain characters such as * ^ % ? / - and >. Field names should not
be longer than 11 characters. Always make a backup copy of the DBF file and save the
new file in the native format first
, so that you do not lose your data should they not
be saved correctly as DBF.
There are several ways to describe a location on the Earth. The most commonly used
are degrees of longitude and latitude. A location can be between 180° West and 180°
East, and between 90° North and 90° South. Degrees are often subdivided using a
sexagesimal system (a calculus system with 60 as the basic number) of “minutes” and
”seconds” (exactly as done with subdivision of hours). For example, a latitude can be
described as e.g., 12°34´15´´S (12 degrees, 34 minutes, 15 seconds, Southern
This system worked fine in the days of paper maps, but it is not very suitable for the
digital age. A decimal system is universally used in geographic computing. In the
decimal system, latitude and longitude are described by a single number each, and no
letters, with the sign indicating the hemisphere (+ = N or E, – = S or W) (e.g., –
12.57083 for 12°34´15´´S). To convert longitude and latitude in degrees, minutes and
seconds to decimal degrees, the following formula is used:
Where DC is the decimal coordinate; d is the degrees (º), m the minutes (´), and s the
seconds (´´) of the sexagesimal system, h = 1 for the northern and eastern
hemispheres and -1 for the southern and western hemispheres. For example,
30º30´0´´S = -30.500 and 30º15´55 ´´N = 30.265. You can do these calculations in a
spreadsheet program or in DIVA-GIS using Tools/Geo-calculator (Chapter 10).
Decimal degrees should normally be recorded with 4 or 5 decimals. At the equator,
one unit of the fourth decimal (0.0001 degrees) equals about 10 meters (less at other
latitudes; not affected by longitude). That should be precise enough for most
applications. If you are using high-precision GPS (with differential correction), 5
decimal places would be warranted. See Wieczoreck et al. (2004) for a thorough
discussion of coordinate precision and uncertainty.
The Project menu contains functions for the management of DIVA-GIS project files,
and some related tasks (Box 2).
Box 2. The Project menu.
Icon Sect. Name
Starts a new project (map and associated image)
Opens an existing project (file with .DIV extension)
Closes the current project
Saves the current project
Saves the current project with a new name
Exports a project (including all data) to a DIVA-GIS
export file (file with extension “DIX”)
Imports a DIVA-GIS export file (DIX)
Her you can find a list of the 10 last used DIVA-GIS
Closes the project and shuts down DIVA-GIS
A DIVA-GIS project is a description of a DIVA-GIS map: it includes a collection of layers
and their display properties, as well as some general parameters describing the map‟s
scale and center. A project file can be closed, saved with a new name, and opened
again using commands from the Project menu. To create a new project, select New.
This creates an empty map that can be filled by adding features using Layer/Add. You
can save a project by clicking on Project/Save. Project files have the extension DIV.
The names of the last 10 projects you saved are listed at the bottom of the Project
menu to allow quick access to these files. You can open a recently used project by
selecting it from this list.
It is important that you clearly understand the difference between a DIVA-GIS project
file (DIV) and the layers (files) that make up the map. The project file does not
contain the actual data, it only points to the files containing the data pertaining to the
different layers included in the project, and stores map properties (such as scale).
Relative paths (e.g., \diva\myshp.shp) are stored for data files that are below the
project file in the folder structure. This allows sharing projects over a network, or
saving them on a CD-ROM (different drive letters can be used). For all other files, the
absolute path is stored (e.g. c:\mydata\diva\myshp.shp). It is also possible to use
network paths (e.g., \\network\share\shape.shp).
This means that if you delete a project file, all your data will be still be available.
However, if you delete, or rename, a data file, the project file will not be able to find
it anymore, and DIVA-GIS will show a message indicating this.
Import project and Export project
Another way to share a DIVA-GIS project is to place all its contents into a DIVA-GIS
export file (extension DIX). In contrast to a DIV file, the DIVA-GIS export file contains
the project file and all the layers (data files). You can send such an export file to
another DIVA-GIS user, who can then import it into DIVA, or you can use it to simply
store all files pertaining to a project in one location. These files are compressed, and
they do not take up much disk space; they can often be sent to another user via email.
To import a project file, you must indicate where the data should be expanded, and
under which project name. Typically, you would make a new directory for this, so that
it is clear which files belong to a specific project that you imported.
The Data menu will help you to manage your data. It includeds functions to import and
export data to and from DIVA-GIS and to check or prepare coordinate data for use.
Box 3. The Data menu
Icon Sect. Name
Import Points to
Creates a shapefile of points from a text file, DBF
file or Access database.
Import Text to
Creates a shapefile of lines or polygons from a text
Creates a shapefile of points, lines or polygons by
moving the cursor across the map
Polygon to Grid
Assigns values from a polygon shapefile to a
Points to Convex
Creates a convex polygon around all points in a
Selection to new
Saves a selected part of a shapefile, or indeed a
complete gridfile, to a new shapefile
Extract values by
Extracts values from a grid or a stack for all points
in a shapefile and produces different types of text
Queries a location on the map for its climate
Creates grid files of climate variables
Creates CLM files
There used to be a module (“Assign Coordinates”)
for this. Now this will take you to the
Check Coordinates Compares locality descriptions in a point shapefile
file with those in a polygon shapefile file
3.10 Export Gridfile
Exports a gridfile to a number of other grid data
3.11 Import to Gridfile
Imports a gridfile from a number of other grid data
3.12 Write VRT file
Write a „Virtual Raster‟ header file to open
gridfiles in e.g. ArcGIS or Quantum-GIS.
3.13 Export Shapefile
Export Shapefile to Google Earth KMZ file
3.14 File Manager
Renames or deletes gridfiles and shapefiles.
Goes to the DIVA-GIS website to download data
(needs an Internet connection).
Import Points to Shapefile
With this menu you can create a shapefile of points from a text file, a DBF file or an
The TXT file must have a header row containing the variable names. It does not matter
whether the columns are separated by spaces or a symbol (such as a comma or tab):
the importation wizard will read your data anyway when you tick the box which
specifies the separator you are using (Figure 5). However, “tab-separated” is probably
best. Using commas as separators causes problems when you have a field with locality
descriptions, which may well include commas (this problem can be circumvented by
using “quotes” around text.
DIVA will figure out for itself what type of data is present in each column of the
database: text, integer (whole) or real (decimal) numbers. But you may change this
automatically generated setting if you wish. The same goes for the maximum number
of spaces that a value of the variable will need. If you indicate fewer spaces than are
actually used, the data will be truncated (cut off at the position that you indicated),
With Import Points to Shapefile/From dBase IV file (DBF) you can make a shapefile of
points from a DBF file if that DBF contains fields with latitude and longitude (both in
decimal degrees). First, you must indicate the filename of your DBF file. And you must
provide an output filename that is different from this input filename.
The program then reads the input file and allows you to select the fields that have the
X (longitude) and Y (latitude) coordinate data. By default, only numerical fields are
listed for you to choose from. However, you can check the “Include Text Fields” box
to see text fields as well. If you use a text field for the X and Y coordinates, DIVA-GIS
will attempt to transform the text values to numbers. Where this is not possible, or
where there is no entry at all, an “empty” record is created. That is, the record is
copied to the DBF table of the shapefile, but no associated point is created.
Documents you may be interested
Documents you may be interested