[GRASS-user] Lines with anti-aliasing

Glynn Clements glynn at gclements.plus.com
Mon Jul 16 03:39:32 EDT 2007


Hamish wrote:

> > > anyone knows if is possible to have smoothed lines in maps generated
> > > from grass? I'm doing a map where bathymetry and elevation are
> > > combined with a vector layer related to political boundaries. The
> > > quality of the map is impressive, not the boundaries. They are
> > > extremely pixelated. It's a pity!
> > > 
> > > Any advices?
> 
> Glynn:
> > Generate an oversized image then rescale it with antialiasing.
> > 
> > Some suggestions for generating the original image:
> > 
> > 1. Use the PS driver
> > 2. Use ps.map
> > 3. Increase the resolution and use linewidth=
> 
> FWIW, I have noticed that the PS driver with 'd.vect width=[2+]' makes
> very pixelated lines, while d.vect for areas look very nice & smooth.

Which render= setting?

> I assume it's due to the way line width= is implemented.

Line width is implemented by calling the PostScript "setlinewidth"
operator. 

I don't know if it's relevant here, but one issue is that a sequence
of line segments drawn with move/cont operations will result in a
sequence of single-segment paths, not a "polyline".

Each segment will be capped, whereas a polyline will have joins
between the segments. This is true regardless of line width, but it
will be more noticeable with thicker lines.

This cannot be fixed without changing the R_* API, and the modules
which use it. Essentially, there needs to be a function which is
called to complete the path. Without it, the driver has to complete
the path after every segment, as it can't tell whether another segment
will follow.

R_polyline_{abs,rel} generates an actual polyline.

FWIW, the same issue applies to all of the drivers, although it's
likely to be more noticeable with the PS driver.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list