Formal metadata information and software
DBFExplorer: A better tool to help document DBF files
DBFExplorer is a software tool designed to facilitate the documentation
of data contained in DBF files. These data files are increasingly
common because they are used to store attributes of geographic
features in shapefiles used and produced by ESRI products. DBFExplorer
is at this point very experimental, and needs refinement, but is
ready for testing by the hardiest of metadata writers. I expect
this may be more useful than dbfmeta,
at least for some operations.
The Interface
When the DBFExplorer script is run, the main window appears.
Choose Open from the File menu to select a DBF file.
If you already have a metadata record, choose that as well. When
you click OK, both files will be opened and compared.
Here's what the File-Open dialog
looks like. If you don't have metadata, leave that field
blank and click OK anyway. It'll create metadata for you.
You may see a window titled Warnings that shows you
potential problems and allows you to fix them.
Here's and example of the Warnings dialog.
Three different problems might be presented to you:
- Fields in the metadata but not in the DBF
-
If your metadata describe attributes that don't correspond to
fields defined in the DBF file, you'll be given the option of
deleting those attributes from the metadata. The button labeled
Remove extras deletes them all.
- Fields in the DBF file but not in the metadata
-
If your DBF file contains fields for which there is no corresponding
Attribute section in the metadata, those fields will be listed
here. You can add them all to the metadata by clicking the button
labeled Add missing.
- Attributes you have not defined yet
-
These are attributes that appear in the metadata for which
there is no Attribute_Definition field. You can enter a
short definition for each field. The new definitions will
be stored in the metadata when you click Done to
dismiss the warnings window.
The DBFExplorer interface shows in a list the fields present in the DBF
file, along with a set of tabbed windows that present the information that
is known about the selected field.
- Description
-
The definition of the attribute and the source that links the field
label with that definition, along with the general description of
the values that is used when more specific descriptions are not
helpful.
- Values
-
A sorted list showing the distinct values this field holds.
Using this window you can explain the meaning of any individual
value.
- Codes
-
If the field's values conform to a standard list, this window
lets you provide the name and source of that list.
- Range
-
For numeric fields, you can specify the range of legitimate
values as well as the units and resolution of the measurements
they represent.
- Statistics
-
If the selected field is numeric, some basic summary statistics
are shown, including the number of rows for which the field is
empty and the minimum, median, maximum, and hinges (25th and
75th percentile values).
Download
DBFExplorer is written in Tcl/Tk
but uses mq (an extension to Tcl for handling
metadata) as well as a heretofore unreleased Tcl extension
for reading DBF files. You'll need several different things:
Installation instructions for MS Windows
1. Install Tcl/Tk by running the ActiveState installer.
I will assume you allow it to install in C:\Tcl
2. Extract mq-2.6.zip into C:\Tcl\lib
3. Extract tcldbf into C:\Tcl\lib
4. Find the script dbfexplorer.tcl on your system and double-click it.
It also runs on Linux, of course. Contact me for instructions.
Limitations and planned improvements
-
Works with DBF files, not coverages or other data sources
-
Works with the first
Detailed_Description
in the
metadata record and ignores any others. So if your metadata
describe more than one shapefile, you'll need to isolate each
one in its own metadata record (you can combine later with Tkme,
of course).
-
Considers only one
Range_Domain
and only one
Codeset_Domain
for each Attribute. It's possible
to use more than one of these for an attribute, but I think
it's going to be rare.
-
Doesn't have a way to reassign an
Attribute_Label
,
so if you have a good description of one of the attributes, but
the label is wrong, you have to fix it in the metadata before
running this program.
-
Not the fastest thing on the planet. When you have a numeric
attribute with ~100,000 values, you'll notice the time lag
in calculating the statistics and populating the list of
distinct values.
-
I'd like to make keyboard shortcuts for traversing the list
of attribute values. Currently Alt-Up, Alt-Down, Alt-Home and
Alt-End allow you to go from field to field.
-
I'd like to present the user with an array of type-in boxes for
Enumerated_Domain_Value_Definition
just like I do
for Attribute_Definition
in the Warnings
window.
-
The Edit menu options have standard labels, but they
don't do anything yet. I'm not sure what, if anything, they
should do.
-
Packaging? Installer? Bah, humbug!
Technical contact:
Peter N. Schweitzer
Mail Stop 954, National Center
U.S. Geological Survey
Reston, VA 20192
Tel: (703) 648-6533
FAX: (703) 648-6252
Email: pschweitzer@usgs.gov