[GRASS-dev] [GRASS GIS] #355: ps.map generates invalid postscript when vlegend item does not appear on map

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
------------------------+---------------------------------------------------
Reporter: scottygamm | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: minor | Milestone: 6.3.1
Component: default | Version: 6.3.0
Keywords: | Platform: MSWindows CygWin
      Cpu: x86-32 |
------------------------+---------------------------------------------------
I have a map control file that generates several (21) vareas with pattern
fill and defines label and lpos entries for the legend. As it happens,
one of those vareas does not appear on the map area. As a result, the
postscript output omits the dictionary entry for that pattern. When
vlegend generates the legend output, it attempts to reference the missing
pattern definition (of the form APATTEPSnn) and applications that try to
render the postscript fail in various ways. Workaround is to omit the
vareas causing the problem. I have not included files but can provide
them if needed.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/355&gt;
GRASS GIS <http://grass.osgeo.org>

I encountered the same problem a couple of weeks ago. I was able to get
around it by adding the following to ps_vlegend.c around line 172 ...

pat_save ( PS.fp, vector.layer[i].pat, pat);

Insert this line after "sprintf ( pat, "APATTEPS%d", i);" to ensure the
pattern definition is saved.

Hope this helps.

--
Bob

On Tue, 2008-11-04 at 14:20 +0000, GRASS GIS wrote:

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
------------------------+---------------------------------------------------
Reporter: scottygamm | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: minor | Milestone: 6.3.1
Component: default | Version: 6.3.0
Keywords: | Platform: MSWindows CygWin
      Cpu: x86-32 |
------------------------+---------------------------------------------------
I have a map control file that generates several (21) vareas with pattern
fill and defines label and lpos entries for the legend. As it happens,
one of those vareas does not appear on the map area. As a result, the
postscript output omits the dictionary entry for that pattern. When
vlegend generates the legend output, it attempts to reference the missing
pattern definition (of the form APATTEPSnn) and applications that try to
render the postscript fail in various ways. Workaround is to omit the
vareas causing the problem. I have not included files but can provide
them if needed.

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

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
-------------------------------+--------------------------------------------
  Reporter: scottygamm | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: minor | Milestone: 6.3.1
Component: default | Version: 6.3.0
Resolution: | Keywords:
  Platform: MSWindows CygWin | Cpu: x86-32
-------------------------------+--------------------------------------------
Comment (by neteler):

Replying to [ticket:355 scottygamm]:
On Tue, Nov 4, 2008 at 4:16 PM, Bob Covill <bcovill tekmap ns.ca> wrote:
I encountered the same problem a couple of weeks ago. I was able to get
around it by adding the following to ps_vlegend.c around line 172 ...

{{{
   pat_save ( PS.fp, vector.layer[i].pat, pat);
}}}

Insert this line after
{{{
sprintf ( pat, "APATTEPS%d", i);
}}}
to ensure the pattern definition is saved.

Hope this helps.

Bob

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/355#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
-------------------------------+--------------------------------------------
  Reporter: scottygamm | Owner: hamish
      Type: defect | Status: assigned
  Priority: minor | Milestone: 6.3.1
Component: default | Version: 6.3.0
Resolution: | Keywords:
  Platform: MSWindows CygWin | Cpu: x86-32
-------------------------------+--------------------------------------------
Changes (by hamish):

  * status: new => assigned
  * owner: grass-dev@lists.osgeo.org => hamish
* cc: grass-dev@lists.osgeo.org (added)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/355#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
-------------------------------+--------------------------------------------
  Reporter: scottygamm | Owner: hamish
      Type: defect | Status: assigned
  Priority: minor | Milestone: 6.3.1
Component: ps.map | Version: 6.3.0
Resolution: | Keywords:
  Platform: MSWindows CygWin | Cpu: x86-32
-------------------------------+--------------------------------------------
Changes (by hamish):

  * component: default => ps.map

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/355#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
-------------------------------+--------------------------------------------
  Reporter: scottygamm | Owner: hamish
      Type: defect | Status: assigned
  Priority: minor | Milestone: 6.4.0
Component: ps.map | Version: 6.3.0
Resolution: | Keywords:
  Platform: MSWindows CygWin | Cpu: x86-32
-------------------------------+--------------------------------------------
Changes (by hamish):

  * milestone: 6.3.1 => 6.4.0

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/355#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
-------------------------------+--------------------------------------------
  Reporter: scottygamm | Owner: hamish
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.0
Component: ps.map | Version: 6.3.0
Resolution: fixed | Keywords:
  Platform: MSWindows CygWin | Cpu: x86-32
-------------------------------+--------------------------------------------
Changes (by hamish):

  * status: assigned => closed
* cc: casey.vandenberg@sjgeophysics.com, bcovill@tekmap.ns.ca (added)
  * resolution: => fixed

Comment:

patch applied in SVN, thanks!

I also fixed the vector legend bug reported by Casey Vandenberg on Nov 20
where it wouldn't let you place the vector legend to the left of the map
box. Now you can go as far as the left margin. The right side of the
legend (for multicolumn) is still rather unconstrained, I've left it as
not starting a new column past the right side of the map box, which seems
like a fair compromise. Feel free to post a patch doing that better if you
can figure out how.. I don't think it is easily possible to improve on the
current way.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/355#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#355: ps.map generates invalid postscript when vlegend item does not appear on
map
-------------------------------+--------------------------------------------
  Reporter: scottygamm | Owner: hamish
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.4.0
Component: ps.map | Version: 6.3.0
Resolution: fixed | Keywords:
  Platform: MSWindows CygWin | Cpu: x86-32
-------------------------------+--------------------------------------------
Comment (by hamish):

Replying to [comment:5 hamish]:
> I also fixed the vector legend bug reported by Casey Vandenberg on Nov
20 where it wouldn't let you place the vector legend to the left of the
map box. Now you can go as far as the left margin. The right side of the
legend (for multicolumn) is still rather unconstrained, I've left it as
not starting a new column past the right side of the map box, which seems
like a fair compromise. Feel free to post a patch doing that better if you
can figure out how.. I don't think it is easily possible to improve on the
current way.

actually it was easy. I've now added a new vlegend "span" command to let
you set the legend column spacing.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/355#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>