------------------------------------------------------------------------------ MODULE ISTSEL
------------------------------------------------------------------------------ REPLACES NONE ------------------------------------------------------------------------------
ISTSEL is the Laser-Scan *IFF *S*Tring *S*E*Lection utility and forms part of the Laser-Scan POLYGONS Package. ISTSEL reads an IFF file and compares text strings held as AC (Ancillary Code) left/right codes and TX (TeXt) entries to keys given in a user specified lookup file.
If a match is found between the IFF text string and any of the keys in the lookup file then the left/right code is replaced with the matched key defined in the lookup file. After left/right code replacement, segments with identical left/right codes are identified and are not written to the output IFF file. This provides ISTSEL with the mechanism for segment selection and hence selective polygon aggregation.
$ ISTSEL input-file-spec output-file-spec Command qualifiers Default /DEF_FILE=file-spec See text. [NO]/LOG /NOLOG
_Input data file: input-file-spec
_Output data file: output-file-spec
input-file-spec
- specifies the IFF file which will be processed. Any part of the file specification that is not supplied will be taken from the default specification 'LSL$IF:IFF.IFF;0'.
- specifies the IFF file to be created. Any part of the output file specification that is not provided will be taken from the parsed input specification. Note that a version number must not be specified for the output file. If a file with the specified name already exists, a new file will be created with the version number incremented by one.
/DEF_FILE=file-spec
- defines the lookup file which contains the code definitions supplied by the user for the output IFF file. If /DEF_FILE is not specified or if /DEF_FILE is specified with no argument the default used is SYS$DISK:[]CODE_DEF.DAT;0.
/LOG
/NOLOG (default)
- this will result in supplementary messages being sent to SYS$OUTPUT. Supplementary messages are generated when a file is successfully opened, and a messages indicating the progress of ISTSEL processing are also output.
----------------------------------------------------------------------
ISTSEL allows polygon segment selection to be performed on an IFF file which contains data with left/right AC codes (AC types 4 and 5). This enables the user to group together polygons of a given code under a new code in the output IFF file.
The selection is based on information supplied by the user in a lookup file which defines the new code groupings. Each new left/right code (keyword) can be up to 255 characters in length. Up to 100 new codes may be specified. Each new code may be defined to replace up to 100 old codes.
ISTSEL does not require IFF junction entries to be present in the input IFF file, only that all links should have left/right AC codes. If junction entries are present they currently are not transferred to the output file. The STRUCTURE utility ILINK/STRUCTURE should be run on the ISTSEL output file if IFF junction structure is required for later processing.
----------------------------------------------------------------------
ISTSEL operation can be defined as follows.
----------------------------------------------------------------------
ISTSEL reads a user defined lookup file to get the information required for the segment selection process. A default code definition file CODE_DEF.DAT is supplied with the polygon package and should be present in the directory defined by the logical name LSL$LOOKUP. A copy of the example file is given below.
! Example code definition file for POLYGONS utility ISTSEL ! ! Copyright 1987 Laser-Scan Ltd, Cambridge, England ! ! Author: G S Tobiss 17-Feb-1987 ! ! File format is: ! ! %New_code ! Old_code_1 [, Old_code_n ... ] ! ! Where: ! ! ! - is a comment. Text after a "!" is ignored. ! % - indicates that the following text is to be read as a new ! segment code ! New_code - is the new segment code ! Old_code - is [one of a list of] old segment codes to be replaced ! by the new code. Old segment codes must be separated by ! commas . ! ! For example: ! %LOW_STRAW_INCORPORATION_POTENTIAL P123,P67a,P23/u ! %MEDIUM_STRAW_INCORPORATION_POTENTIAL P34, 901, River_terrace_material ! %MEDIUM_STRAW_INCORPORATION_POTENTIAL P67c,P98,P6Ab !
An exclamation mark '!' indicates a comment or comment line and is ignored by ISTSEL when reading from the code definition file. The new soil codes must be preceded by a percent '%' character. The old codes must be separated by commas. The limit on the number of old codes in each group is set at 100. Although IFF TX and AC entries can hold up to 255 characters, the number of characters allowed in a new or old code is set at 80. Duplication of old codes between the different new code groups is detected, a warning identifying the suspect code is given. Processing is abandoned after the whole file has been checked for duplication. Duplication of codes within a single new code group is permitted.
Using the example lookup file given above, all segments having the left or right code 'P34', '901', and 'River_terrace_material' will be recoded with with the new code 'MEDIUM_STRAW_INCORPORATION_POTENTIAL'. Segments which have this new code on both left and right sides will be omitted from the output IFF file and thus polygons formed by the segments having the 3 original codes 'P34', '901', and 'River_terrace_material' will be merged. The new polygon now formed by the merged original polygons will have the code 'MEDIUM_STRAW_INCORPORATION_POTENTIAL'.
$ ISTSEL/DEF_FILE=POLDEF.DAT/LOG_Input IFF file: DUA3:[BUREAU.SOILS]OLDCODES.IFF;7 _Output IFF file: GLEYS %ISTSEL-I-DEFOPENED, /DEF_CODE file SYS$DISK:[]POLDEF.DAT;0 opened for read %LSLLIB-I-IFFOPENED, DUA3:[BUREAU.SOILS]OLDCODES.IFF;7 opened for read %LSLLIB-I-IFFOPENED, DUA3:[BUREAU.SOILS]OLDCODES.IFF;8 opened for write Number of left/right coded links processed = 129 Number of left/right coded links deleted = 23 ELAPSED: 00:02:01.10 CPU: 0:00:57.15 BUFIO:8250 DIRIO: 3230 FAULTS: 1037 $
In this run of ISTSEL the user has supplied a specific code definition lookup file-spec using the /DEF_CODES qualifier. As only the filename and extension for the lookup file have been specified, the missing device and directory are taken from the default 'SYS$DISK:[]' (i.e. user's current default set using the VMS SET DEFAULT or the SD command) and the version number defaults to ';0', i.e. the latest version of the file.
The /LOG qualifier has also been selected. The user has then pressed carriage return after which he has received a prompt for the input file. In response to this prompt he has supplied a complete specification for the input file. The user has again pressed carriage return and has been prompted for the output file-spec. The missing parts of the output file specification have been taken from the input file-spec.
Notice that as a result of specifying the /LOG qualifier, messages have been output indicating the successful opening of the code definition lookup file and the input and output IFF files. At the end of the run ISTSEL has output a summary of the number of left/right coded links processed and how many have been omitted from the output file. The run completed successfully. $STATUS is set to SS$_NORMAL - normal successful completion.
$ ISTSEL/LOG
In this run of ISTSEL the user has pressed carriage return after the ISTSEL command and has received a prompt for input. In response to the prompt he has supplied a complete specification for the input file. The missing parts of the output file specification have been taken from the input file-spec. The default definition file SYS$DISK:[]CODE_DEF.DAT is assumed (i.e. that it is in the current default directory), since no alternative has been specified with the /DEF_FILE qualifier. No lookup file of that name exists, however, and ISTSEL aborts execution. STATUS is set to SS$_ABORT.
The user must ensure that a lookup file having the default specification is available, (or else explicitly supply a lookup file-spec with the /DEF_FILE qualifier), before attempting to re-run ISTSEL.
$ ISTSEL POLFILE NEWFILEELAPSED: 00:01:10.20 CPU: 0:00:37.15 BUFIO:6250 DIRIO: 2230 FAULTS: 797 $
In this run of ISTSEL the user has only specified a filename for the input and output file-specs. The missing parts of the file specifications have been taken from the default file-spec 'LSL$IF:IFF.IFF;0'. The default definition file SYS$DISK:[]CODE_DEF.DAT;0 is assumed (i.e. that it is in the current default directory), since no alternative has been specified with the /DEF_FILE qualifier. The run completed successfully. $STATUS is set to SS$_NORMAL - normal successful completion.
These messages give information only, and require no immediate action by the user. They are often used to supply explanatory information in support of a warning or error message.
Explanation: The specified (or default) code definition lookup file has been opened successfully.
User action: Check that the file specified is the one that was intended for use.
These messages are output when an error has occurred which the user can correct immediately.
ERRAC, Only one left/right AC detected in feature with FSN 'integer' ('integer')
Explanation: The feature identified has has either a type 4 (left hand code) or type 5 (right hand code) AC (Ancillary Code) missing. Processing will continue and the feature will be copied to the output file.
User action: Use LITES2 to investigate the feature in question and add the relevant AC.
These messages indicate an error in processing which has caused the program to terminate. The most likely causes are a corrupt or otherwise invalid input IFF file, or an error related to command line processing and file manipulation. As it is most unlikely that any output file produced will be correctly processed, the output file will normally be deleted.
DUPCODES, duplicate code "code" detected at line 'integer' of code definition file 'file-spec'
Explanation: Duplicate codes have been detected in the definition file, supplementary messages will identify the suspect codes. Processing will continue until the whole definition file has been checked.
User action: Edit the suspect codes out of the definition file
FOR, error in code definition file format at line 'integer of 'file-spec'
Explanation: A list of old codes was detected before a new code definition was found.
User action: Check the format of the code definition file.
MAXCODEEX, maximum number of new codes exceeded at line 'integer' of code definition file - maximum allowed is 'integer'
MAXCODEEX, maximum number of old codes exceeded at line 'integer' of code definition file - maximum allowed is 'integer'
Explanation: The maximum number of old or new left/right codes currently allowed has been exceeded.
User action: Ensure that the code definition file does not contain more than the specified number of old or new codes. If it does then use VMS EDIT (or similar) to split the file into two (or more) new files. Re-run ISTSEL once for each code definition file, thus performing the segment selection process in two stages.
NODATA, no data found in code definition file 'file-spec'
Explanation: No data was read before the end of the code definitions file was found.
User action: Check the content of the code definition file.
OPDEF, error opening code definition file 'file-spec'
Explanation: ISTSEL is unable to open the code definition file specified by the /DEF_CODE qualifier argument (or default).
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:
READEF, error reading line 'integer' of code definition file 'file-spec'
Explanation: An error has occurred while reading the specified code definition file. The supplementary error messages should give more information on the error.
User action: Check that none of the codes in the code definition file are longer than 255 characters. Use the information supplied in the supplementary messages to diagnose the fault, then use the VMS EDIT (or similar) editor to correct the code definitions file. Re-run ISTSEL.
UNEXPEOF, unexpected end of IFF input file
Explanation: The input IFF file terminated before an IFF EJ entry was encountered.
User action: Use IMEND to correctly terminate the file.
--------------------------------------------------------------------------------
In addition to the above messages which are generated by ISTSEL itself, other messages may be produced by the command line interpreter (CLI) and by Laser-Scan libraries. In particular, messages may be generated by the IFF library. These are introduced by '%IFF' and are documented in the IFF library users' guide. If the cause of the error cannot be traced by the user and Laser-Scan are consulted, then the output file should be preserved to facilitate diagnosis. Generally, however, ISTSEL will attempt to delete any corrupt output file before program termination.