[GRASSLIST:2952] d.area progress report...

Eric G. Miller egm2 at jps.net
Sun Jan 20 22:55:10 EST 2002

Just wanted to say, I've finally made some significant progress
implementing a area w/holes simplifier.  Unfortunately, seems
I made an unwarranted assumption about the possibility of
colinear line segments (I didn't think about the fact that
that island/holes may share edges).  So, hopefully I can
work in some code for handling colinear segments in the
next week, and then possibly get some of this code into GRASS.

Basically, I'm trying to implement an addition to the display
library which consists of the following three functions:

  D_area_begin()   -- Set up for a new area
  D_area_add_ring (struct line_pnts *) -- Add one or more boundaries.
  D_area_finish()  -- Process the rings and draw the result to the

I'm not sure how to handle the colinear segments problem.  I'm
thinking it might be better to have an interface level where the
user passes a Map_info struct, and the id for the area to draw.
I could then weed out the colinear segments by not adding any
edge that didn't have the target area on one of it's sides.
Then the interface would reduce to:

  D_area_plot (struct Map_info *, int);

Later on, I hope to implement a more generic (but more expensive)
variant to handle essentially random polys that may intersect.
I think such a routine won't be linked to the display environment,
but more of an on the fly polygon intersector.

Taking comments... ?

Eric G. Miller <egm2 at jps.net>

More information about the grass-user mailing list