--------------------------------------------------------------------------------
IMP is the Laser-Scan *IFF *Map *Processing package. IFF stands for *Internal *Feature *Format and is the Laser-Scan vector file format generated by LASERAID and other Laser-Scan mapping systems and used as the data structure throughout the Laser-Scan LAMPS system. IFF files are binary and cannot be manipulated directly using a text editor. The IMP package enables the user to perform a wide range of file manipulation tasks related to the requirements of the automated mapping industry.
The IMP package consists of independent modules which together form a powerful data manipulation system within an automated mapping environment. The modules which form the IMP package offer:
IMP is designed to replace the existing Laser-Scan DAMP (DAta Manipulation Package). The following summary listing of the DAMP package can be made to indicate the functional correspondence between the two packages.
+----------+---------------------------------------------+------------+ | REPLACED | DAMP | NEW IMP | | DAMP | MODULE | MODULE | | MODULE | FUNCTION | | +----------+---------------------------------------------+------------+ | CHKLP | Check for loops in IFF data | ICHECK | | CMPIFF | Compare two IFF files | IDIFFERENCE| | I2TEXT | IFF to text file conversion | ITOTEXT | | TEXT2I | Text file to IFF conversion | IFROMTEXT | | ICE | IFF combine and extract (for edge matching) | IMERGE | | ICLIP | Map clipping | IWINDOW | | IED | IFF patch editor | IPATCH | | IFINFO | Summarise the contents of an IFF file | IINFO | | IFIX | Correct specific faults in IFF data | IFIXAREA | | IFSN | Reallocate feature serial numbers | IRENUMBER | | IFT | Tidy up an incomplete IFF file | IMEND | | IPR | Process (transform or clip) IFF data | ITRANS | | IRN | Reallocate internal sequence numbers | IRENUMBER | | LIT | Change or extract feature codes by layer | ILAYFC | | MER | Merge IFF files or extract IFF layers | IMERGE | | MIF | Mend an improperly closed IFF file | IMEND | | SCI | Scan an IFF file, giving statistics | IINFO | | SELAC | Select features on the basis of ACs or FSNs | ISELAC | | SIF | Sort by feature or internal sequence number | ISORT | +----------+---------------------------------------------+------------+
All major DAMP package functionality is retained in IMP, although the module which provides that functionality may have changed. In addition there are IMP modules which offer functions not available within the DAMP package:
Other IMP modules exceed the functionality of the DAMP module equivalent. IMERGE, for example, offers division of data into 2 separate IFF output files on the basis of IFF layer, the DAMP equivalent, MER, does not. IPATCH the IMP non-graphic IFF editor offers backward movement through the IFF file. IED the DAMP non-graphic editor does not.
Within the VAX/VMS system IFF files can be treated as any other file type for file management purposes. To enable the user to distinguish an IFF file from a file of another type IFF files have by default the file extension '.IFF'. To provide great flexibility in the production environment IFF files are referenced by all the IMP modules using logical name LSL$IF:. (For an explanation of logical names see the VAX/VMS document set). Logical name LSL$IF: is assigned to a device and directory specification either using the VMS DEFINE command or the Laser-Scan SI utility, (see Appendix D).
Four new IFF entry types are available for use with IMP modules:
Many Laser-Scan customers have large archives of IFF files which do not contain the new IFF entries. IMP modules are designed to treat IFF files of an historic nature in the same manner as the DAMP utilities would. No new type IFF entries are placed into an IFF file if the IFF file specified as input to an IMP utility does not already have those entries. Compatibility between IMP and existing databases is thus achieved. "New type" IFF files which contain HI, type 2 MD, TS, and ZS entries may be generated using ISTART (or IFROMTEXT in conjunction with a suitable textual representation of an IFF file).
A problem arises for those IMP modules which take input from more than one IFF file when the input files are a mixture of "old type" and "new type" IFF files. Under these circumstances the input file which is specified first is considered to set the standard for the output file.
The modules which form the IMP package provide a mechanism for
automatically recording statistics in an IFF file each time it is updated, so
that it may be determined which users and programs contributed to the final
state of the file. The statistics are stored in an HI (HIstory) entry within
the IFF file. This entry is of fixed length (4001 words). The first word
contains a count of the number of filled 'history records', and is followed by
space for 100 80-byte ASCII records each with the following format:
Date Time Username Program Function Elapsed CPU STATUS 23-JUL-1985 12:22 CLARKE TWOTVES Output 01:31:34 00:09:05 00000001
In order that the mechanism can work, a blank history entry must be inserted in files created from scratch. Clearly it would cause compatibility problems with customer databases which contain historic IFF files if HI entries were created in output files by default. To overcome this problem an HI entry is only written to the output file if (one of) the input files contained an HI entry. The IMP module ISTART creates a template IFF file containing an HI entry.
In addition to writing timing statistics into the HI entry, the IMP modules also set the 'function' field of the HI and also set the final status field to indicate the success (or failure!) of the run.
IMP provides a module (IINFO) which may be used to analyse the contents of an IFF file's HI entry and optionally produce timing statistics to indicate total elapsed and CPU time spent during the processing of the file.
When an IFF file is opened for write, a 'prototype' history record, with blank elapsed and CPU fields, and a status of 0, is written to the HI entry and also to the forepart of the file. In the event that the file is never properly closed, this record can be examined (possibly using the VMS DUMP utility) to determine which operation had failed. It will not be possible to open such a file with any IFF library (IFFLIB) based utility (such as those of IMP) until the IMP module IMEND has been used.
The origin offset is held in a type 2 MD (Map Descriptor) entry. The origin offset is an (X,Y) coordinate pair, each held as a REAL*8 (double precision) number, that is added to any pair of coordinates in the IFF file to give the true projection coordinates of the points. This allows the absolute size of the coordinates in the IFF file, which are only held as REAL*4 (single precision) numbers, to be reduced, thus avoiding problems of truncation and impaired accuracy. The origin offset entry may be set up using IFROMTEXT, ISTART or ITRANS/DESCRIPTOR. Generally the use of an origin offset results in the south west (bottom left) control point of the map being reduced to the coordinate (0.0,0.0). IMP modules are designed to utilise the origin offset only when reference to adjoining map sheets (as IFF files) or IFF file projection transformation is required. The user may manipulate the within-file data relative to the local (0.0,0.0) origin without reference to the origin offset. It is most important that the origin offset is correctly set. The IMERGE (file merging) and ITRANS (file transformation) utilities rely heavily upon the origin offset. Errors in its application may result in irrevocably scrambled data.
Like VMS utilities, all IMP modules generate VMS format messages and set VMS DCL symbol $STATUS on image exit. This is a valuable feature as a non-interactive process can test the success of a preceding IMP module before proceeding. $STATUS will always be set to a VMS 32 bit condition code. Successful program execution will result in $STATUS being set to SS$_NORMAL. If an error occurred during IMP processing, SS$_ABORT of varying severities, or a VMS System or CLI (Command Line Interpreter) condition code will be used. The user may simply test $STATUS for TRUE or FALSE within a DCL command procedure. If $STATUS is TRUE then processing was successful. If it is FALSE, an error occurred during processing. For a detailed description of the uses of $STATUS see the VAX VMS document set.
All IMP modules handle 3 dimensional strings held in IFF ZS entries. Where appropriate the three dimensional strings are processed in the same manner as 2 dimensional strings. The exceptions to this rule are IFILTER and IWINDOW.
IFILTER does not interpolate or filter 3 dimensional strings at all but instead passes them through to the output file in an unmodified state.
IWINDOW will clip a three dimensional string using the same rules as applied to 2 dimensional strings held in ZS entries. The Z-value of the intersection between string and clipping boundary is estimated using simple linear interpolation based upon the known heights of the two points defining the segment which contains the intersection point.
Once logged in the user must give two commands to initialise the IMP package. Before the IMP package can be used DCL symbols and logical names must be assigned to enable the user to invoke the modules. This is dome using a command procedure IMPINI.COM which is supplied as part of the IMP package. IMPINI itself will be defined as a DCL symbol at your site and should be invoked thus: (see PREFACE for explanation of presentation conventions)
$ IMPINI<CR>
The IMPINI command invokes a command procedure which defines a DCL symbol (the module name) for each of the IMP modules. After using IMPINI the user need only type the symbol name to activate the module of his choice.
As an alternative to explicitly typing the IMPINI command each time the user wishes to use the IMP package, the IMPINI command may be placed in the users login file, or in the site dependent default login file.
The second command which must be given before using the IMP package is the SI command. The SI command assigns the logical name LSL$IF: (or IF: for short) to the device-directory specification which contains the IFF file(s) that are to be manipulated. For example:
$ SI DUA3:[BUREAU.TRIALS.DIGITISING]
This will assign logical name LSL$IF: to the device and directory specification DUA3:[BUREAU.TRIALS.DIGITISING]
For a discussion of the use of the SI command see Appendix D.
--------------------------------------------------------------------------------
Some IMP modules offer an option to make the specified changes in an in-situ mode on the input file. If the user is confident that the changes specified are correct then there may be advantages in processing speed and certainly disk space advantages in adopting this approach. It cannot be overstressed, however, that the in-situ mode of operation does involve over-write of the source data which cannot be restored in the event of user, system or processing error. The default mode of operation of all IMP modules is to open the input file as read-only. Processing will result in the creation of a new output file. In-situ IFF file processing should be used with great care.
$ IRENUMBER/IN_SITU DUA0:[BUREAU.TRIALS]FILE4.IFF<CR>
IMP modules which have the /IN_SITU command qualifier and are thus subject to this restriction are:
--------------------------------------------------------------------------------
All IMP modules open IFF files using the Laser-Scan LSLLIB library of service routines. This results in a standard set of four messages for successful IFF file opening and three primary messages for IFF opening errors:
Messages to indicate that the IFF file was successfully opened:
IFFOPENED, 'file-spec' opened for read
Explanation: The indicated file was successfully opened, readonly, for input.
User action: None, other than to check that the correct file has been opened.
IFFOPENED, 'file-spec' opened for write
Explanation: The indicated file was successfully created and opened for output.
User action: None, other than to check that the correct file has been opened.
IFFOPENED, 'file-spec' opened for update
Explanation: The indicated file was successfully opened for in-situ modification or extension. Beware that the original status of the file will now be irrevocably changed.
User action: None, other than to check that the correct file has been opened.
Messages to indicate that the IFF file could not be opened:
All the messages in this category will be supported by supplementary Laser-Scan and VMS System or RMS (Record Management Services) messages. These supplementary messages will normally convey all the information required to determine why the file could not be opened. It is recommended that the user becomes familiar with the location of the VMS error message explanations within the VMS documentation set.
IFFOPEN, IFF error opening file 'file-spec' for read
Explanation: An error occurred while attempting to open the specified file for readonly input.
User action: The supplementary Laser-Scan, VMS system or RMS messages which are output in support of this message will facilitate diagnosis. One common mistake is to forget to assign the logical name LSL$IF: to the directory containing the desired file. If the RMS message "file not found" is issued check the assignment of LSL$IF:.
Possible causes for the error are:
IFFCREATE, IFF error creating file 'file-spec'
Explanation: An error occurred while attempting to create and open the specified file for output.
User action: The supplementary Laser-Scan, VMS system or RMS messages which are output in support of this message will facilitate diagnosis.
Possible causes for the error are:
IFFMODIFY, IFF error opening file 'file-spec' for update
Explanation: An error occurred while attempting to open the specified file for modification.
User action: The supplementary Laser-Scan, VMS system or RMS messages which are output in support of this message will facilitate diagnosis.
Possible causes for the error are:
IMP utilities use the VMS Command Line Interpreter (CLI) to get and parse the program command line. IMP utilities thus offer a VMS emulating user interface. As many IMP utilities require floating point arguments to command, qualifiers Laser-Scan have developed an enhanced CLI based command line decoding mechanism. This enables the interpretation of numbers as either "real" or "integer".
The CLI allows the user to specify single and lists of integer qualifier arguments. If a list of arguments is specified, each argument must be separated by a comma and the whole list enclosed within parentheses, for example:
Single argument:
$ EXAMPLE/QUALIFIER=7<CR>
Where "EXAMPLE" is the command and /QUALIFIER is a qualifier to that command. There is one qualifier argument - 7
Argument list:
$ EXAMPLE/QUALIFIER=(2,5,8,9,10,11,12,13,14)<CR>
Where "EXAMPLE" is the command and /QUALIFIER is a qualifier to that command. There are 9 qualifier arguments within the argument list.
While developing the floating point command line data type (see Preface) it was recognised that there is a need for numeric range decoding within a VMS emulating command line. Argument ranges are specified with the syntax:
n:m
Where n is the lower limit of the range and m is the upper limit of the range (inclusive).
Such ranges are expanded in full. A maximum of 1024 arguments can be specified to any one command qualifier.
If we take our example argument list used above, i.e:
$ EXAMPLE/QUALIFIER=(2,5,8,9,10,11,12,13,14)<CR>
and now use the Laser-Scan argument range decoding mechanism:
$ EXAMPLE/QUALIFIER=(2,5,8:14)<CR>
we see that a more compact command line results but yields the same arguments. This is clearly an advantage in an IFF map processing environment where a single file could contain hundreds of attributes which the user may wish to reference via command line arguments.
Other examples are:
$ EXAMPLE/QUALIFIER=2:9<CR>
This yields 8 integer arguments: 2, 3, 4, 5, 6, 7, 8, and 9
$ EXAMPLE/QUALIFIER=:8<CR>
This yields 9 integer arguments: 0, 1, 2, 3, 4, 5, 6, 7, and 8
If when ranges are decoded, a qualifier has more than 1024 arguments the Laser-Scan LSLLIB library issues the error message:
%LSLLIB-E-RESPARSOVF, result of parse overflowed buffer
and program execution is terminated.
Floating point value ranges are decoded in a different manner to integer value ranges. Instead of expanding the range to yield all its component integer values the command decoder merely leaves the range as a lower limit and an upper limit. Processing then takes account of any possible value lying between these limits (inclusive).
For example:
$ ISELECT/HEIGHT=(23.5:110.2)<CR>
Select all features having a height which lies within the range 23.5 to 110.2 inclusive.