Next: arestore, Previous: area2, Up: Internal Routines [Contents][Index]
areaconnect(data1, data2 [, compact] [, /raw])
Determines connections between areas in data data1
and
data2
, based on spatial overlap. The data must be arrays
of type long
. Each element of data1
must contain a
number that identifies the area or class that the element is a part of,
for example determined by area
, and likewise for
data2
. A data value equal to zero is regarded as
background, and data elements with zeros in both data1
and
data2
are ignored altogether.
The data elements with any particular area number need not form a
contiguous set; a particular data element from data1
is
only compared to the corresponding data element from data2
,
and to no others. The numbers in data1
are independent of
the numbers in data2
: No special relationship is inferred
if some area in data1
has the same ID number as some area
in 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
data2
, and r(*,2)
contains the number of data
elements that have that combination of data1
and
data2
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 data1
values, and then, for entries with equal
data1
values, in ascending order of data2
values.
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 data2
values but no non-zero
data1
values are appearing. Their data2
area
numbers are returned in ascending order in $APP
.
$DISAPP
Those areas that have non-zero data1
values but no non-zero
data2
values are disappearing. Their data1
area numbers are returned in ascending order in $DISAPP
.
$SPLIT1
, $SPLIT2
, $SPLIT2_INDEX
Those data1
areas that have overlap with more than one
data2
area are splitting. Their <data1
(i.e.,
pre-split) area numbers are returned in ascending order in
$SPLIT1
. The data2
(i.e., post-split) area numbers
corresponding to pre-split data1
area number
$SPLIT1(i)
are given, in ascending order, by $SPLIT2
( $SPLIT2_INDEX(i) : $SPLIT2_INDEX(i + 1) - 1)
.
$MERGE1
, $MERGE2
, $MERGE1_INDEX
Those data2
areas that have overlap with more than one
data1
area are the product of merging. Their
data2
(i.e., post-merge) area numbers are returned in
ascending order in $MERGE2
. The data1
(i.e.,
pre-merge) area numbers corresponding to post-merge data2
area number $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 data1
area numbers
are returned in ascending order in $STAY1
, and the corresponding
data2
area numbers in $STAY2
.
At this point, the area numbers in data2
are not related to
the area numbers in data1
, so even areas that remain
topologically the same from data1
to data2
do
not have the same area number in both data sets. Such a relation can be
requested by specifying an appropriate value for compact
,
in which case the values in data2
and related global
variables are modified to best express their relation to
data1
. The numbers in data1
and related
global variables are not modified.
If compact
is unspecified, negative, or equal to 0
,
then nothing is modified. Otherwise, the data2
areas in
the class of stayers receive the corresponding number from
data1
(so that $STAY2
becomes equal to
$STAY1
). For splitters, the first of the data2
split products inherits the area number of the data1
source
area, so that $SPLIT2($SPLIT2_INDEX)
becomes equal to
$SPLIT1
. For mergers, the data1
area number of the
first merger component is propagated to the data2
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.
After this process (if compact
is positive), there may
still be some data2
areas that have not yet received a new
number. If compact
is equal to 1
, then those areas
receive successive numbers starting at one greater than the greatest
number in data1
. If compact
is equal to
2
, then those areas receive numbers that are as small as possible
but not yet otherwise used in data2
and not less than 2.
If compact
is greater than 2, then those areas receive
successive numbers starting at one greater than the value of
compact
or the greatest number in data1
,
whichever is greater.
See also: area, segment, Topology
Next: arestore, Previous: area2, Up: Internal Routines [Contents][Index]