[GRASS5] Fw: d.area progress report...

Eric G. Miller egm2 at jps.net
Sat Jan 26 22:15:51 EST 2002


On Fri, 25 Jan 2002 17:38:35 -0800, "Eric G. Miller" <egm2 at jps.net> wrote:

> On Sat, 26 Jan 2002 06:41:23 +0100, Radim Blazek <radim.blazek at wo.cz> wrote:
> 
> [snip]
> > Very simply, from last point of area to first of isle and from last of isle 
> > back to last of area. But I have tested only with simple data and some
> > problems may occure later. But in that case I would prefer improvement of
> > G_plot_polygon. You can see the code in d.vect / g51. (And test in grass51)
> 
> Yea.  I think you got lucky.  Try it with non-convex polygons with little
> holes spread around in nooks and crannies.  Also, don't draw unlabeled
> areas, they'll mask the outcome.
> 
> I'm thinking G_plot_polygon, or a derivative, could be modified and either
> present a three part interface as previously described or a single function
> that can take **xs, **ys, and *n for inputs.  It would have to process the
> edges of each ring (finding the scanline intersections), before moving on
> to do the point sort and generating the fill start/stop extents.

FYI, I created a modified G_plot_polygon with arguments:
  
    double **xs, -- The x's for each polygon (xs[0], xs[1], etc...) 
    double **ys, -- The y's for each polygon (ys[0], ys[1], etc...)
    int *npnts,  -- Number of points per polygon
    int ring     -- Number of rings/polygons

On my hardcase test cover (geology of California with hundreds of
islands per area), it worked nicely.  I will be committing it soon,
after syncing CVS with head, and then will fix d.area (including
the category issue).

I think we need a discussion on how to handle vector drawing
specs.  There are several things to consider compared to
rasters.  We should consider point styles, line styles, and
area fill styles.  We may not have the infrastructure to
do all the drawing styles we'd like at present, but I'd like
to consider building an infrastructure for specify such things
as fill type: solid, pixmap, hatchured; line style: width,
dashing, color, end & join styles, complex line styles; etc...


-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list