[GRASS-dev] Getting a dotted line in ps.map - Style mechanism

Alessandro Frigeri alessandro.frigeri at gmail.com
Tue Aug 5 13:47:59 EDT 2008


Hi Hamish,

thanks for the hint.  Now it is more clear to me how the style
parameter works (are we sure to leave that 0 means to stroke and 1 not
to stroke the line?).

Now I will try to understand how is defined the spacing between 0s and
1s, if it is scaled to the linewidth or not;  I have not do it yet,
but looking at the code will surely help.

Then I've found a postscript operator it can be useful to obtain -real
dots- in a dotted line.  The operator is called setlinecap and it sets
the look of the ends of the lines, the argument can be:
0) butt caps
1) round caps
2) extended butt caps

So an idea can be to introduce a new parameter in the vlines section
as e.g. linecap with the three options butt round and extbutt.

Regards,

Alessandro

2008/8/5 Hamish <hamish_b at yahoo.com>:
> Alessandro Frigeri wrote:
>> I wonder how can I obtain a dotted linestyle with ps.map.
>> Using the style parameter with a 1010 value, I only get a dashed
>> line.  What controls the length of the dashes?  From the ps.map
>> man-page (6.3.0) I really did not fully understand the mechanism of
>> the 'style' parameter.
>
> sorry, the documentation did not match the code very well.
> (ie either the docs or the code is buggy, I am not really sure which)
>
> try like:
>
> # spearfish dataset
> ps.map out=test.ps << EOF
> vlines roads
>  style 011111111
>  where label ~ 'highway'
>  width 0.5
>  label Highways
>  end
> end
> EOF
>
>
> The first block is draw, the second block is don't draw. So with a single
> zero followed by lots of ones it draws a little then skips a lot making a
> dotted line.
>
>
>> Moreover, the example of the style parameter reported in the vlines
>> section of the manual with '0-9' value, rises up an error:
>>
>> ERROR: style 0-9 : illegal line style (vlines)
>
> "0-9" just means some value in the range of zero to nine. Forget about
> that, just use 0s and 1s. Any non-zero number will be treated as a one.
>
>
> I've just updated the man page in SVN to make things clearer:
>  http://trac.osgeo.org/grass/changeset/32537
>
> although I am not sure if the current way is as-intended or a bug.
> intuitively I'd guess that 0 should be don't draw and 1 should be draw,
> but alas..
>
>
> devels see also the PostScript 'setdash' command usage and new debug messages:
>  http://www.capcode.de/help/setdash
>
>
> Hamish
>
>
>
>
>
>



-- 
Alessandro Frigeri, PhD


More information about the grass-dev mailing list