Radim,
What is the cat of Map.Line[1]?
In other words, I want
to also print the line category number.
Would it be:
linecat = Map.Att[Lines->att].cat
(which I think is equvalent to
Map.Att[Map.Line[i].att].cat
John
... Code may be like this:
for (i=1; i <= Map.n_lines; i++) {
Line = &(Map.Line[i]);
if (Lines->type != AREA) continue;
lcat = rcat = 0;
if (Lines->left != 0)
lcat = Map.Att[Map.Area[Lines->left].att].cat;
if (Lines->right != 0)
rcat = Map.Att[Map.Area[Lines->right].att].cat;
fprintf (stdout, "%d %d", lcat, rcat);
}
Radim
On Friday 31 January 2003 03:44 pm, John Gillette wrote:
Radim,
What is the cat of Map.Line[1]?
In other words, I want
to also print the line category number.
Would it be:
linecat = Map.Att[Lines->att].cat
(which I think is equvalent to
Map.Att[Map.Line[i].att].cat
I'm not sure, but I believe it should be so.
I tried this. It turns out
Lines->left and Lines->right
can return negative numbers (which crashes the program).
So I test for >0 instead of !=
Is there any documentation on the vector format
(besides the programming manual and dig_structs.h)?
I assume the negative numbers are related to either
islands or direction flow.
No documentation for internals. Negative is for isle,
correct should be:
if (Lines->left != 0) {
if (Lines->left > 0) {
lcat = Map.Att[Map.Area[Lines->left].att].cat;
larea = Lines->left;
} else {
larea = abs(Lines->left);
l_isle = Map.Isle[larea].area;
lcat = Map.Att[Map.Area[l_isle].att].cat;
larea = l_isle;
}
}
(taken from src/mapdev/v.reclass/cmd/rclas_area.c)
Radim