ISPRS Workshop on Service and Application of Spatial Data Infrastructure, XXXVI(4/W6), Oct. 14-16, Hangzhou, China
Figure 5. The correlation between quaternary Morton code and
row/column number
The neighbor finding of the diamond is much more easier than
that of the triangle, this is determined by the properties of the
diamond mesh. Because the triangle cell in the triangle mesh
has not uniform orientation and the adjacent neighbor of it
varies according to its location in the mesh. Neighbor finding is
different for either different orientated triangle or different
located triangle in the mesh. Diamond mesh has several
properties such as radial symmetry, translation congruence and
uniform orientation, unlike triangles, thus makes some spatial
operations such as neighbor-finding much more easily.
There are three cases in the neighbor-finding of the diamond:
the diamond located in the inside of the base diamond
(quadrant), the diamond located in the boundary of the base
diamond and the diamond located in the comer of the base
diamond.
Figure 6. Adjacent neighbors of the diamond located on the
comer of the base diamond
Algorithm for determining the edge adjacent neighbors is as
follows (the algorithm can be extended to computed the address
of the vertex adjacent neighbors as well):
EdgeDiamondAdjacent (QDcode DM, Direction Dir)
{
D<— PrefixD(DM); // extract the started digit
M<—DelePrefixD(DM); // delete the start digit
(i,j) <—F-l(M) // conversion from Morton code to
row/column numner
switch(Dir)
{
EN: // the northeast neighbor
if(i<I) i++; // located in same base diamond
else // located in different base diamond
{if(d=3) d=0; else d++
k=j;j=0;i=I-k;} break;
ES: // the southeast neighbor
f(i>0) i- -; // located in same base diamond
else // located in different base diamond
{if(d=0) d=3; else d—
k=j ;j=I;i=I-k;} break;
WN: // the northwest neighbor
if(j>o)j-; // located in same base diamond
else // located in different base diamond
(if(d=0) d=3; else d-
k=i;i=I;j=I-k;} break;
WS: // the southwest neighbor
if(j<i)j++; // located in same base diamond
else // located in different base diamond
(if(d=3) d=0; else d++
k=i;i=0;j=I-k;} break;
}
M^F(ij); // conversion from row/column number to
Morton code
DM^AppendToD(M,D); // append the quadcode of the
base diamond
Retum(DM);
}
6. NEIGHBOR FINDING OF TRIANGLE
Diamond tessellations are compatible with tessellations of
triangles in nature. The diamond can be regarded as the merging
of two triangles. These two triangles made up the diamond can
be distinguished through appending a digit 0 or 1 to the end of
code of the diamond. As showed in figure 7, the code of triangle
ended with“0” indicates that it has a south edge-adjacent
neighbor, and the code of triangle ended with “1” indicates that
it has a north edge-adjacent neighbor within the same diamond.
The suffixes of the code of triangle indicate the triangle is either
up or down triangle (figure 7). The code of triangle traces a
zigzag course through the triangles at any given level (figure 7).
Based on the algorithm of neighbor finding of the diamond, we
develop an algorithm for determining the edge adjacent
neighbors of triangle. The same strategy can be used to compute
the address of the vertex adjacent neighbors as well.
Figure 7. Labeling and indexing of two triangles made up the
diamond
Algorithm for determining the edge adjacent neighbors of
the triangles is as follows:
EdgeTriangleAdjacent (QTcode TM, Direction Dir)