[GRASS5] xdriver: Unable to get sufficient colors
Eric G. Miller
egm2 at jps.net
Wed Jun 27 21:17:04 EDT 2001
On Wed, Jun 27, 2001 at 05:34:33PM +0200, Radim Blazek wrote:
> "Eric G. Miller" wrote:
>
> > That seems to work. I didn't update CVS, 'cause the algorithm used for handling
> > polygon holes isn't quite right, and writing the code to make it right is
> > non-trivial (anybody know how to implement the Weiler-Atherton clipping
> > algorithm?). I suppose that little part of d.area could be updated, even if the
> > program doesn't quite behave correctly.
> >
> > --
> > Eric G. Miller <egm2 at jps.net>
>
> It is not problem in Xwindow, islands may be attached to area without additional
> processing. If I remember your tests (~6 monts ago), problem is in CELL, PNG driver.
> Isn't it possible to modify plot function used in this driver?. I think that it draws
> horizontal lines from left to right between boundaries. Check if this line is zero length
> before drawing should help, I think.
I had modified d.area subsequently so the "infinitely thin colinear
lines" connecting the outer polygon with the inner holes are always made
between the nearest vertices of the outer polygon and the inner hole.
Therefore, the line should always lie inside the outer polygon (not
guaranteed). For most cases this should work okay, unless a polygon has
multiple holes and the line that would be formed from the outer ring to
one of the inner rings crosses one of the other inner rings. It
probably wouldn't happen too often, but it could happen and the program
doesn't check for this possibility. When it does occur, you'll see some
pretty funky output, and maybe the program will just crash altogether.
I don't know.
Also, d.area does not properly clip to the window extents, and it
disagrees with d.vect slightly on line placement. I wish I could commit
the version I have using the "gpc library" since it fixes all of these
problems. Unfortunately, gpc has an onerous restriction against
"commercial use" or as part of a "commercial product" -- not GPL
compatible ;(. I've tried to contact the author for an exception, be he
is apparently out of the country or just not responding. So, I guess
academics are the only type that can use his code ;( What a shame.
I've slightly back-burnered the issue, since I'm a little stuck on
implementing the polygon clipping.
--
Eric G. Miller <egm2 at jps.net>
More information about the grass-dev
mailing list