Previous: cpg - Codepage, Up: Shapefile [Contents][Index]
Module (shapefile dbf)
.
Contains auxiliary information about the shapes in the shp file. With one record per shape.
Wikipedia claims that the DBase files should be Version IV 3. The files I have however all use DBase version 3, therefor that is what is supported in the code.
port is an open input port which the data will be read from.
transcoder is an (rnrs io base)
transcoder, which
signifies which charset the data has.
Returns two values. A list of field descriptors See field-descriptor-v3, and a vector of records.
Each record is a list list on the form (bool data ...)
, where
bool is whether or not the record is removed (#t
for
removed, #f
if still there). The remaining data fields
corresponds directly to the fields in the field descriptor list.
However, usually you don’t want to deal with the data that way.
Takes the headers and data returned by load-dbase-file
, and
instead returns a list of association lists. One assoc list per
record (leading boolean removed), with the car
s being the field
names as symbols, and the cdr
s being the values.
Example:
(call-with-values (λ () (load-dbase-file port transcoder)) dbase-build-assoc-list)
Dynamically defining record types, and returning instances would be fancier. However, the utilities for record introspection are lacking, leading to the programmer needing to know the form of the generated records beforehand, defeating the point.
name is the name of the field. type signifies the type of the field, usually unneeded since the values are converted to proper scheme types when reading. See some official reference for proper information.
Previous: cpg - Codepage, Up: Shapefile [Contents][Index]