File ddfread.icn

Summary

###########################################################################

	File:     ddfread.icn

	Subject:  Procedures for reading ISO 8211 DDF files

	Author:   Gregg M. Townsend

	Date:     June 26, 2000

###########################################################################

   This file is in the public domain.

###########################################################################

	These procedures read DDF files ("Data Descriptive Files",
	ISO standard 8211) such as those specified by the US Geological
	Survey's "Spatial Data Transfer Standard" for digital maps.
 	ISO8211 files from other sources may contain additional data
	encodings not recognized by these procedures.

	ddfopen(filename) opens a file and returns a handle.
	ddfdda(handle) returns a list of header records.
	ddfread(handle) reads the next data record.
	ddfclose(handle) closes the  file.

###########################################################################

	ddfopen(filename) opens a DDF file, decodes the header, and
	returns an opaque handle for use with subsequent calls.  It
	fails if any problems are encountered.  Instead of a filename,
	an already-open file can be supplied.

###########################################################################

	ddfdda(handle) returns a list of records containing data
	from the Data Descriptive Area (DDA) of the file header.
	Each record contains the following fields:

		tag	DDR entry tag
		control	field control data
		name	field name
		labels	list of field labels
		format	data format

	The records may also contain other fields used internally.

###########################################################################

	ddfread(handle) reads the next data record from the file.
	It returns a list of lists, with each sublist containing
	a tag name followed by the associated data values, already
	decoded according to the specification given in the header.

###########################################################################

	ddfclose(handle) closes a DDF file.

###########################################################################
Procedures:
dda_list, ddf_binn, ddf_dtree, ddf_fcrack, ddf_int, ddf_intn, ddf_oneof, ddf_rdata, ddf_real, ddf_realn, ddf_repeat, ddf_rhdr, ddf_str, ddf_strn, ddfclose, ddfdda, ddfopen, ddfread

Records:
ddf_dde, ddf_decoder, ddf_header, ddf_info

This file is part of the (main) package.

Source code.

Details
Procedures:

dda_list(p)


ddf_binn(n)

 binary value of n bytes


ddf_dtree(format)


ddf_fcrack(s)


ddf_int(cs)

 delimited integer


ddf_intn(n)

 integer of n digits


ddf_oneof(tabproc, moveproc, quantum)


ddf_rdata(f, h)


ddf_real(cs)

 delimited real


ddf_realn(n)

 real of n digits


ddf_repeat(lst)

 repeat sublist to EOR


ddf_rhdr(f)


ddf_str(cs)

 delimited string


ddf_strn(n)

 string of n characters


ddfclose(handle)

: close DDF file


ddfdda(handle)


ddfopen(fname)

: open DDF file


ddfread(handle)

: read DDF record


Records:

ddf_dde(tag, control, name, rep, labels, format, dlist)

Parameters:
tag
record tag
control
field control
name
field name
rep
non-null if labels repeat to end of record
labels
list of labels
format
format
dlist
decoder list
 data description entry


ddf_decoder(proc, arg)

Parameters:
proc
decoding procedure
arg
decoder argument
 field decoder record


ddf_header(hcode, dlen, ddata, tsize, lsize, psize, s)

Parameters:
hcode
header code (R if to reuse)
dlen
data length
ddata
dictionary data (as a string)
tsize
size of tag field in dictionary
lsize
size of length field
psize
size of position field
s
header string
 DDF header information


ddf_info(file, header, dlist, dtable)

Parameters:
file
underlying file
header
last header
dlist
DDA list (of ddf_dde records)
dtable
DDA table (indexed by tag)
 basic DDF file handle



This page produced by UniDoc on 2021/04/15 @ 23:59:54.