[GRASS-dev] discussion: replacing ps.map

Glynn Clements glynn at gclements.plus.com
Sat Apr 7 02:47:35 EDT 2007

S-Bören Gebbert wrote:-A

> I have patched d.vect to use R_polyline_abs. Now lines of widths greater then 1 are
> are smoothed by the PS driver.
> I have tested the code with the XDRIVER, pngdriver and psdriver. The code seems to work,
> but i needed to add some memory allocation stuff, so the memory usage is a bit higher
> and it should be a bit slower than the G_plot_line approach (with move and cont functions).
> Everyone is welcome to test it. If no problems appear, i will submit these changes to CVS.

Unfortunately, there's a bit more to it than that.

1. G_plot_line handles longitude wrap-around (try plotting something
which crosses the 180th meridian).

2. G_plot_line is using D_{move,cont}_abs(), which clip against the
frame (try using a square region, so that there are blank bands on the
left and right sides of the monitor).

I already had to deal with something similar for filled polygons; see
plot_polygon() at the top of plot1.c, and the render= option.

FWIW, I've already added a D_polyline_clip() function, which should
handle both of the above issues (although it hasn't been extensively

I would suggest adding a plot_polyline() function which uses either
the render= setting or a separate option (e.g. lrender=). That allows
people to compare the new implementation against the old one without
having to keep an old version of d.vect around.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list