Next: arestore, Previous: area2, Up: Internal Routines [Contents][Index]

`areaconnect(`

`data1`, `data2` [, `compact`] [, /raw])

Determines connections between areas in data

and
`data1`

, based on spatial overlap. The data must be arrays
of type `data2``long`

. Each element of

must contain a
number that identifies the area or class that the element is a part of,
for example determined by `data1``area`

, and likewise for

. A data value equal to zero is regarded as
background, and data elements with zeros in both `data2`

and
`data1`

are ignored altogether.
`data2`

The data elements with any particular area number need not form a
contiguous set; a particular data element from

is
only compared to the corresponding data element from `data1`

,
and to no others. The numbers in `data2`

are independent of
the numbers in `data1`

: No special relationship is inferred
if some area in `data2`

has the same ID number as some area
in `data1`

.
`data2`

The return value of this function is a two-dimensional `long`

array
with 3 elements in its second dimension. If we call that array
`r`

, then `r(*,0)`

contains area numbers from

, `data1``r(*,1)`

contains area numbers from

, and `data2``r(*,2)`

contains the number of data
elements that have that combination of

and
`data1`

numbers. Data elements that have a value of zero in
both data arrays are ignored. The results are sorted fi
st in ascending
order of `data2`

values, and then, for entries with equal
`data1`

values, in ascending order of `data1`

values.
`data2`

If `/raw`

is specified, then nothing more is done. Otherwise, the
areas are divided into topological classes and relevant information is
returned in global variables, as listed in the following table. If
there are no entries in any particular topological class, then a scalar
`-1`

is returned in the corresponding global variable.
Otherwise, a `long`

array is returned.

`$APP`

Those areas that have non-zero

values but no non-zero`data2`

values are appearing. Their`data1`

area numbers are returned in ascending order in`data2``$APP`

.`$DISAPP`

Those areas that have non-zero

values but no non-zero`data1`

values are disappearing. Their`data2`

area numbers are returned in ascending order in`data1``$DISAPP`

.`$SPLIT1`

,`$SPLIT2`

,`$SPLIT2_INDEX`

Those

areas that have overlap with more than one`data1`

area are splitting. Their`data2``<`

(i.e., pre-split) area numbers are returned in ascending order in`data1``$SPLIT1`

. The

(i.e., post-split) area numbers corresponding to pre-split`data2`

area number`data1``$SPLIT1(i)`

are given, in ascending order, by`$SPLIT2 ( $SPLIT2_INDEX(i) : $SPLIT2_INDEX(i + 1) - 1)`

.`$MERGE1`

,`$MERGE2`

,`$MERGE1_INDEX`

Those

areas that have overlap with more than one`data2`

area are the product of merging. Their`data1`

(i.e., post-merge) area numbers are returned in ascending order in`data2``$MERGE2`

. The

(i.e., pre-merge) area numbers corresponding to post-merge`data1`

area number`data2``$MERGE2(i)`

are given, in ascending order, by`$MERGE1( $MERGE1_INDEX(i) : $MERGE1_INDEX(i + 1) - 1)`

.`$STAY1`

,`$STAY2`

Those areas that neither appear, disappear, merge, nor split, are staying topologically the same. Their

area numbers are returned in ascending order in`data1``$STAY1`

, and the corresponding

area numbers in`data2``$STAY2`

.

At this point, the area numbers in

are not related to
the area numbers in `data2`

, so even areas that remain
topologically the same from `data1`

to `data1`

do
not have the same area number in both data sets. Such a relation can be
requested by specifying an appropriate value for `data2`

,
in which case the values in `compact`

and related global
variables are modified to best express their relation to
`data2`

. The numbers in `data1`

and related
global variables are not modified.
`data1`

If

is unspecified, negative, or equal to `compact``0`

,
then nothing is modified. Otherwise, the

areas in
the class of stayers receive the corresponding number from
`data2`

(so that `data1``$STAY2`

becomes equal to
`$STAY1`

). For splitters, the first of the

split products inherits the area number of the `data2`

source
area, so that `data1``$SPLIT2($SPLIT2_INDEX)`

becomes equal to
`$SPLIT1`

. For mergers, the

area number of the
first merger component is propagated to the `data1`

merger
product, unless that area number was already used earlier, in which case
the remaining merger components are inspected until an unused area
number is found or the last component was dismissed.
`data2`

After this process (if

is positive), there may
still be some `compact`

areas that have not yet received a new
number. If `data2`

is equal to `compact``1`

, then those areas
receive successive numbers starting at one greater than the greatest
number in

. If `data1`

is equal to
`compact``2`

, then those areas receive numbers that are as small as possible
but not yet otherwise used in

and not less than 2.
If `data2`

is greater than 2, then those areas receive
successive numbers starting at one greater than the value of
`compact`

or the greatest number in `compact`

,
whichever is greater.
`data1`

See also: area, segment, Topology

Next: arestore, Previous: area2, Up: Internal Routines [Contents][Index]