[GRASS5] Nested vector islands, and incorrect left/right poly id's for island edges...

Eric G. Miller egm2 at jps.net
Tue Jan 22 21:15:45 EST 2002


On Wed, 23 Jan 2002 01:02:48 +0000, David D Gray <ddgray at armadce.demon.co.uk> wrote:

> Eric
> 
> I've now run your script on some files. I can't confirm that there are 
> any cases of islands being incorrectly built. they all appear as I (and 
> Radim) described earlier, ie. with no internal boundaries separating 
> different cells, of course you may have found some.

Okay.  I'll double check my code on the colinearity test.  I found some
other bugs, so maybe this was a red herring.
 
> The matter with area assignments to islands' lines is different. I 
> couldn't repeat the problem you reported, but found something else 
> equally bizarre:
>
> I tested a small map with three chinese eggs, each of two segments, and 
> the ouput is as follows: [going inwards]
> 
> Area 1 {
>    dig_att = 0
>    lines {
>      line 1, left -1, right 1
>      line 2, left -1, right 1
>    }
>    Island 2 {
>      Lines {
>        Line -3, LeftArea -2, RightArea 2
>        Line 4, LeftArea 2, RightArea -2
>      } = Area -1
>    }
> }
> Area 2 {
>    dig_att = 0
>    lines {
>      line 3, left -2, right 2
>      line -4, left 2, right -2
>    }
>    Island 3 {
>      Lines {
>        Line 5, LeftArea 3, RightArea -3
>        Line -6, LeftArea -3, RightArea 3
>      } = Area -1
>    }
> }
> Area 3 {
>    dig_att = 0
>    lines {
>      line -5, left 3, right -3
>      line 6, left -3, right 3
>    }
> }
> 
> All the lines here appear to have the same area on each side. So the 
> assignment of left/right area seems to be getting mangled. Could this be 
> giving the errors with internal boundaries, or apparent boundaries?

I will hypothesize there is a confusion about Island id's and Area id's.
On the one's where I saw problems, for Island edges, one of the adjacency
id's always matched the Island id.  Except for the last area, the id's
may be referring to different types of things (one area, one island).

I'm not real familiar with the vector library, so you might double check
that I'm not somehow abusing the Map_info structure.  I basically
hacked that little script together on what I could glean from a couple
library routines (and how they used the struct).
 
-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list