Shapefiles are the dominant file format used for spatial data (of the "vector" type: points, lines, polygons). All GIS programs can import them, and many, like DIVA-GIS, use them directly. A shapefile consists of multiple files: .shp, .shx, .dbf, and sometimes more. The attributes (data records) of the spatial features are stored in the .dbf file. That was convenient because these files could be easily edited with Microsoft Excel -- which is installed on the vast majority of windows computers. Unfortunately, in recent versions of excel (Office 2007) you can only open a .dbf file, but you can not save it. That is a real hassle for shapefile users.
DIVA does not have dbf editing. And it is a pain in programs that do (ArcMap); most people prefer the excel backdoor. Now what?
Perhaps this is the reason to ditch Office? I tried Calc, from OpenOffice. Not as nice as Excel, but close enough. It can open and save .DBF files. You can also set the field types. Excel would guess these for you based on the first cell in each column and that could be disastrous. In Calc you have more control (and new ways to make a mess of it).
If you want to stick with Excel you can try the plug-ins that some good folks out there have developed. I installed this one, which works nicely (also after disabling the feature that MS calls a security concern when you install it), except that it does not not overwrite an existing file (it creates a new file by appending "_new" to the filename).
I also tried this one make sure you use the updated version towards the end of the page) -- to avoid the "missing Visual Foxpro .." problem. Same problem, only "Save As" (hard to find, you need to scroll down to the end of the new panel, after expanding it, do not go to the classic save dialog box)
Not being able to overwrite a file is safe, but a really annoying waste of time (I assume this is a limitation of the underlying dbf database driver, and not something the plug in developers came up with). So now, after you save a file, you first need to delete (or rename to "_old"?) the original file, and then rename the new one (remove "_new"), and the attribute data of your shapefile have been edited.
This is how you can install an Excel plug in:
1) Download, unzip, and put the add-in file here:
C:\Documents and Settings\"user name"\Application Data\Microsoft\AddIns
(replace "user name" with your user name, and it can be somewhere else if you want) Note that Explorer won't show this Application Data folder. But it does exist, just type it into the address bar.)
2) Click on the Office Button / Excel options (at the bottom) / Add-inn
3) Manage Excel Add-Ins / Go
5) Select the add-in file and you are done (in the case of
Does anyone have better suggestions for editing .dbf files then what I described above? And do you think that DIVA should have DBF editing?
Either way, I need to rewrite the manual and exercises. Ay, Microsoft, why break something that is not broken?