-------------------------------------------------------------------------------- MODULE IPOLYGON
-------------------------------------------------------------------------------- REPLACES CODSEG and POLCHK --------------------------------------------------------------------------------
IPOLYGON is the Laser-Scan automatic *IFF POLYGON creation and labelling utility. It forms the core of the Laser-Scan POLYGONS Package.
IPOLYGON is designed to be run in batch mode and all options may be specified on the command line. No user interaction is required during processing.
IPOLYGON carries out polygon formation and the determination of first order nesting based on the input geometry.
IPOLYGON offers two methods for labelling (and checking the consistency) of polygons:
In addition IPOLYGON provides a unique (internally generated) identifier for each polygon.
IPOLYGON offers four methods of polygon output:
All output options allow the label and/or identifier for each polygon to be output to the IFF features through the use of user-specified AC (Ancillary Code) entries.
$ IPOLYGON file-spec Command qualifiers /[NO]ABSOLUTE /ASCII=( [[NO]IDENT], [[NO]LABEL]) /[NO]LIST [='file-spec'] /[NO]LITES2 [='file-spec'] /[NO]LOG /LRCODE=( [LEFT_AC:'integer'], [RIGHT_AC:'integer']) /ONEARM=( [CONTAIN], [DELETE], [USE], [[NO]WARN]) /OPTIONS=( [[NO]AREA], [[ANTI]CLOCKWISE], [IDENT_TEXT:'text-string'], [[NO]NEST], [UNDEFINED:'keyword']) /PIP=( [FC:'integer'], [[NO]IDENT], [CONTAIN_IDENT_AC:'integer'], [ITERATE:'integer'] [[NO]LABEL], [CONTAIN_LABEL_AC:'integer'], [LAYER:'integer'], [OUTPUT:'file-spec']) /[NO]PME /POLYGONS=( [FC:'integer'], [[NO]IDENT], [IDENT_AC:'integer'], [[NO]LABEL], [LABEL_AC:'integer'], [LAYER:'integer'], [OUTPUT:'file-spec']) /[NO]PRINTER /PROPAGATE=( [FULL], [PARTIAL], [[NO]CONCATENATE], [LEFT_AC:'integer'], [RIGHT_AC:'integer'], [COVERAGE_FILE:'file-spec']) /SEED=( [AC:'integer'], [FC:'integer'[,....]], [FILE:'file-spec'], [LAYER:'integer'[,...]], [PAIR:'file-spec'], [SURROUND:'text-string'], [USE:'keyword']) /SEGMENTS=( [CONTAIN_IDENT_AC:'integer'], [CONTAIN_LABEL_AC:'integer'], [[NO]IDENT], [[NO]JUNCTIONS], [[NO]LABEL], [LEFT_IDENT_AC:'integer'], [LEFT_LABEL_AC:'integer'], [OUTPUT:'file-spec'], [RIGHT_IDENT_AC:'integer'], [RIGHT_LABEL_AC:'integer'], [SELECT_FC:'range;range...'])
--------------------------------------------------------------------------------
_Segment-IFF-file: IFF-file-spec
--------------------------------------------------------------------------------
IFF-file-spec
- specifies the junction structured IFF file from which the polygons are to be formed. Any part of the file specification which is not supplied will be taken from the default specification 'LSL$IF:IFF.IFJ'.
/ABSOLUTE
/NOABSOLUTE (default)
- this will result in the output of absolute coordinate values to any LITES2 guidance file requested with the /LITES2 qualifier, or to any other messages output. The default action is to output the usual LITES2 coordinate values.
/ASCII=([[NO]IDENT],
[[NO]LABEL])
/NOASCII (default)
- causes a list of all the segments which form each polygon to be written at the end of the /LIST text file. If /ASCII is specified without /LIST, the presence of /LIST on the command line is assumed and a text file created with the specification SYS$DISK:[]IPOLYGON.LIS;0. IPOLYGON will then behave as if an explicit /LIST qualifier was present on the command line. If /ASCII is specified without any of the keyword arguments, the following defaults are assumed:
/ASCII=(NOIDENT,
NOLABEL)
Segment listings will be output for each of the polygons. Whether polygon boundaries include first-order nesting is governed by the /OPTIONS=[NO]NEST qualifier. The segment lists will be ordered clockwise or anticlockwise depending on the /OPTIONS=[ANTI]CLOCKWISE qualifier. The generation of area statistics is governed by the /OPTIONS=AREA qualifier. Area calculations will reflect the first-order nesting convention used to output the segment lists.
/ASCII=IDENT
/ASCII=NOIDENT (default)
- indicates that the internally generated polygon identifiers are to be written to the ASCII output file.
By default identifiers are not written to the ASCII output file.
/ASCII=LABEL
/ASCII=NOLABEL (default)
- indicates that labels obtained from either seed points or left/right codes are to be written to the ASCII output file. The /ASCII=LABEL combination cannot be used unless the /SEED or /LRCODE qualifiers are present.
Polygons for which labelling has failed will be output depending on the state of the /OPTIONS=UNDEFINED:'keyword' qualifier.
By default labels are not written to the ASCII output file.
/LIST[='file-spec']
/NOLIST (default)
- by default, message and diagnostic output will be to SYS$OUTPUT. This option allows the user to redirect output to the specified text file. If the optional file-spec argument is omitted IPOLYGON directs output to a file named SYS$DISK:[]IPOLYGON.LIS. If the user supplies only a partial file-spec the missing file specification components are taken from the default specification SYS$DISK:[]IPOLYGON.LIS;0.
If the /ASCII qualifier is present then a list of all the segments which form each polygon boundary is written at the end of the /LIST text file. If /ASCII is specified without /LIST, the presence of /LIST on the command line is assumed and a text file created with the specification SYS$DISK:[]IPOLYGON.LIS;0. IPOLYGON will then behave as if an explicit /LIST qualifier was present on the command line.
/LITES2[='file-spec']
/NOLITES2 (default)
- creates a LITES2 command file to take the user to potential errors. Messages generated to report a potential error are incorporated in the file. By default the LITES2 command file specification is parsed against that of the input segments IFF file but with the substitution of logical name LSL$LITES2CMD: and the extension '.LCM'. Thus if the input IFF file is called LSL$IF:TST.IFJ then the default LITES2 command file is LSL$LITES2CMD:TST.LCM.
/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 messages indicating the progress of IPOLYGON processing are also output.
/LRCODE=([LEFT_AC:'integer'],
[RIGHT_AC:'integer'])
- indicates that labelling information is to be extracted from ACs (Ancillary Codes) on the input segments. Each input segment must have ACs indicating which polygons lie to the left and right of it. The polygon label is taken from the string part of the specified ACs.
/LRCODE cannot be used with the /SEED qualifier.
/LRCODE=LEFT_AC:'integer'
/LRCODE=LEFT_AC:4 (default)
- the label for the polygon lying to the left of a segment is obtained by taking the string part of the AC entry with the specified AC type. By default this type is 4.
/LRCODE=RIGHT_AC:'integer'
/LRCODE=RIGHT_AC:5 (default)
- the label for the polygon lying to the right of a segment is obtained by taking the string part of the AC entry with the specified AC type. By default this type is 5.
/ONEARM=(CONTAIN,DELETE,USE,[NO]WARN)
the purpose of the /ONEARM qualifier is to enable the user to choose how IPOLYGON reacts when it encounters an IFF junction which has only one arm. Such junctions can cause great problems to polygon formation algorithms which are designed always to 'turn right' or 'turn left' relative to the 'current' junction arm to form clockwise and anticlockwise polygons respectively.
IPOLYGON is designed to cope with any complexity of one arm junction branching and can, for example, form polygons from a mixture of dendritic drainage features and segments which do form closed polygons.
In addition to issuing simple warning messages when a one arm junction is encountered, IPOLYGON can deal with one arm junctions in one of three ways:
/ONEARM=CONTAIN
- when /ONEARM=CONTAIN is specified and a one arm junction is detected during polygon formation, IPOLYGON will go back to the junction that it left prior to arriving at the one arm junction and try a different arm. This process is repeated, possibly undoing much of the already formed polygon, until a route ahead is found, and the polygon closes. IPOLYGON will pass segments joined to one-arm junctions onto the output file. If polygon labels or identifiers are being used then an AC will indicate the segment is contained within the appropriate polygon.
/ONEARM=CONTAIN is only valid with the /SEGMENTS output qualifier.
The combination /ONEARM=CONTAIN cannot be used if /ONEARM=DELETE or /ONEARM=USE is present.
/ONEARM=DELETE (default)
- when /ONEARM=DELETE is specified and a one-arm junction is detected during polygon formation, IPOLYGON will go back to the junction that it left prior to arriving at the one-arm junction and try a different arm. This process is repeated, possibly undoing much of the already formed polygon, until a route ahead is found and the polygon closes. IPOLYGON will omit segments joined to one-arm junctions from the output file.
If /ONEARM=DELETE is used with the /SEGMENTS=JUNCTIONS combination, the output junction structured file has the same junction structure as the input file. Thus segments that would normally be omitted from output are retained. These can be identified if polygon labels or identifiers are being output. Such segments will have the text "Ignored Segment".
The combination /ONEARM=DELETE cannot be used if /ONEARM=CONTAIN or /ONEARM=USE is present.
/ONEARM=USE
- when /ONEARM=USE is specified and a one-arm junction is detected during polygon formation, IPOLYGON will track back down the other side of the free arm. This tracing round linework internal to a polygon can form a 'tree' which may (or may not) be connected to the outer boundary of the polygon. IPOLYGON will pass those segments that make up these trees onto the output file. If polygon labels or identifiers are being used then the left and right ACs will reference the same polygon.
The 'tree' will not affect polygon area calculations (/OPTIONS=AREA), nor will it affect FPP (Fast Plotting Program) area fill.
The combination /ONEARM=USE cannot be used if /ONEARM=CONTAIN or /ONEARM=DELETE is present.
/ONEARM=WARN
/ONEARM=NOWARN (default)
- warns the user of the presence of all one-arm junctions. If the /LITES2 qualifier is specified, commands are sent to the LITES2 command file to enable the user to quickly investigate the cause of the one arm junction using LITES2.
/OPTIONS=([[NO]AREA],
[[ANTI]CLOCKWISE],
[IDENT_TEXT:'text-string'],
[[NO]NEST],
[UNDEFINED:'keyword'])
- enables the user to select options that determine the method of polygon formation and the generation of unique identifiers. If /OPTIONS is not specified, or is specified without any of the keyword arguments the following defaults are assumed:
/OPTIONS=(NOAREA,
ANTICLOCKWISE,
IDENT_TEXT:"Polygon ",
NEST,
UNDEFINED:KEEP)
/OPTIONS=AREA
/OPTIONS=NOAREA (default)
- provides output of polygon area statistics. The /OPTIONS=AREA keyword is available for use only with the /ASCII, /PIP and /POLYGONS qualifiers. Output of ASCII segment listings or IFF closed polygon boundary features will perform area calculations according to the setting of the /OPTIONS=NEST qualifier. This will only effect the calculated areas of 'doughnut' shaped polygons.
/OPTIONS=CLOCKWISE
/OPTIONS=ANTICLOCKWISE (default)
- specifies that the segment or coordinate listings of any closed polygon features produced as output, using the /ASCII or /POLYGONS options, will have their segments/coordinates ordered in a consistent clockwise direction.
The default coordinate ordering is anticlockwise. (See Description Section for details of IPOLYGON treatment of nested polygons).
/OPTIONS=IDENT_TEXT:'text-string'
/OPTIONS=IDENT_TEXT:"Polygon " (default)
- specifies how the internally generated identifiers are to be constructed from an internally generated serial number. By default the identifier will be a string of the form 'Polygon xx' where xx represents the serial number. The default text part of the identifier can be overridden by supplying a new text part with the /OPTIONS=IDENT_TEXT:'text-string' combination.
/OPTIONS=NONEST
/OPTIONS=NEST (default)
- indicates IPOLYGON should not determine first-order polygon nesting. Be warned that polygon areas calculated in conjunction with the /OPTIONS=NONEST qualifier will be incorrect in the case of 'doughnut' shaped polygons. In such cases the polygon area will represent that of the whole polygon, not the polygon minus the nested polygon area.
The /OPTIONS=NONEST combination is only applicable when the /ASCII or /POLYGONS qualifiers are present, that is, those output options that output polygon boundaries as a single entity.
By default IPOLYGON will determine whether polygons are nested.
/OPTIONS=UNDEFINED:DELETE
/OPTIONS=UNDEFINED:KEEP (default)
- specifies the IPOLYGON action when polygon labelling fails. There is only a need for such action if the output mechanism treats polygons in their entirety, namely the /ASCII, /PIP and /POLYGONS options. Similarly labelling can only fail if some attempt is made to label the polygons, that is either the /LRCODE or /SEED qualifier is present.
The default action is to output all polygons regardless of labelling failure. Polygons which suffered labelling failure are given the label "Undefined Polygon".
If /OPTIONS=(UNDEFINED:DELETE) is specified, any polygons which suffer labelling failure are omitted from the relevant output files.
/PIP=([FC:'integer'],
[[NO]IDENT],
[CONTAIN_IDENT_AC:'integer'],
[ITERATE:'integer'],
[[NO]LABEL],
[CONTAIN_LABEL_AC:'integer'],
[LAYER:'integer'],
[OUTPUT:'file-spec'])
/NOPIP (default)
- indicates that one point feature per polygon is to be output to an IFF file. The coordinates of the point features are calculated to lie within the polygon. If /PIP is specified without any of the keyword arguments the following defaults are assumed:
/PIP=(FC:1,
NOIDENT,
ITERATE:1,
NOLABEL,
LAYER:1)
The point-in-polygon features will be output with FC (Feature Code) 1 to layer 1. By default polygon labels and identifiers will not be copied to the output features.
/PIP=OUTPUT:'file-spec'
- specifies the IFF file that the point-in-polygon features are output to. In the absence of the /PIP=OUTPUT qualifier the output file specification is taken from that of the segment input file but with the file extension '.IFF'. This default mechanism may be overridden by use of the /PIP=OUTPUT:'file-spec' combination. Any file-spec argument given will be used as the output file specification. Any parts found to be missing from the file-spec OUTPUT will be taken from the input file-spec with a '.IFF' extension.
/PIP=LAYER:'integer'
/PIP=LAYER:1 (default)
- enables the user to specify the layer to be used for IFF point-in-polygon output. By default the point features will be placed in layer 1 and will be given a feature code of 1.
/PIP=FC:'integer'
/PIP=FC:1 (default)
- enables the user to specify the FC (Feature Code) to be used for IFF point-in-polygon output. By default the point features will be placed in layer 1 and will be given a feature code of 1.
/PIP=IDENT
/PIP=NOIDENT (default)
- indicates that the internally generated polygon identifiers are to be copied to the point-in-polygon features. The identifier is transferred as the string part of the AC type specified by the /PIP=CONTAIN_IDENT_AC:'integer' combination.
The numeric field of the AC will contain the polygon area if the /OPTIONS=AREA qualifier is present.
By default identifiers are not added to the output point-in-polygon features.
/PIP=CONTAIN_IDENT_AC:'integer'
/PIP=CONTAIN_IDENT_AC:82 (default)
- specifies which AC type is to be used to copy the polygon identifiers to the point-in-polygon features. The /PIP=CONTAIN_IDENT_AC:'integer' combination cannot be used unless the /PIP=IDENT combination is present.
By default labels are copied to point-in-polygon features using AC type 82.
/PIP=ITERATE:'integer'
/PIP=ITERATE:1 (default)
- indicates that a maximum of 'integer' iterations should be used to place the point-in-polygon. The number of iterations should be in the range 1 to 100. All values of the iterate parameter will produce points that lie in the required polygons. A higher value should produce a better positioned point, albeit at the expense of increased CPU time.
/PIP=LABEL
/PIP=NOLABEL (default)
- indicates that labels obtained from either seed points or left/right codes are to be transferred to the point-in-polygon features. The label is transferred as the string part of the AC type specified by the /PIP=CONTAIN_LABEL_AC:'integer' combination. The /PIP=LABEL combination cannot be used unless the /SEED or /LRCODE qualifiers are present.
The numeric field of the AC will contain the polygon area if the /OPTIONS=AREA qualifier is present.
Polygons for which labelling has failed will be output depending on the state of the /OPTIONS=UNDEFINED:'keyword' qualifier.
By default labels are not added to the output point-in-polygon features.
/PIP=CONTAIN_LABEL_AC:'integer'
/PIP=CONTAIN_LABEL_AC:82 (default)
- specifies which AC type is to be used to pass labels to the point-in-polygon features. The /PIP=CONTAIN_LABEL_AC:'integer' combination cannot be used unless the /PIP=LABEL combination is present.
By default labels are copied to point-in-polygon features using AC type 82.
/PME
/NOPME (default)
- enables the PME performance monitor. The /PME qualifier is reserved for Laser-Scan use. PME is a code optimisation tool and should be invoked by LSL software personnel only.
/POLYGONS=([FC:'integer'],
[[NO]IDENT],
[IDENT_AC:'integer'],
[[NO]LABEL],
[LABEL_AC:'integer'],
[LAYER:'integer'],
[OUTPUT:'file-spec'])
/NOPOLYGONS (default)
- indicates that closed polygon boundaries are to be output to an IFF file as single features. If /POLYGONS is specified without any of the keyword arguments the following defaults are assumed:
/POLYGONS=(FC:1,
NOIDENT,
NOLABEL,
LAYER:1)
The closed polygon boundary features will be output with FC (Feature Code) 1 to layer 1. By default polygon labels and identifiers will not be copied to the output features. Whether polygon boundaries include first-order nesting is governed by the /OPTIONS=[NO]NEST qualifier. The polygon boundaries will be ordered clockwise or anticlockwise depending on the /OPTIONS=[ANTI]CLOCKWISE qualifier.
If the /OPTIONS=NONEST qualifier is not present then IPOLYGON will determine first-order nesting. First level nested polygons will be included in the closed polygon feature with an invisible (pen-up) move between the enclosing polygon and the nested polygon coordinates. This facilitates area shading using standard Laser-Scan plotting software.
/POLYGONS=OUTPUT:'file-spec'
- specifies the IFF file that the polygon boundary features are output to. In the absence of the /POLYGONS=OUTPUT qualifier the output file specification is taken from that of the segment input file but with the file extension '.IFF'. This default mechanism may be overriden by use of the /POLYGONS=OUTPUT:'file-spec' combination. Any file-spec argument given will be used as the output file specification. Any parts found to be missing from the file-spec OUTPUT will be taken from the input file-spec with a '.IFF' extension.
/POLYGONS=FC:'integer'
/POLYGONS=FC:1 (default)
- enables the user to specify the FC (Feature Code) to be used for IFF closed polygon feature output. By default the closed polygons will be placed in layer 1 and will be given a feature code of 1.
/POLYGONS=LAYER:'integer'
/POLYGONS=LAYER:1 (default)
- enables the user to specify the layer to be used for IFF closed polygon feature output. By default the closed polygons will be placed in layer 1 and will be given a feature code of 1.
/POLYGONS=IDENT
/POLYGONS=NOIDENT (default)
- indicates that the internally generated polygon identifiers are to be copied to the polygon boundary features. The identifier is transferred as the string part of the AC type specified by the /POLYGONS= IDENT_AC:'integer' combination.
The numeric field of the AC will contain the polygon area if the /OPTIONS=AREA qualifier is present.
By default identifiers are not added to the output polygon boundary features.
/POLYGONS=IDENT_AC:'integer'
/POLYGONS=IDENT_AC:82 (default)
- specifies which AC type is to be used to copy the polygon identifiers to the polygon boundary features. The /POLYGONS=IDENT_AC:'integer' combination cannot be used unless the /POLYGONS=IDENT combination is present.
By default labels are copied to polygon boundary features using AC type 82.
/POLYGONS=LABEL
/POLYGONS=NOLABEL (default)
- indicates that labels obtained from either seed points or left/right codes are to be transferred to the polygon boundary features. The label is transferred as the string part of the AC type specified by the /POLYGONS=LABEL_AC:'integer' combination. The /POLYGONS=LABEL combination cannot be used unless the /SEED or /LRCODE qualifiers are present.
If the /SEED qualifier is present then any AC (Ancillary Code) entries within the seed point feature will be copied to the closed polygon feature provided it is not to be used by IPOLYGON. This provides the user with flexible multiple attribute coding for the closed polygon. Each AC contains a numeric code field and up to 255 characters of text.
The numeric field of the AC will contain the polygon area if the /OPTIONS=AREA qualifier is present.
Polygons for which labelling has failed will be output depending on the state of the /OPTIONS=UNDEFINED:'keyword' qualifier.
By default labels are not added to the output polygon boundary features.
/POLYGONS=LABEL_AC:'integer'
/POLYGONS=LABEL_AC:82 (default)
- specifies which AC type is to be used to pass labels to the polygon boundary features. The /POLYGONS=LABEL_AC:'integer' combination cannot be used unless the /POLYGONS=LABEL combination is present.
By default labels are copied to polygon boundary features using AC type 82.
/PRINTER
/NOPRINTER (default)
- queues the IPOLYGON text output for printing on SYS$PRINT: under the name given by the /LIST qualifier. If you specify /PRINTER without the /LIST qualifier, the output is directed to a file named SYS$DISK:[]IPOLYGON.LIS which is queued automatically for printing and, after printing, deleted.
/PROPAGATE=([FULL],
[PARTIAL],
[[NO]CONCATENATE],
[LEFT_AC:'integer'],
[RIGHT_AC:'integer'],
[COVERAGE_FILE:'file-spec'])
/NOPROPAGATE (default)
- indicates that labelling information held in the specified ACs is to be extended after polygon formation. If some but not all of the component features of a resultant polygon P have a consistent interior identifier according to the left/right coding of a particular coverage, then this coding will be applied to all component features of the polygon. Furthermore, if full propagation is specified then this coding will be extended to any adjacent polygon separated from polygon P by a feature having no initial left or right coding with respect to the coverage in question.
/PROPAGATE=FULL
/PROPAGATE=PARTIAL (default)
- determines the extent of attribute code extension, as described above.
/PROPAGATE=CONCATENATE
/PROPAGATE=NOCONCATENATE (default)
- requires output features to contain a single attribute code, containing concatenated output texts. The AC type will be as specified for the first coverage. If this qualifier is negated or absent, each output feature will receive one attribute code from each input coverage.
/PROPAGATE=LEFT_AC:'integer'
/PROPAGATE=RIGHT_AC:'integer'
- specifies the AC types to be used in defining a coverage, in the case where a single coverage is to be propagated and no prefix is to be employed in its definition.
/PROPAGATE=COVERAGE_FILE:'file-spec'
- nominates a file defining the coverages involved in the propagation operation. A record in this file contains:
The effect of the input text prefixes is to allow a single AC pair to be used to describe different coverages, using the initial part of the text field as a modifier of the value. The input prefix is substituted by the corresponding output prefix in ACs of output segments, polygons and seed points. The AC types for output must be present, even if they will not be used, when using a coverage file: for propagation of a single coverage using /PROPAGATE=LEFT_AC and /PROPAGATE=RIGHT_AC, the AC types for created objects are governed by the appropriate qualifier on the output options, and the same defaults apply.
Comment lines, beginning _!, may appear in the coverage file. The only restrictions are that the coverage numbers must begin at 1, and remain unchanged or increase by one at each record. An example of the file layout is:
!Cover left right input output output codes !number code code prefix prefix left right contain polygon seed 1 4 5 "DISTRICT:" "" 4 5 12 82 82 1 4 5 "PARISH:" "" 4 5 12 82 82 2 1001 1002 "" "" 1001 1002 12 82 82
/SEED=([AC:'integer',
[FC:'integer'[,...]],
[FILE:'file-spec'],
[LAYER:'integer'[,...]],
[PAIR:'file-spec'],
[SURROUND:'text-string'],
[USE:'keyword'])
/NOSEED (default)
- indicates that labelling information is to be extracted from seed points. The various options allow the user to specify where the seed points are to be read from, how they are to be identified and how a label can be obtained from them.
/SEED cannot be used with the /LRCODE qualifier.
/SEED=AC:'integer'
/SEED=AC:82 (default)
- specifies which AC (Ancillary Code) the text is to be taken from for labelling if the /SEED=USE:AC combination has been used.
By default seed points are expected to have an type 82 AC entry when the /SEED=USE:AC combination is used.
/SEED=FC:'integer'[,...]
/SEED=FC:1 (default)
- specifies the FC (Feature Code) of the polygon seed points. The seed points may either be in the junction structured input IFF file or in a separate file specified using the /SEED=FILE qualifier. All features in the input file (or in the file specified with /SEED=FILE) which have the specified FC are considered to be seed points. The maximum number of feature codes which may be specified is 32. The feature codes must lie in the range 0 to 32767. All features which lie within IFF layer 0 will be ignored.
By default seed points are expected to have a feature code of 1.
/SEED=FILE:'file-spec'
- specifies a separate IFF file containing the polygon seed point features. Any parts of the file specification which are not supplied will be taken from the default specification LSL$IF:IFF.IFF;0.
It is most important that the /SEED=FILE:'file-spec' argument is omitted if the seed points are included within the junction structured segments file. IPOLYGON checks that any /SEED=FILE:'file-spec' argument does not clash with the input segment file specification.
All features in the seed file will be treated as seed points, and must accord with the rules for seed points, unless the seed point features are differentiated from other data in the file with /SEED=FC and/or /SEED=LAYER keyword arguments. The rules for IFF polygon seed point features are listed in the Description Section below. All features which lie within IFF layer 0 will be ignored.
If either the /SEED=LAYER or /SEED=FC combinations are present then seed points (whether they come from the input segment or a separate seed point file) are identified as those features that either belong to one of the specified layers or have one of the specified FCs (Feature Codes). It should be noted that these tests are complementary - that is a feature need only pass one of the tests to qualify as a seed point.
The default behaviour in the absence of both the /SEED=LAYER and /SEED=FC combinations depends on whether there is a separate seed point file or not. If there is a separate seed point file then all features within it are taken to be seed points. If there is not a separate seed point file then only features with FC 1 are deemed to be seed points.
/SEED:LAYER='integer'[,...]
- specifies the layers containing the polygon seed points. The seed points may either be in the junction structured input IFF file or in a separate file specified using the /SEED=FILE qualifier keyword. All features in the input file (or in the file specified with /SEED=FILE) which lie within the specified layer are considered to be seed points. The maximum number of layer numbers which may be specified is 32. The layer numbers must lie in the range 1 to 32767. All features which lie within IFF layer 0 will be ignored.
By default no layers are assigned for seed points.
/SEED=PAIR:'file-spec'
- specifies a FC (Feature Code) pair file which contains one or more FC pairs. Any parts of the file specification which are not supplied will be taken from the default specification LSL$IF:IFF.FCP;0.
The contents of the FC pair file is used to dynamically select the FC of the output polygon boundaries. The FC of the polygon boundary is determined from the FC of the corresponding polygon seed point. If seed point FC can be found in the first column of the FC pair file then the polygon boundary will have the FC given in the second column. If the seed point FC cannot be found, or no seed point has been assigned, then the FC specified by the /SEED=FC:'integer' combination will be used instead. It should be noted that this latter case always applies to the bounding polygon.
The FC pair file is an ASCII file containing pairs of FCs - one pair per line. Comment lines may be included in the file providing they begin with a '!'. The FC pairs must be ordered so that the seed point FCs (first column) are arranged in ascending order. Seed point FCs must be unique.
The /SEED=PAIR option can only be used when the /POLYGONS qualifier is present.
/SEED=SURROUND:'text-string'
/SEED=SURROUND:"Surrounding void" (default)
- specifies the label to be assigned to the bounding polygon. By default IPOLYGON uses the label "Surrounding void". The text-string may have a maximum length of 255 characters.
/SEED=USE:AC
/SEED=USE:FSN
/SEED=USE:TEXT (default)
- specifies how a text field is to be extracted from the seed point to provide the polygon label.
The default behaviour is specified by the /SEED=USE:TEXT combination. Seed points are expected to be an IFF text feature and hence to contain a TX (TeXt entry). The contents of this TX entry are used as the label for the polygon which encloses the seed point.
The /SEED=USE:AC combination indicates that the label is to be taken from the string part of an AC (Ancillary Code) entry on the seed point feature. The relevant AC type can be specified using the /SEED=AC:'integer' qualifier.
When the /SEED=USE:FSN combination is used the seed points are expected to be unorientated point symbol features. The FSN (Feature Serial Number) of the seed point will be used as the label of the polygon which encloses the seed point.
If the /SEED=USE:TEXT combination is superceded then the presence of TX entries will be issue a warning.
/SEGMENTS=([CONTAIN_IDENT_AC:'integer'],
[CONTAIN_LABEL_AC:'integer'],
[[NO]IDENT],
[[NO]JUNCTIONS],
[[NO]LABEL],
[LEFT_IDENT_AC:'integer'],
[LEFT_LABEL_AC:'integer'],
[OUTPUT:'file-spec'],
[RIGHT_IDENT_AC:'integer'],
[RIGHT_LABEL_AC:'integer'],
[SELECT_FC:'range;range;...'])
/[NO]SEGMENTS (default)
- indicates that coded segments are to be output to an IFF file. If /SEGMENTS is specified without any of the keyword arguments the following defaults are assumed:
/SEGMENTS=(NOIDENT,
NOJUNCTIONS,
NOLABEL)
Segments will be output to an IFF file without polygon labels and identifiers. The output of segments that are connected to one-arm junctions is governed by the state of the /ONEARM qualifier.
/SEGMENTS=OUTPUT:'file-spec'
- specifies the IFF file that the coded segments are output to. In the absence of the /SEGMENTS=OUTPUT qualifier the output file specification is taken from that of the segment input file but with the addition of the appropriate file extension. If /SEGMENTS=JUNCTIONS is specified, the extension used is '.IFJ'. If /SEGMENTS=NOJUNCTIONS is specified, or /SEGMENTS=JUNCTIONS is absent from the command line, the extension '.IFF' is used. This default mechanism may be overriden by use of the /SEGMENTS=OUTPUT:'file-spec' combination. Any file-spec argument given will be used as the output file specification. Any parts found to be missing from the file-spec will be taken from the default file-spec as described above.
/SEGMENTS=JUNCTIONS
/SEGMENTS=NOJUNCTIONS (default)
- provides IFF junction structured output of the left/right coded segments. Unless required at a later processing stage within a production flowline, it is recommended that the output file junction structure option is not selected as the resulting processing slows IPOLYGON output.
By default IPOLYGON does not create junction structure.
/SEGMENTS=IDENT
/SEGMENTS=NOIDENT (default)
- indicates that the internally generated polygon identifiers are to be used to left/right code the output segments. The identifier is transferred as the string part of the relevant AC types.
By default identifiers are not used to code the output segments.
/SEGMENTS=CONTAIN_IDENT_AC:'integer'
/SEGMENTS=LEFT_IDENT_AC:'integer'
/SEGMENTS=RIGHT_IDENT_AC:'integer'
- allows the user to specify which AC (Ancillary Code) types are to be used to code segments. The segments are coded by supplying the relevant internally generated polygon identifier as the string part of the AC. The /SEGMENTS=<...>_IDENT_AC:'integer' qualifier cannot be used unless the /SEGMENTS=IDENT qualifier is present.
By default the AC types used to output coded segments are:
/SEGMENTS=CONTAIN_IDENT_AC:12
/SEGMENTS=LEFT_IDENT_AC:4
/SEGMENTS=RIGHT_IDENT_AC:5
/SEGMENTS=LABEL
/SEGMENTS=NOLABEL (default)
- indicates that labels obtained either from seed points or left/right codes are to be used to left/right code the output segments. The label is transferred as the string part of the relevant AC types. The /SEGMENTS=LABEL combination cannot be used unless the /SEED or /LRCODE qualifiers are present.
By default identifiers are not used to code the output segments.
/SEGMENTS=CONTAIN_LABEL_AC:'integer'
/SEGMENTS=LEFT_LABEL_AC:'integer'
/SEGMENTS=RIGHT_LABEL_AC:'integer'
- allows the user to specify which AC (Ancillary Code) types are to be used to code segments. The segments are coded by supplying the relevant polygon label as the string part of the AC. The /SEGMENTS=<...>_LABEL_AC:'integer' qualifier cannot be used unless the /SEGMENTS=LABEL qualifier is present.
If labelling has failed for a polygon then the polygon label "Undefined Polygon" is used.
By default the AC types used to output coded segments are:
/SEGMENTS=CONTAIN_LABEL_AC:12
/SEGMENTS=LEFT_LABEL_AC:4
/SEGMENTS=RIGHT_LABEL_AC:5
/SEGMENTS=SELECT_FC:'range'
- allows the user to restrict the output IFF file to contain only features with feature codes in one of the nominated ranges.
----------------------------------------------------------------------
INPUT Segment File Left Code 4 Right Code 5 INPUT Seed Point Label extracted from AC 82 (/SEED=USE:AC only) OUTPUT Polygon Boundary and Point-in-Polygon Files IFF feature FC 1 IFF feature layer 1 Polygon Label AC 82 Polygon Identifier AC 82 OUTPUT Coded Segment File Left Label AC 4 Right Label AC 5 Contain Label AC 12 Left Identifier AC 4 Right Identifier AC 5 Contain Identifier AC 12
NOTE: AC type 82 has a real numeric field. This can be used to record the polygon area.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
IPOLYGON is the Laser-Scan automatic *IFF POLYGON creation and labelling utility. It is the primary IFF polygon creation utility and forms the basis of the Laser-Scan POLYGON Package.
IPOLYGON is designed to be run in batch mode and all options may be specified on the command line. No user interaction is required during processing.
This section deals with definition of polygons by their boundaries. It introduces a number of concepts used in the rest of this document and should be read by all users. The choice of defining a polygon by its boundary has relevance for all output options. However this section will illustrate the various options available with examples from the /POLYGONS output option. This option outputs polygon boundaries as IFF features.
For the purposes of discussion the segments in Fig. 1 (a_&b) are used. The segment structure represents a stylised contour and drainage system. This dataset incorporates most of the elements likely to arise in polygon formation. For example there are nested polygons, some of which are connected to other polygons by a single segment. There is also a piece of linework that sits isolated in the middle of a polygon. It should be noted that this linework plays no part in defining areas.
There are many different requirements on polygon boundaries. Different aspects of polygon boundary formation are critical to different tasks. For this reason IPOLYGON offers a very flexible degree of control over polygon boundary formation through the use of three qualifiers:
Figure 1a - Polygon Test Figure
Figure 1b - Segment Directions and Numbering
The /ONEARM=[DELETE],[USE] qualifier indicates which segments can be used to form a polygon boundary. For example the user may specify whether isolated linework in the middle of a polygon, that does not itself bound an area, should be included in the polygon boundary. The /ONEARM=CONTAIN combination is a variant on the /ONEARM=DELETE combination and is explained in the section on the /SEGMENTS output option.
The /OPTIONS=[NO]NEST qualifier allows the user to specify whether first-order nesting should be taken into account when defining a polygon boundary. Nested polygons are a problem faced by all polygon construction software. It should be noted that internally IPOLYGON analyses the geometry to any required depth of nesting for the purposes of correct seed point assignment. However it produces boundaries which reflect only first order nesting or none at all.
The /OPTIONS=[ANTI]CLOCKWISE qualifier allows the user to specify in what sense the points in the polygon boundary should be ordered.
Together these three qualifiers allow the user to specify that polygon boundary formation should follow one of eight different sets of criteria. The /OPTIONS=[ANTI]CLOCKWISE combination plays no part in determining the linework involved in forming a boundary, merely its ordering. Thus, without loss of generality, the following discussion assumes that the /OPTIONS=ANTICLOCKWISE combination is present. This detail is only relevant to Fig. 2 (a_&b) and Fig. 3 (a_&b) where arrows indicate the direction of boundary formation.
Thus the discussion concentrates on the four remaining combinations obtained by use of the /OPTIONS=[NO]NEST and /ONEARM=[DELETE],[USE] combinations.
The first phase of polygon formation is the extraction of 'loops'. Any segment has two directions - the direction it was digitised in and the reverse. Specifying a segment and a direction specifies a unique directed edge. A loop is a list of directed segments such that when they are traversed the path ends where it starts and does not cross itself. Thus a segment that closed on itself could form two loops - one clockwise and one anticlockwise.
If the /ONEARM=DELETE qualifier is present then a segment cannot occur more than once in a loop. Fig 2a shows the set of anticlockwise loops that can be generated from Fig 1 under such a restriction. Fig 2b shows the corresponding set of clockwise loops. When Figs 2a and 2b are combined, all segments that form part of a boundary between two different polygons occur in exactly two loops - once in each direction. Those segments that do not form the boundary between two different polygons do not occur in either loop.
Figure 2a - Anticlockwise loops with /ONEARM=DELETE
Figure 2b - Clockwise loops with /ONEARM=DELETE
If the /ONEARM=USE qualifier is present then a segment can occur more than once in a loop. Figs 3a and 3b give the anticlockwise and clockwise loops derived from Fig 1 assuming the presence of the /ONEARM=USE qualifier. Note that this time all segments are used exactly twice (once in each direction). However in some cases both directions of a segment may belong to the same loop.
Fig 3b contains a clockwise loop in which each segment occurs twice. This is the loop around the isolated piece of linework. Unlike all the other loops in both Fig 3a and 3b, this loop has zero area. Such a loop is referred to as a 'tree'.
Figure 3a - Anticlockwise loops with /ONEARM=USE
Figure 3b - Clockwise loops with /ONEARM=USE
The /OPTIONS=[NO]NEST qualifier indicates whether output of polygon boundaries should take into account first-order nesting. It should be noted that clockwise and anticlockwise loops never intersect one another. Thus there is a unique ordering of these loops based on their nesting. This forms the basis of the nesting of polygons. Each clockwise loop is wholly contained within one or more anticlockwise loops. However those selected anticlockwise loops do not intersect among themselves. Thus there is a smallest anticlockwise loop that wholly contains any clockwise loop. This allows one to define parent-child relations between an anticlockwise loop and zero or more clockwise loops.
If the /OPTIONS=NEST qualifier is present then polygon boundaries reflect this nesting of loops. The fact that the nesting is only first-order indicates that any particular boundary may only bridge one generation. Each boundary is formed by taking an anticlockwise loop and logically connecting it to those clockwise loops nested within it.
If the /OPTIONS=NONEST qualifier is not present then the relations between clockwise and anticlockwise loops are ignored altogether. In particular the clockwise loops are lost, this means that linework belonging to trees will always be missing.
The arrows in Figs 5 and 7 denote the logical connections between anticlockwise and clockwise loops.
There is always one clockwise loop that does not lie within an anticlockwise loop. This represents the bounding polygon. Thus the bounding polygon boundary will only be present if the /OPTIONS=NEST qualifier is present (albeit by default). This is shown in Figs 5 and 7 by the loop pointed to by the lowermost arrow.
The /ONEARM=DELETE/OPTIONS=NEST combination (the default option, see Fig. 5) generates polygon boundaries suitable for area-fill. Using the /ONEARM=USE/OPTIONS=NEST combination (see Fig. 7) means that all segments are included in the output polygon boundaries. Although area-filling of these boundaries gives the expected results, the boundaries are unnecessarily complex if this is to be their sole use.
The /ONEARM=DELETE/OPTIONS=NONEST combination (see Fig. 4) provides a set of boundaries whose linework is sufficient to completely bound all polygon areas. However it should be noted that some elements occur twice while others occur only once. The /ONEARM=USE/OPTIONS=NONEST (see Fig. 6) combination selects out a subset of the total linework. It is difficult to provide a convincing example in which such an combination would be used.
Figure 4 - Polygon boundaries with /ONEARM=DELETE/OPTIONS=NONEST
Figure 5 - Polygon boundaries with /ONEARM=DELETE/OPTIONS=NEST
Figure 6 - Polygon boundaries with /ONEARM=USE/OPTIONS=NONEST
Figure 7 - Polygon boundaries with /ONEARM=USE/OPTIONS=NEST
IPOLYGON will only work reliably if it is able to trace consistently around the outer edge of the polygon area supplied in the input segments IFF file. This outer edge is referred to as the bounding polygon. The bounding polygon may represent a rectangle in a classic sheet edge situation or it may be defined by an irregular polygon, (an island for example).
IPOLYGON treats the bounding polygon is a special way. Using the terminology of the section on "IPOLYGON treatment of Polygons": the boundary of the bounding polygon is represented by a single loop. This loop can be recognised since there is no larger loop in which it is nested.
It is essential that IPOLYGON is given only one bounding polygon to deal with inside a single input segments IFF file. That is IPOLYGON only permits one loop which is not nested within another loop. IPOLYGON will not work properly, for example, if given the coastline of mainland Britain and the Isle of Wight in the same file.
This is clearly an important restriction. If several islands are to be processed at once, then a new bounding polygon should be generated so as to include all the input segments. If the range of the input segments is known then a rectangle can be simply generated that includes them all. It is advisable to provide a margin around the input data, otherwise the linework in the bounding polygon may corrupt the original linework during the creation of junction structure.
It should be noted that this is a significant change in operation from the last version of IPOLYGON.
If deriving polygon labels from seed points, the bounding polygon should never be given a seed point. The /SEED=SURROUND='text-string' qualifier should be used to define the label to be used for the bounding polygon. By default the bounding polygon will be given the label "Surrounding void".
IPOLYGON uses the concept of Labels and Identifiers. These are text-strings of up to 255 characters that can be used to reference the polygons that are formed using IPOLYGON.
A label is a user-defined text-string that is allowed to vary from polygon to polygon. These labels are inferred to belong to a particular polygon by one of two mechanisms. Either the label is initially held in a seed point feature whose location within a particular polygon is used, or the input segments have already been coded with left/right labels. Clearly labelling can fail for a number of reasons, for example insufficient or badly placed seed points or inconsistent left/right coding of input segments. Labels need not be unique. However if the /SEGMENTS=LABEL option is used then warnings will be issued if a segment has the same left and right label.
In contrast identifiers are internally generated text-strings that are guaranteed to be unique. The ability to generate identifiers is purely contingent on the ability to form the polygons themselves. Identifiers have the format of a piece of user-supplied text followed by a number. The numbers are internally generated and guaranteed to be unique, although not necessarily consecutive. The text part of the identifier is controlled by the /OPTIONS=IDENT_TEXT:'text-string' combination. By default the text part is "Polygon ".
It should be noted that polygon formation itself is a purely geometric operation and is not concerned with labels or identifiers. Thus the failure to obtain a full set of labels for the polygons does not prevent the operation of IPOLYGON.
Labels and identifiers can be output to IFF files as the string field of specified AC entries. The output of labels and identifiers are independent and each mechanism has its own set of default AC types, although these can be overridden by the user.
If a user only wants to output geometry, for example create a set of polygon boundaries, then both label and identifier output can be switched off. The output of labels and identifiers can be individually switched for each of the various output options - be it polygon boundary, polygon segments or points-in-polygons. The graphic content of the output segments or polygon boundaries will, however, be complete and the output data may be used for check plotting purposes. The geometric completeness of the output data may then be checked without having incurred the overhead of point in polygon tests used to allocate seed points, or disk file access time to read left/right AC text from the input segments.
Polygon labels are text-strings of up to 255 characters. These are obtained from one of three sources:
If the /SEED qualifier is present, polygon seed points are used to define the label for each polygon. The following rules must be observed when creating and manipulating IFF features which are to be used as polygon seed points within the Laser-Scan POLYGONS package:
Seed points may be included in the input segment file or be supplied using a separate seed point file. This latter case is indicated by use of the /SEED=FILE qualifier. The user must supply sufficient information to make the identification of seed points possible. In addition to the ability to specify a separate seed point file the user can specify a number of layers and/or FCs (Feature Codes) by use of the /SEED=LAYER and /SEED=FC qualifiers.
If either the /SEED=LAYER or /SEED=FC qualifiers are present then seed points (whether they come from the input segment or a separate seed point file) are identified as those features that either belong to one of the specified layers or have one of the specified FCs (Feature Codes). It should be noted that these tests are complementary - that is a feature need only pass one of the tests to qualify as a seed point.
The default behaviour in the absence of both the /SEED=LAYER and /SEED=FC qualifiers depends on whether there is a separate seed point file or not. If there is a separate seed point file then all features within it are taken to be seed points. If there is not a separate seed point file then only features with FC one are deemed to be seed points.
IPOLYGON provides three mechanisms by which a label can be derived from the relevant seed point:
Composite text in text features is not supported. Only a single TX (TeXt) entry will be read from the seed point feature. Composite texts can be used to define paragraphs of text as a single graphic feature. They are, however, only only available as a licensed option within a subset of the Laser-Scan LAMPS (Laser-Scan Automated Map Production System) system.
A seed point may contain any number of AC (Ancillary Code) entries. However these will only be used if /POLYGONS or /SEED=USE:AC is present.
Since no seed point is provided to label the bounding polygon a default label of "Surrounding void" is used. The user can override this choice by use of the /SEED=SURROUND:'text-string' combination. If the /SEED=USE:FSN qualifier is present then the bounding polygon has the label '65535', independent of the presence of the /SEED=SURROUND qualifier.
Depending on the mechanism to be used to extract labels from seed point data, the seed points must satisfy certain conditions.
Seed points may have multiple AC entries. If the /POLYGONS qualifier is present then the AC entries from the relevant seed point will be copied across to closed polygon boundary features if the /SEED=USE:AC or /SEED=USE:TEXT options are selected.
If the /LRCODE qualifier is present then labels are extracted from the text field of the left and right AC codes on the input segments. By default the left code has AC type 4, and the right code has AC type 5. These default values can be overridden by the use of the /LRCODE=LEFT_AC:'integer' and /LRCODE=RIGHT_AC:'integer' qualifiers. In the event of an input segment having multiple left and right AC entries, IPOLYGON will use only the first AC found. All subsequent left and right ACs within that feature will be ignored. The label obtained from the AC text field in the first segment is then checked for consistency against those labels obtained from other segments in the polygon boundary.
Inconsistent labelling will result in warnings, and new entries in the LITES2 guidance file if it is being used. Failure to obtain consistent labelling will not result in IPOLYGON aborting, merely the use of the label "Undefined Polygon" in place of the desired label.
The following rules for left/right coding must be obeyed for successful IPOLYGON processing:
Before describing the labelling operation involving propagation, it is helpful to define the concept of a coverage. This term will be used to mean, simply, a division of the area of interest by linear features into non-overlapping polygons. Labelling by seed points and left/right codes deal with a single coverage of the area contained within the bounding polygon, together, in some cases, with a set of features each contained in one polygon of the coverage.
A coverage is defined by a pair of ACs - a left/right pair as above - and, optionally, a set of text prefixes. A left coded segment in the coverage is then a segment in the input file having an AC whose type matches the left type and whose text string begins with one of the specified prefixes; a right coded segment is defined similarly. If text prefixes are not being used, the left and right AC types may be specified with a qualifier, and default to 4 and 5 respectively. Otherwise, and where multiple coverages are being used, a file is read to determine the AC type pairs and associated text prefixes.
It often happens that two or more coverages of a given area are defined, and that there is a need to analyse them together. This involves forming the common area (intersection) of each pair of polygons, one from each coverage, and associating each such resultant polygon with its 'parent' polygons. This operation is referred to as polygon overlay.
Given a file containing two or more independent coverages, a geometric merging and splitting can be performed using the STRUCTURE package. The resulting file consists of segments each of which belongs to (at least) one coverage. The overlay operation is reduced to the identification of each segment in terms of the input coverages: this may be achieved by propagating each coverage in turn.
A prerequisite for labelling by left/right coding is that all input segments should possess both a left and a right AC. It is clear that this condition can be relaxed to allow some segments to exist without one or both of these ACs, without causing the intended labelling of any polygon to be ambiguous; if just one segment of a polygon P described in an anticlockwise sense has a left AC, then that AC implicitly applies to all the segments making up the polygon (as a left or right AC, depending on the segment direction). Suppose, further, that the polygon P is divided into two polygons, P1 and P2, by a feature which is not part of the coverage under consideration (for example, a woodland polygon split by a river), and the coded segment lies entirely in one of the resultant polygons, say P1. Then the coding of this segment applies to all segments of P1, including the dividing feature, and because this feature is not part of the coverage then it also applies to all segments of P2. Thus the coding may be extended across any linear feature which is not part of the coverage.
The propagation of ACs is simply the process of explicitly adding ACs to uncoded segments of a coverage in this manner. Two types of propagation are distinguished, according to the way in which segments initially having neither left nor right codes are handled. The default operation, partial propagation, treats such segments as if they were part of the coverage, and does not extend coding across them. The alternative operation, full propagation, assumes that such segments are not part of the coverage and propagates across them. It is not normally appropriate to apply partial propagation to multiple coverages.
If the /PROPAGATE qualifier is present then labels are extracted from the text field of the left and right AC codes on the input segments. If a single coverage is being processed, and text prefixes are not to be used then the coverage may be defined by specifying a pair of AC types. By default the left code has AC type 4, and the right code has AC type 5. These default values can be overridden by the use of the /PROPAGATE=LEFT_AC:'integer' and /PROPAGATE=RIGHT_AC:'integer' qualifiers. If more than one coverage is to be processed, or if text prefixes are to be used to specify the coverages, the definition of the coverages must be read from a file, using the /PROPAGATE=COVERAGE_FILE qualifier. The file layout is described in the qualifiers section. In the event of an input segment having multiple AC entries defining the left or right area for a single coverage, IPOLYGON will use only the first.
Inconsistent labelling will result in warnings, and new entries in the LITES2 guidance file if it is being used. Failure to obtain consistent labelling will not result in IPOLYGON aborting, merely the use of the label "Undefined Polygon" in place of the desired label.
IPOLYGON performs the following checks on the input IFF segment and (optionally) seed data:
(A) Junction structured segment data.
(B) Seed points (if /SEED is present).
IPOLYGON is designed to be used within the Laser-Scan LAMPS (Laser-Scan Automated Map Production System) environment. The user should have access to, and be familiar with the use of, the following Laser-Scan software products:
IPOLYGON can be used in a variety of scenarios: for example segments may be coded from a set of seed points or a set of seed points can be generated from coded segments.
IPOLYGON is used to generate a set of coded segments. This illustrates the most basic function of IPOLYGON. Geometry is analysed into a set of polygons. The result of this analysis is expressed as codes on the input segments.
IPOLYGON is used to generate an IFF file which contains a set of area-filled polygons. Different polygons may have the same fill-pattern. Segments that do not contribute to the polygon boundaries are ignored.
It should be noted that the /OPTIONS=NONEST should not be used because it may result in overlapping filled areas. Similarly the bounding polygon must not be area-filled since LITES and FPP ignore the sense of a boundary in determining which portions to fill. Since the FC for the boundary polygon feature cannot be derived from a seed point FC (the bounding polygon does not have a seed point), the /SEED=FC:'integer' combination can be used to give an appropriate FC.
IPOLYGON is used to automatically generate a set of seed points from an input IFF file of coded segments.
EITHER
OR
(a) since individual segments have been digitised and there is no double digitising ILINK can be used to snap line ends together and onto other line ends. ILINK/STRUCTURE can then be used to produce junction-structured output.
(b) The presence of double digitising means that the ILINK/LLJOIN and ILINK/MERGE/ACP options are required. The ACP file is required to turn left codes into right codes (and vice versa) when segments digitised in opposite directions are merged together.
Although IPOLYGON offers the user with many processing and output options the basic structure of program operation is easily defined. After user specification of the command line IPOLYGON processing may be broken down into 17 distinct stages. No user intervention is required at any stage.
The junction structured IFF input file is read in. Checks are performed on the junction structure of the input segments. If the /LRCODE qualifier is present then each segment will be checked to carry both left and right labels.
/SEED present
If labelling from seed points which have been specified to lie in a separate file, the seed point IFF input file is read in. All seed points are checked to have a single locating coordinate. They are also checked for the presence of a label.
Polygon formation is attempted. Errors due to the presence of double digitising may detected at this stage and prevent further execution. Once all polygons have been formed an attempt is made to identify the bounding polygon.
A sectored spatial index is set up for the polygon segment lists. The polygon range is used to calculate which sector (or sectors) a polygon lies within and a list of the polygons within each sector is compiled.
Internal lists of component segments for each polygon are constructed and the coordinate range of each polygon determined.
/SEED present
This step is only performed if labelling from seed points. Using the IFF input file range, a sectored spatial index is set up within memory to speed the seed point selection process.
Isolated polygons are those loops that will form the inner boundaries of 'doughnut' type polygons. These are identified according to the sense of the loop. The bounding polygon is a special case that is ignored by this procedure.
More than one isolated polygon found.
Since loops do not intersect it is possible to determine the nesting of two loops by performing a point-in-polygon test on a point from one loop with respect to the other. A loop may be contained by more than one other loop. 1st order nesting relates a loop to those loops that only it contains. The parent loop is then removed from consideration and the operation repeated. By performing multiple passes it is possible to deal with any level of nesting.
The use of sectored spatial indexes allows one to quickly determine which loops might (possibly) be nested within another. Explicit calculation need only be performed on this restricted subset of loops.
/ONEARM=USE present and more than one tree found.
Linework that does not form part of a boundary between two different polygons and is not connected to any boundary are termed trees. It is necessary to identify which polygon each tree lies in. Since internally a tree is represented as a degenerate (zero-area) polygon, this process is very similar to that of determining the nesting of isolated polygons. There is no need for multiple passes since trees are unable to contain other polygons.
/SEED present
This step is only performed if labelling from seed points. Using the spatial indexes for both the polygons and seed points, seed points are assigned to polygons. Warnings will which polygons do not have exactly one seed point. Labelling will have failed for such polygons and the label "Undefined Polygon" will be substituted.
/LRCODE present
A check is performed on the consistency of the left/right labelling of all the polygons that have been formed. This involves tracing along all the edges that form the polygon boundary and checking the relevant left (or right) labels for each edge. If any edge does not have the same label as the first edge then the labelling is declared inconsistent and the label 'Undefined Polygon' is used.
/PROPAGATE present
This step is only performed if partial or full AC propagation is to be performed. Indexes are set up to allow efficient association between segments and polygons.
/PROPAGATE present
For each coverage, each initially coded segment is associated with the uncoded segments in the polygon of which it forms a part. Where an uncoded segment is associated with more than one initially coded segment, a check is made that the segment label for that coverage is consistently defined.
/POLYGONS present
The polygon boundary IFF file is reopened, a set of polygon boundary features written to it, and the file is closed.
/SEGMENTS present
The coded segments IFF file is reopened, a set of coded segment features written to it (with or without junction structure), and the file is closed.
/PIP present
The point-in-polygon IFF file is reopened, a set of symbol features written to it, and the file is closed.
/ASCII present
Lists of directed segments are output to the output ASCII file.
If /OPTIONS=NEST is specified (default) the polygon boundary listings will include any first order nested polygons.
In the event of polygon labelling failure, the retention or omission of the polygon from the output file is determined by the /OPTIONS=UNDEFINED keyword argument.
If /OPTIONS=NEST is specified (default) the closed polygon features will include any first order nested loops.
In the event of polygon labelling failure, the retention or omission of the polygon from the output file is determined by the /OPTIONS=UNDEFINED keyword argument.
In addition the /ONEARM=CONTAIN option can be used to code segments that do not form part of a polygon boundary, with a 'contain' AC code.
If /SEGMENTS=NOJUNCTIONS is specified (default) then the output file will not contain junctions. Segments that are excluded via the /ONEARM qualifier will not be output. If /SEGMENTS=JUNCTIONS is specified then the output file will have the same junction structure as the input segment file. Those segments that would otherwise have been excluded will have a label/identifier of "Ignored Segment".
The /ASCII option provides a list of polygon boundaries expressed as lists of directed segments. A directed segment is described by specifying a segment and its 'direction' (frequently denoted 'positive' or 'negative'). The direction indicates in which order the segment should be traversed - either in the same direction as it was digitised (positive) or in the reverse direction (negative). The segments are specified by the segment FSN (Feature Serial Number).
The characteristics of this file are best indicated by the following examples:
$IPOLYGON/ASCII=IDENT/ONEARM=DELETE 'testfile'
where the testfile is that shown in Fig 1b. Note that not all segments are output and that the polygon identifiers (although unique) are not consecutive.
BOUNDING POLYGON IDENT: "Polygon 1" SEGMENTS: 1 2 POLYGON IDENT: "Polygon 2" SEGMENTS: -1 3 ( -10 ) ( -8 ) POLYGON IDENT: "Polygon 3" SEGMENTS: -2 -3 POLYGON IDENT: "Polygon 4" SEGMENTS: 8 ( -9 ) POLYGON IDENT: "Polygon 7" SEGMENTS: 9 POLYGON IDENT: "Polygon 10" SEGMENTS: 10 ( -11 ) POLYGON IDENT: "Polygon 11" SEGMENTS: 11
$IPOLYGON/ASCII=IDENT/ONEARM=USE 'testfile'
where the testfile is again that shown in Fig 1b.
BOUNDING POLYGON IDENT: "Polygon 1" SEGMENTS: 1 2 POLYGON IDENT: "Polygon 2" SEGMENTS: -1 3 ( 7 16 -8 -16 -15 -10 15 -7 ) ( 4 -5 5 6 -6 -4 ) POLYGON IDENT: "Polygon 3" SEGMENTS: -2 -3 POLYGON IDENT: "Polygon 5" SEGMENTS: 8 17 -17 ( -9 ) POLYGON IDENT: "Polygon 6" SEGMENTS: 9 POLYGON IDENT: "Polygon 8" SEGMENTS: 10 -14 18 -18 -13 -11 13 14 POLYGON IDENT: "Polygon 9" SEGMENTS: 11 -12 12
BOUNDING POLYGON: "Surrounding void"
SEGMENTS: 409 450 451 452 453 454 455 457 458 459 460 461 462 463 464 -465
466 449 448 447 445 446 -444 442 443 441 440 439 437 -438 436 434
AREA: 2003.8
POLYGON LABEL: "Haliomione portulacoides"
SEGMENTS: 1 -415 13 3 -411
SEED POINT FSN: 558
SEED POINT POSITION: 11599.976 11014.499
AREA: 78.9
POLYGON LABEL: "Puccinellia maritima"
SEGMENTS: -1 -410
SEED POINT FSN: 557
SEED POINT POSITION: 10739.551 10261.782
AREA: 1276.6
POLYGON LABEL: "Suaeda maritime"
SEGMENTS: 234 -10 -4 -17 -418 -16 20 74 -77 -76 -231 236 -75 -91 -409
416 ( 413 -414 ) ( 415 ) ( 410 -411 412 )
SEED POINT FSN: 511
SEED POINT POSITION: 15875.437 12733.957
AREA: 23.1
POLYGON LABEL: "Aster tripolium"
SEGMENTS: -2 -412 -3 -8 -6 -11
SEED POINT FSN: 556
SEED POINT POSITION: 11977.042 11659.745
AREA: 786.3
Records relating to the bounding polygon are always located at the start of the file and the first of these is flagged by the identifier "BOUNDING POLYGON:"
The FSNs of segments which form nested polygons are enclosed in round brackets. The brackets are opened before the first segment of the nested polygon and closed after the last.
By default IPOLYGON always calculates and output 1st order nested polygons. This may suppressed with the /OPTIONS=NONEST qualifier. If the /OPTIONS=AREA combination is present while 1st order nesting is suppressed then the area values for 'doughnut' type areas will be incorrect.
An IFF file of symbol features is generated. Each symbol feature is placed to lie within precisely one polygon. The output file is determined by the the /PIP=OUTPUT:'file-spec' combination. The layer and FC of the symbol features are determined by the /PIP=(FC:'integer',LAYER:'integer') combinations. The use of labels and identifiers is controlled with the /PIP=(IDENT,LABEL) combination. The numeric field of the output label and/or identifier ACs will carry the polygon area if the /OPTIONS=AREA combination is present.
The /PIP=ITERATE:'integer' combination allows the user to indicate that more than one iteration can be used in placing the point-in-polygon. All values of the iterate parameter produce points that lie inside the specified polygon. The polygon definition includes inner boundaries owing to first order nesting and, if the /ONEARM=USE combination is present, any linework within the polygon. Increasing the number of iterations attempts to place the point feature so that it is equally spaced between the polygon boundaries directly to its left and right, and also directly above and below it. This method is not guaranteed to produce perfect results even after a large number of iterations and should be used with care.
An IFF file of polygon boundary features is generated. The output file is determined by the the /POLYGONS=OUTPUT:'file-spec' combination. The layer and FC of the boundary features are determined by the /POLYGONS=(FC:'integer',LAYER:'integer') combinations. If the /SEED=PAIR qualifier is present then the FCs of the boundary features can be derived from the FCs of the relevant seed points. The use of labels and identifiers is controlled with the /POLYGONS=(IDENT,LABEL) combination. The numeric field of the output label and/or identifier ACs will carry the polygon area if the /OPTIONS=AREA combination is present.
Nested polygons are a problem faced by all polygon construction software. IPOLYGON internally can deal with n'th order polygon nesting for the purposes of correct seed point assignment, but it produces output files which reflect only first order nesting.
IPOLYGON outputs first order nested polygons to either the /POLYGONS IFF file option or to the /ASCII output file. The coordinates of nested polygons are always ordered in the opposite direction to that of the enclosing polygon. Thus if the user specified that polygons are to be formed in a clockwise direction (/OPTIONS=CLOCKWISE) then any 1st order nested polygons will have coordinates ordered in an anticlockwise direction.
If the /POLYGONS IFF output option is chosen, nested polygons are joined to their enclosing polygon using invisible (pen-up) steps. Consider a forest containing a glade: then the IFF feature representing the forest boundary traces round part of the outside of the forest then an invisible (pen-up) step is provided between the outer boundary and a point on the glade boundary. The feature then traces around the glade boundary (in the opposite sense) until the point where the invisible step is reached. An invisible step is then made back along the original invisible step and tracing of the forest outer boundary is continued.
Because the two invisible steps exactly overlay each other, the accuracy of polygon area calculations is maintained. There is no limit to the number of glades which can be incorporated into the forest boundary feature. The glades are joined together by a sequence of invisible steps, each one beginning where the previous one finishes.
By default IPOLYGON always calculates and output 1st order nested polygons. This may suppressed with the /OPTIONS=NONEST qualifier. If the /OPTIONS=AREA combination is present while 1st order nesting is suppressed then the area values for 'doughnut' type areas will be incorrect.
An IFF file of coded segments is generated. The selection of the output file is controlled by the /SEGMENTS=OUTPUT:'file-spec' combination. The use of labels and identifiers is controlled with the /SEGMENTS=(IDENT,LABEL) combination.
This section assumes a knowledge of the /ONEARM=[DELETE],[USE] combinations as described in the section on "IPOLYGON treatment of Polygons". In particular the user should be clear as to which segments are implicated (or not) by the various /ONEARM options.
The presence of the /SEGMENTS qualifier automatically precludes the use of the /OPTIONS=NONEST combination. However a new option is introduced, namely the /ONEARM=CONTAIN combination. This is shown to be a simple variant on the /ONEARM=DELETE combination.
With the /ONEARM=[USE],[DELETE] options the segments that are output are given a pair of left/right codes. If the /ONEARM=CONTAIN combination is present an output segment will have either a pair of left/right codes or a contain code.
If the /ONEARM=DELETE combination is present only a subset of the input segments are output. These are those segments that form part of a boundary between two different polygons. This means that the left and right identifiers (if selected) are necessarily different. If labels are output then there is no restriction that they need be different, but warnings are issued if they are not.
If the /ONEARM=USE combination is present then all segments are output with a pair of left/right codes. However a segment may have the same polygon on each side, for example a spur of linework that enters a polygon. Thus left and right identifiers are not guaranteed to be different.
The /ONEARM=CONTAIN combination is a variant on the /ONEARM=USE combination. Those segments that have the same polygon on both side have a contain code rather than a duplicate left/right pair.
If the /ONEARM=DELETE combination is present the output of those segments that do not form part of polygon boundaries is determined by the /SEGMENTS=[NO]JUNCTIONS combination. If junction structure output is required then it is always of the same structure as the input segment file. Thus the segments cannot be omitted. However if labels or identifiers are being output then they will have the text "Ignored Segment".
If the /LITES2 qualifier is specified IPOLYGON creates a LITES2 command file which can be used to direct the user to the position of the suspected error within the Laser-Scan LITES2 graphical editor. The positions supplied in the LITES2 command file locate the suspected error.
Not all errors detected by IPOLYGON are output to LITES2 command file as a LITES2 command requires a coordinate position. Clearly errors related to the failure to read an IFF ST (STring) entry cannot result in the output of a LITES2 command. The LITES2 command file should therefore be used in conjunction with IPOLYGON terminal output, (which may optionally be directed to listing file using the /LIST qualifier).
If the user selects the /SEED=FILE=file-spec option and takes seed points from a separate IFF file to that read for segment data it is important that the user is aware that the LITES2 command file reflects errors which occur in both files. To aid identification of the type of data which is at fault each error message sent to the LITES2 command file is made up of two parts - the type of error and an error message relating to the particular fault at hand.
All errors are recorded in the LITES2 command file in essentially the same format:
! Tell the user what is wrong %MESSAGE type of error: %MESSAGE particular error message ! Locate cursor %POSITION 'x coord' 'y coord' ! Is the point within the visible window? %TEST $CURSINWIN ! If not, centre the window about the point and redraw the window %ELSE %ZOOM 1 ! Ring bell %PING ! Pass control to the user for corrective action %RESPOND ! Pass control back to the command file %ABANDON %ABANDON
There are several types of error that can be written to the LITES2 command file, these are dealt with briefly in the following sections.
These errors occur while the input segment file is being read and its junction structure is being analysed.
A zero or one-arm junction has been detected. The latter will be reported if the /ONEARM=WARM combination is present.
The specified segment feature has one (or both) junctions missing.
The specified segment feature is invalid in some way - for example the ST entry is missing.
There is more than one segment feature with the same FSN
These errors occur while the seed points are being read in prior to polygon formation.
Seed point with more than one ST entry
More than one seed point with the same FSN
Seed point with more than one coordinate
Seed point with unexpected TS entry (For an explanation of text components see the "IFF User Guide", in particular the section on "Feature level entries").
The /SEED=USE:TEXT option is being used but the seed point has no TeXt entry.
The /SEED=USE:AC option is being used but the seed point has no AC entry of the correct AC type.
Warning - the /SEED=USE:FSN option is being used but TeXt or AC entries (which might have been expected to supply the label) are also present.
This error occurs when the input segment file is read in and the /LRCODE qualifier is present. Input segments must have both left and right labels.
These errors locate areas of suspected double digitising. This constitutes an invalid junction structure for IPOLYGON. These errors must be removed before IPOLYGON can form polygons.
These errors occur during polygon formation. If the error cannot be traced to bad junction-structure then an SPR should be submitted.
These errors occur once polygon formation has been completed and an attempt is being made to label the polygons from the seed points.
No seed points were assigned to a polygon. Output of the polygon will be determined by the /OPTIONS=UNDEFINED option. Labelling of the polygon will result in the "Undefined Polygon" label.
An attempt has been made to assign more than seed point to a polygon. Only the first seed point will be considered for labelling purposes.
Warning - the left and right labels for this segment are the same.
These errors occur once polygon formation has been completed and an attempt is being made to label the polygons from the left/right codes of the input segments.
Although all segments were checked for the presence of left and right codes at input, the required left/right code can no longer be found.
A polygon boundary that includes the specified segment does not have consistent labelling as derived from the segment left/right codes.
This error occurs during the output of coded segments.
The inability to find a consistent choice of identifiers may reflect a corrupt junction structure. If the problem cannot be resolved then an SPR should be submitted.
--------------------------------------------------------------------------------
This example shows IPOLYGON being run on the dataset shown in Fig 1. The /ONEARM=USE combination indicates that all segments are to be used. The /OPTIONS=NEST is present by default. There is no labelling mechanism specified. Two IFF output options have been selected; polygon boundary output and coded segment output. The output segments are coded with the relevant polygon identifiers. The output IFF file specifications have been derived from the input IFF segment file together with user supplied extensions.
All 18 of the input segments are output to the coded segments file. These formed 7 polygons for which polygon boundary features were constructed.
The /LOG qualifier is present and results in the output of run time statistics to SYS$OUTPUT.
$STATUS is set to SS$_NORMAL - normal successful completion.
$ $IPOLYGON/ONEARM=USE/POLYGONS=OUTPUT:.POL -_$ /SEGMENTS=(IDENT,OUTPUT:.SEG)/LOG TEST1 %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[POLYGONS.ACCEPT]TEST1.IFJ;1 opened for read %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[POLYGONS.ACCEPT]TEST1.POL;1 opened for write %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[POLYGONS.ACCEPT]TEST1.SEG;1 opened for write %POLY-I-POLVAL, Maximum number of polygons set to a default of 10000 %POLY-I-DEFSID, Average number of sides per polygons set to a default of 5 +----------------------------------------------------------------+ | | | Building IFF Address Tables | | | +----------------------------------------------------------------+ Number of IFF segment feature addresses tabulated ... 18 Segment coordinate range is: X-min ............................................... 0.000 X-max ............................................... 170.000 Y-min ............................................... 0.000 Y-max ............................................... 120.000 +----------------------------------------------------------------+ | | | Forming Polygons | | | +----------------------------------------------------------------+ Number of polygons formed (including isolations) ... 9 Number of trees formed ............................. 1 Number of segments used to form polygons ........... 18 Minimum number of segments used to form a polygon .. 1 Maximum number of segments used to form a polygon .. 8 Direction of polygon formation ..................... ANTICLOCKWISE +----------------------------------------------------------------+ | | | Setting up Spatial Index for Polygons | | | +----------------------------------------------------------------+ Number of boxes in X direction....................... 3 Number of boxes in Y direction....................... 3 Mean number of boxes per polygon .................... 1.000 Mean number of polygons per box ..................... 1.000 +----------------------------------------------------------------+ | | | Identifying Isolated Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 9 Number of isolated polygons ......................... 2 +----------------------------------------------------------------+ | | | Identifying Nested Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 9 Number of polygons containing nested polygons ....... 3 Number of polygons nested inside others ............. 11 +----------------------------------------------------------------+ | | | Identifying Nested Linework | | | +----------------------------------------------------------------+ Number of trees located inside polygons ............. 1 +----------------------------------------------------------------+ | | | Writing Coded Segments File | | | +----------------------------------------------------------------+ Number of segments output to /SEGMENTS file ........ 18 +----------------------------------------------------------------+ | | | Writing Polygon Boundary File | | | +----------------------------------------------------------------+ Number of features output to /POLYGONS file ........ 7 ELAPSED: 0 00:00:25.95 CPU: 0:00:03.00 BUFIO: 19 DIRIO: 225 FAULTS: 873
In this example a separate seed point file is supplied. All the features in this file are treated as seed points. The output polygon boundaries are labelled with a label derived from the seed point FSNs.
The input IFF segment file contains 89 segments which define 35 polygons. The 34 seed points are assigned to these in 3 passes. This indicates there is up to 2nd order nesting of polygons. NOTE that one of the polygons (the bounding polygon) does not have a seed point.
The /LOG qualifier is present and results in the output of run time statistics to SYS$OUTPUT.
$STATUS is set to SS$_NORMAL - normal successful completion.
$ $IPOLYGON/SEED=(USE:FSN,FILE:TEST2.SEED) -_$ /POLYGONS=(LABEL,OUTPUT:.POL)/LOG TEST2 %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[POLYGONS.ACCEPT]TEST2.IFJ;1 opened for read %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[POLYGONS.ACCEPT]TEST2.SEED;1 opened for read %LSLLIB-I-IFFOPENED, LSL$DATA_ROOT:[POLYGONS.ACCEPT]TEST2.POL;1 opened for write %POLY-I-POLVAL, Maximum number of polygons set to 10000 %POLY-I-DEFSID, Average number of sides per polygons set to a default of 5 +----------------------------------------------------------------+ | | | Building IFF Address Tables | | | +----------------------------------------------------------------+ Number of IFF segment feature addresses tabulated ... 89 Segment coordinate range is: X-min ............................................... 0.000 X-max ............................................... 1000.000 Y-min ............................................... 0.000 Y-max ............................................... 1000.000 +----------------------------------------------------------------+ | | | Checking Seed Points | | | +----------------------------------------------------------------+ Number of seed point feature addresses tabulated ... 34 +----------------------------------------------------------------+ | | | Forming Polygons | | | +----------------------------------------------------------------+ Number of polygons formed (including isolations) ... 40 Number of segments used to form polygons ........... 89 Minimum number of segments used to form a polygon .. 1 Maximum number of segments used to form a polygon .. 24 Direction of polygon formation ..................... ANTICLOCKWISE +----------------------------------------------------------------+ | | | Setting up Spatial Index for Polygons | | | +----------------------------------------------------------------+ Number of boxes in X direction....................... 3 Number of boxes in Y direction....................... 3 Mean number of boxes per polygon .................... 0.225 Mean number of polygons per box ..................... 4.444 +----------------------------------------------------------------+ | | | Setting up Spatial Index for Seed Points | | | +----------------------------------------------------------------+ Number of boxes in X direction....................... 3 Number of boxes in Y direction....................... 3 Mean number of seed points per box .................. 3.778 +----------------------------------------------------------------+ | | | Identifying Isolated Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 40 Number of isolated polygons ......................... 5 +----------------------------------------------------------------+ | | | Identifying Nested Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 40 Number of polygons containing nested polygons ....... 3 Number of polygons nested inside others ............. 15 +----------------------------------------------------------------+ | | | Assigning Seed Points | | | +----------------------------------------------------------------+ Number of seed points assigned ...................... 34 Number of passes required to resolve nesting ........ 3 +----------------------------------------------------------------+ | | | Writing Polygon Boundary File | | | +----------------------------------------------------------------+ Number of features output to /POLYGONS file ........ 35 ELAPSED: 0 00:00:19.75 CPU: 0:00:04.00 BUFIO: 22 DIRIO: 187 FAULTS: 763
The next example uses the dataset shown in Fig 1. The /LIST qualifier is used to direct the runtime output to the file SYS$DISK:[]IPOLYGON.LIS;0. An IFF file LSL$IF:TEST1.PIP;0 is created and symbol features (with FC 24) are written into layer 2.
$ IPOLYGON/LIST/PIP=(FC:24,LAYER:2)/ONEARM=WARN TEST1
The presence of the /ONEARM=WARN combination means that the one-armed junctions have generated warnings. The contents of the /LIST file are given below:
============================== I P O L Y G O N ================================= IPOLYGON invoked by BUREAU using terminal LTA314: at 08-SEP-1988 15:58:30.99 Command line: $ IPOLYGON/LIST/ONEARM=WARN/PIP=(FC:24,LAYER:2) TEST1 ================================================================================ %POLY-I-POLVAL, Maximum number of polygons set to a default of 40000 %POLY-I-DEFSID, Average number of sides per polygons set to a default of 5 +----------------------------------------------------------------+ | | | Building IFF Address Tables | | | +----------------------------------------------------------------+ 1 arm junction detected at ( 15.000, 45.000) 1 arm junction detected at ( 50.000, 55.000) 1 arm junction detected at ( 60.000, 30.000) 1 arm junction detected at ( 80.000, 10.000) 1 arm junction detected at ( 135.000, 50.000) 1 arm junction detected at ( 65.000, 85.000) 1 arm junction detected at ( 110.000, 90.000) Number of IFF segment feature addresses tabulated ... 18 Segment coordinate range is: X-min ............................................... 0.000 X-max ............................................... 170.000 Y-min ............................................... 0.000 Y-max ............................................... 120.000 +----------------------------------------------------------------+ | | | Forming Polygons | | | +----------------------------------------------------------------+ Number of polygons formed (including isolations) ... 11 Number of segments used to form polygons ........... 18 Minimum number of segments used to form a polygon .. 1 Maximum number of segments used to form a polygon .. 2 Direction of polygon formation ..................... ANTICLOCKWISE +----------------------------------------------------------------+ | | | Setting up Spatial Index for Polygons | | | +----------------------------------------------------------------+ Number of boxes in X direction....................... 3 Number of boxes in Y direction....................... 3 Mean number of boxes per polygon .................... 0.818 Mean number of polygons per box ..................... 1.222 +----------------------------------------------------------------+ | | | Identifying Isolated Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 11 Number of isolated polygons ......................... 4 +----------------------------------------------------------------+ | | | Identifying Nested Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 11 Number of polygons containing nested polygons ....... 5 Number of polygons nested inside others ............. 16 +----------------------------------------------------------------+ | | | Writing Point-in-Polygon File | | | +----------------------------------------------------------------+ Number of points output to /PIP file ............... 6
The last example uses the dataset shown in Fig. 8(a to d) to illustrate the application of AC propagation to a simple polygon overlay operation. Figures 8a and 8b show two divisions of the same area, into areas of differing soil type and vegetation type. The soil types (A, B and C) are shown in Fig. 8a, and the vegetation types (P, Q and R) in Fig. 8b.
A merged file is created (Fig. 8c) containing the soil area boundaries, the vegetation area boundaries, and a bounding rectangle. The soil and vegetation type information is held in left-right AC types 4 and 5, the string components of these ACs having the form "SOIL: A" or "VEGETATION: P". The contents of the ACs are indicated in Fig. 8c; note that The bounding rectangle has been assigned ACs to indicate that the external area has unknown soil and vegetation types.
This merged file is processed using the ILINK module of the STRUCTURE package, first to break all features at intersection points, and secondly to set up a junction structure. The result of this operation is shown in Fig. 8d, where each feature is labelled with its FSN. Each new feature inherits the left-right codes of its parent feature.
The division of the area into soil polygons and vegetation polygons constitutes two coverages, and the text prefix mechanism is used to describe these in a coverage file, as follows:
! Cover left right in-prefix out-prefix left right contain polygon seed ! no AC AC AC AC AC AC AC 1 4 5 "SOIL:" "SOIL:" 4 5 12 82 82 2 4 5 "VEGETATION:" "VEGETATION:" 4 5 12 82 82
Figure 8a - Soil areas Figure 8b - Vegetation areas
Figure 8c - Merged file with ACs Figure 8d - FSNs after structuring
The two left-right codings may be propagated using full propagation, as each boundary in each coverage is coded on at least one side. To create the intersection polygons and attach appropriate ACs, the /POLYGONS=LABEL qualifier would be used. The following command file would perform the initial structuring and run IPOLYGON to create labelled intersection polygons:
$ILINK/BREAK/BPF=10 Z.IFF Z.BRE $! $ILINK/STRUCTURE Z.BRE Z.IFJ $! $IPOLYGON/LOG/PROPAGATE=(FULL,COVERAGE_FILE:OVERLAY_TEST)- /POLYGONS=(OUTPUT:Z.POL,LABEL) Z.IFJ
The output below is created using the /ASCII=LABEL qualifier, and describes each polygon as a sequence of signed FSNs. Each polygon is assigned two ACs of type 82, one containing soil type and the other containing vegetation type.
=============================== I P O L Y G O N ================================ IPOLYGON invoked by SIMON using terminal LTA5: at 23-MAR-1990 14:10:55.45 Command line: $ IPOLYGON/LOG/PROPAGATE=(FULL,COVERAGE_FILE:OVERLAY_TEST)/ASCII=LABEL Z.IFJ ================================================================================ %POLY-I-POLVAL, Maximum number of polygons set to a default of 40000 %POLY-I-DEFSID, Average number of sides per polygons set to a default of 5 +----------------------------------------------------------------+ | | | Building IFF Address Tables | | | +----------------------------------------------------------------+ Number of IFF segment feature addresses tabulated ... 22 Segment coordinate range is: X-min ............................................... 1500.000 X-max ............................................... 3000.000 Y-min ............................................... 2000.000 Y-max ............................................... 3500.000 +----------------------------------------------------------------+ | | | Forming Polygons | | | +----------------------------------------------------------------+ Number of polygons formed (including isolations) ... 12 Number of segments used to form polygons ........... 22 Minimum number of segments used to form a polygon .. 1 Maximum number of segments used to form a polygon .. 9 Direction of polygon formation ..................... ANTICLOCKWISE +----------------------------------------------------------------+ | | | Setting up Spatial Index for Polygons | | | +----------------------------------------------------------------+ Number of boxes in X direction....................... 3 Number of boxes in Y direction....................... 3 Mean number of boxes per polygon .................... 0.750 Mean number of polygons per box ..................... 1.333 +----------------------------------------------------------------+ | | | Identifying Isolated Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 12 Number of isolated polygons ......................... 1 +----------------------------------------------------------------+ | | | Identifying Nested Polygons | | | +----------------------------------------------------------------+ Number of polygons examined ......................... 12 Number of polygons containing nested polygons ....... 1 Number of polygons nested inside others ............. 2 +----------------------------------------------------------------+ | | | Creating Polygon Component Arrays | | | +----------------------------------------------------------------+ +----------------------------------------------------------------+ | | | Associating segments for each | | | +----------------------------------------------------------------+ +----------------------------------------------------------------+ | | | Assigning Propagated Codes | | | +----------------------------------------------------------------+ Number of polygons with consistent labelling ........ 11 +----------------------------------------------------------------+ | | | Summary Listing of Polygon Components | | | +----------------------------------------------------------------+ BOUNDING POLYGON LABEL: "SOIL: UNKNOWN" "VEGETATION: UNKNOWN" SEGMENTS: -14 -22 -21 -20 -19 -18 -17 -16 -15 POLYGON LABEL: "SOIL: A" "VEGETATION: P" SEGMENTS: 1 -8 21 POLYGON LABEL: "SOIL: B" "VEGETATION: P" SEGMENTS: -1 22 14 4 -9 POLYGON LABEL: "SOIL: A" "VEGETATION: Q" SEGMENTS: 2 -11 20 8 POLYGON LABEL: "SOIL: B" "VEGETATION: Q" SEGMENTS: -2 9 5 -12 POLYGON LABEL: "SOIL: A" "VEGETATION: R" SEGMENTS: 3 19 11 POLYGON LABEL: "SOIL: B" "VEGETATION: R" SEGMENTS: -3 12 6 18 POLYGON LABEL: "SOIL: C" "VEGETATION: P" SEGMENTS: -4 15 -10 POLYGON LABEL: "SOIL: C" "VEGETATION: Q" SEGMENTS: -5 10 16 -13 ( 7 ) POLYGON LABEL: "SOIL: C" "VEGETATION: R" SEGMENTS: -6 13 17 POLYGON LABEL: "SOIL: B" "VEGETATION: Q" SEGMENTS: -7 --------------------------------------------------------------------------- No. of POLYGONS output to /OPTIONS=LIST file ....... 11
See ipolygonmsg.html generated from IPOLYGONMSG.RNO.