[GRASS-user] ps.map: One Script Works, One Doesn't

   This has been wasting my time this morning and I'd sure like to learn why.

   I have two ps.map input scripts called 'flowlinedensity.psmap' and
'slopes.psmap'. They both compile, but when I view the latter I get a
ghostscript error box, no colortable, and no points legend in the v.legend
area.

   Running diff on the two scripts shows only this:

1c1
< raster aber10m.flowdensityAvg
---

raster aber10m.slope

48c48
< text 78% 28% Flow Line\n Densities
---

text 77% 30% Slope (Degrees)

58c58
< range 0 100
---

  range 0 25

   Since the only differences are the base raster map, text position and
content, and colortable range I fail to see why the latter throws a gv
error.

   If I remove the vlegend clause it displays.

Any ideas?

Rich

On Tue, 9 Mar 2010, Rich Shepard wrote:

I have two ps.map input scripts called 'flowlinedensity.psmap' and
'slopes.psmap'. They both compile, but when I view the latter I get a
ghostscript error box, no colortable, and no points legend in the v.legend
area.

   I should mention that of the 5 maps in the report, the slopes map is the
only one that balks at displaying properly. The only differences are the
base raster and the text contents.

Rich

On Tue, 9 Mar 2010, Rich Shepard wrote:

I should mention that of the 5 maps in the report, the slopes map is the
only one that balks at displaying properly.

   More testing reveals the problem is with the slope raster map. What in
that particular map might cause an issue with vlegend?

Rich

On Tue, 9 Mar 2010, Rich Shepard wrote:

This has been wasting my time this morning and I'd sure like to learn why.

   Fixed it. I re-created the slopes map (r.slope.aspect) and that did the
trick. No idea what was wrong with the original, but something definitely
was.

Rich

Rich wrote:

I have two ps.map input scripts called
'flowlinedensity.psmap' and
'slopes.psmap'. They both compile, but when I view the
latter I get a
ghostscript error box, no colortable, and no points legend
in the v.legend
area.

Running diff on the two scripts shows only this:

1c1
< raster aber10m.flowdensityAvg
---
> raster aber10m.slope
48c48
< text 78% 28% Flow Line\n Densities
---
> text 77% 30% Slope (Degrees)

...

Since the only differences are the base raster map,
text position and content, and colortable range I fail
to see why the latter throws a gv error.

If I remove the vlegend clause it displays.

Any ideas?

text 77% 30% Slope (Degrees)

( and ) need to be quoted like \( and \).

see the documentation for the "comments" instruction, I guess it
applies to "text" as well.

PostScript uses () as the beginning/end delimiter for text
strings.

Hamish

On Tue, 9 Mar 2010, Hamish wrote:

text 77% 30% Slope (Degrees)
( and ) need to be quoted like \( and \).

Hamish,

   Actually, they don't. Originally I had the string in quotes and those
printed, too. The above prints quite well.

   As I wrote to the list, I isolated the problem to the base raster map.
Regenerating that fixed the problem.

Thanks,

Rich

I am having a similar, perhaps related problem.

I have a raster image overlain by a series of vectors.

ps.map fails erratically.

If I remove the raster, it works.

If I remove v.legend, it works. (legend only for vector features)

If I make one specific item in the legend as -- lpos 0 -- it works.

When all are present in the script, it fails.

When I try to make a pdf with Distiller, the "offending error" is a long numeric string approximately 100 digits long. I opened the postscript file in a text editor and the long string seemed to be associated with the legend. After editing the string, I could open the postscript file.

In other mapsets, things work fine.

The problem appears to be associated with the legend. i have no idea why there is any link with the raster image.

Mac, Snow Leopard, Grass 6.4RC3, Mr. Kyngesburye's binaries updated today.

Dave

On 2010-03-09, at 6:19 PM, Rich Shepard wrote:

On Tue, 9 Mar 2010, Hamish wrote:

text 77% 30% Slope (Degrees)
( and ) need to be quoted like \( and \).

Hamish,

Actually, they don't. Originally I had the string in quotes and those
printed, too. The above prints quite well.

As I wrote to the list, I isolated the problem to the base raster map.
Regenerating that fixed the problem.

Thanks,

Rich
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Dave wrote:

I am having a similar, perhaps related problem.

If you can make a simplified test case (minimal location and ps.map
instruction file) available to me I can have a look. Off-list is fine.

The problem appears to be associated with the legend.
i have no idea why there is any link with the raster image.

The vector legend has about 10 years less testing than much of the
rest of the program, so if there are still-to-be-discovered bugs I
would not at all be surprised if they were there.

Hamish

Hamish wrote:

text 77% 30% Slope (Degrees)

( and ) need to be quoted like \( and \).

see the documentation for the "comments" instruction, I guess it
applies to "text" as well.

PostScript uses () as the beginning/end delimiter for text
strings.

PostScript recognises balanced parentheses within strings (making it
one of the few languages which cannot be tokenised using regular
expressions). Only unbalanced parentheses need to be escaped.

OTOH, ps.map should probably be escaping parentheses and backslashes
within string literals, rather than relying upon the user to do it.

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

Hamish:

> ( and ) need to be quoted like \( and \).
>
> see the documentation for the "comments" instruction,
> I guess it applies to "text" as well.
>
> PostScript uses () as the beginning/end delimiter for
> text strings.

Glynn:

PostScript recognises balanced parentheses within strings (making it
one of the few languages which cannot be tokenised using regular
expressions). Only unbalanced parentheses need to be escaped.

right.. I had run in to this in the past when using the comments
instruction for multi-line figure captions. (so the () got split between
lines) slowly it comes back

so it doesn't explain Rich's problem, but he already did..

OTOH, ps.map should probably be escaping parentheses and backslashes
within string literals, rather than relying upon the user to do it.

I can't find a bug report for it or any comment in the code, but ISTR
trying something like that when I ran into it the first time & added
that hint to the man page. shrug. if anyone is interested it's done with
show_text() in ps/ps.map/gprims.c.

Hamish

On Tue, 9 Mar 2010, Dave Kent wrote:

I am having a similar, perhaps related problem.

I have a raster image overlain by a series of vectors.

ps.map fails erratically.

If I remove the raster, it works.

Dave,

   Try re-creating the raster map. That fixed the problem for me.

Rich