[GRASS5] Q. How do you find the islands for a given area?

Eric G. Miller egm2 at jps.net
Sun Feb 25 19:16:29 EST 2001

On Sun, Feb 25, 2001 at 01:23:02PM -0800, Eric G. Miller wrote:
> On Sun, Feb 25, 2001 at 07:49:00PM +0100, Radim Blazek wrote:
> > 
> > > There's probably alot I can do to speed it up, by being more efficient
> > > about memory dupes.  The biggest killer is the search for the closest
> > > tie point between the outer polygon and it's inner islands.  I'm doing a
> > > real lame nested looping thing through two polygons to find the closest
> > > points.  Maybe you'all have a better method to identify appropriate
> > > points to tie to two polygons together at?
> >  
> > I think that for Xdriver should be used system built in X window:
> > If fill-rule is set to EvenOddRule you can simply add islands to x,y array
> > (always return to area start point after each island) and it should be
> > plotted correctly. (For EvenOddRule, a point is inside if an infinite
> > ray with the point as origin crosses the path an odd number of times.)
> Yea, I switched to just gluing together the polys at whereever, and CPU
> time dropped by 2/3.  
> > Because other drivers (cell,..) will work in different way we need new function 
> > R_polygon_with_holes_abs() which would send areas and islands separately
> > to driver. X driver would use X window internal fill system (probably
> > supported by HW) and cell driver would use your filling function
> > with closest points (cell driver may be slower).   
> Because no such thing exists in the driver interface, I'm hacking the
> module itself.  I'll need to see how the CELL driver deals with the
> hack.  I'm hoping it doesn't draw a 1pixel connecting line, but I don't
> know...

Unfortunately, the CELL driver does draw a pixel wide connecting line,
even though the two boundary lines are colinear.  So, I've hooked up
that real slow algorithm again.  Takes about 3 times longer in my simple
testing...  Note, vectors without islands shouldn't draw too much slower
than d.vect would draw them.

Eric G. Miller <egm2 at jps.net>

If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'

More information about the grass-dev mailing list