[GRASS-user] ps.map: rectangle over map border?

Hi list!

In ps.map,

is it (not) possible to overlay a color-filled rectangle, which exceeds the map
frame/border, and by doing so, it should be on top of the border?

Currently, no matter what I try, the map border is drawn on top of the
rectangle (within which I have placed a color table/legend).

The colortable does not feature a background option (according to the manual
-- blindly tested as well)!?

Is there a trick to overcome this problem? (--yes, I want to break the
convention of being inside the map frame)

Thanks, Nikos

On 11/03/13 12:36, Nikos Alexandris wrote:

Hi list!

In ps.map,

is it (not) possible to overlay a color-filled rectangle, which exceeds the map
frame/border, and by doing so, it should be on top of the border?

Currently, no matter what I try, the map border is drawn on top of the
rectangle (within which I have placed a color table/legend).

The colortable does not feature a background option (according to the manual
-- blindly tested as well)!?

Is there a trick to overcome this problem? (--yes, I want to break the
convention of being inside the map frame)

AFAIK, just give the rectangle map coordinates that are outside the map frame. Ex:

raster elevation@PERMANENT
rectangle 637375 211190 643918 207236
     color black
     fcolor red
     width 2.0
     end

with r.info -g elevation:

north=228500
south=215000
east=645000
west=630000

Moritz

Hi Moritz :slight_smile:

It doesn't work for me :-(.

Nikos A:

> In ps.map,

> is it (not) possible to overlay a color-filled rectangle, which exceeds
> the map frame/border, and by doing so, it should be on top of the border?

That is "my English is pretty bad :-/" because I mean(t) that the rectangle
crosses the map's border.

> Currently, no matter what I try, the map border is drawn on top of the
> rectangle (within which I have placed a color table/legend).
>
> The colortable does not feature a background option (according to the
> manual -- blindly tested as well)!?
>
> Is there a trick to overcome this problem? (--yes, I want to break the
> convention of being inside the map frame)

Moritz L:

AFAIK, just give the rectangle map coordinates that are outside the map
frame. Ex:

raster elevation@PERMANENT
rectangle 637375 211190 643918 207236

note, the manual states:
rectangle east north east north -- typo?

     color black
     fcolor red
     width 2.0
     end

with r.info -g elevation:

north=228500
south=215000
east=645000
west=630000

So, that means that it is:
rectangle west north east south?

What about the following:

did you try to place a box that is 1/3 inside the map-frame and 2/3 outside?
The map border is drawn on top of the rectangle.

The case here is that the class labels are too long to fit outside of the map-
frame. Squeezing the colortable outside will make them hard to read.
Shrinking the map-frame is not an option -- the map is anyway kind of an
overview map -- lots of details will be lost.

Best, N

Hello Nikos,
Not sure to understand your issue, so my answer might be off-target :

perhaps you can have a look at the output ps file. If it's only a matter
of display order, you can rearrange successive instructions within the
file in order to have your background laying over the border.

V.

Le lundi 11 mars 2013 à 15:18 +0200, Nikos Alexandris a écrit :

Hi Moritz :slight_smile:

It doesn't work for me :-(.

Nikos A:
> > In ps.map,

> > is it (not) possible to overlay a color-filled rectangle, which exceeds
> > the map frame/border, and by doing so, it should be on top of the border?

That is "my English is pretty bad :-/" because I mean(t) that the rectangle
crosses the map's border.

> > Currently, no matter what I try, the map border is drawn on top of the
> > rectangle (within which I have placed a color table/legend).
> >
> > The colortable does not feature a background option (according to the
> > manual -- blindly tested as well)!?
> >
> > Is there a trick to overcome this problem? (--yes, I want to break the
> > convention of being inside the map frame)

Moritz L:
> AFAIK, just give the rectangle map coordinates that are outside the map
> frame. Ex:

> raster elevation@PERMANENT
> rectangle 637375 211190 643918 207236

note, the manual states:
rectangle east north east north -- typo?

> color black
> fcolor red
> width 2.0
> end
>
> with r.info -g elevation:
>
> north=228500
> south=215000
> east=645000
> west=630000

So, that means that it is:
rectangle west north east south?

What about the following:

did you try to place a box that is 1/3 inside the map-frame and 2/3 outside?
The map border is drawn on top of the rectangle.

The case here is that the class labels are too long to fit outside of the map-
frame. Squeezing the colortable outside will make them hard to read.
Shrinking the map-frame is not an option -- the map is anyway kind of an
overview map -- lots of details will be lost.

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

Hi,

On Mon, Mar 11, 2013 at 2:18 PM, Nikos Alexandris
<nik@nikosalexandris.net> wrote:

Hi Moritz :slight_smile:

It doesn't work for me :-(.

Nikos A:

> In ps.map,

> is it (not) possible to overlay a color-filled rectangle, which exceeds
> the map frame/border, and by doing so, it should be on top of the border?

That is "my English is pretty bad :-/" because I mean(t) that the rectangle
crosses the map's border.

> Currently, no matter what I try, the map border is drawn on top of the
> rectangle (within which I have placed a color table/legend).
>
> The colortable does not feature a background option (according to the
> manual -- blindly tested as well)!?
>
> Is there a trick to overcome this problem? (--yes, I want to break the
> convention of being inside the map frame)

Moritz L:

AFAIK, just give the rectangle map coordinates that are outside the map
frame. Ex:

raster elevation@PERMANENT
rectangle 637375 211190 643918 207236

note, the manual states:
rectangle east north east north -- typo?

I think it means *EN* coordinates of two corners (probably north west,
south east)

     color black
     fcolor red
     width 2.0
     end

with r.info -g elevation:

north=228500
south=215000
east=645000
west=630000

So, that means that it is:
rectangle west north east south?

What about the following:

did you try to place a box that is 1/3 inside the map-frame and 2/3 outside?
The map border is drawn on top of the rectangle.

It's not working for me either. I think it is worth opening a ticket.

Anna

Vincent Bain wrote:

Not sure to understand your issue, so my answer might be off-target :

Reading the following, I think you do.

perhaps you can have a look at the output ps file. If it's only a matter
of display order, you can rearrange successive instructions within the
file in order to have your background laying over the border.

FWIW, I tried that in the ps.map script itself, i.e., first the border and then
the rectangle. Doesn't this affect the display order? Will try later to edit
the ps file.

Thank you, Nikos

[rest deleted]

Le lundi 11 mars 2013 à 16:31 +0200, Nikos Alexandris a écrit :

Doesn't this affect the display order?

I noticed sometimes things are set up in a fixed manner by ps.map,
whatever changes you make in the commands order.

Will try later to edit
the ps file.

It's worth give a try. I would do a test on a small test area, i.e. with
few vector data, or better without any cartographic elements, so to
easily find the section referring to your target objects in the ps file.

On 11/03/13 15:25, Anna Kratochvílová wrote:

Hi,

On Mon, Mar 11, 2013 at 2:18 PM, Nikos Alexandris
<nik@nikosalexandris.net> wrote:

Moritz L:

AFAIK, just give the rectangle map coordinates that are outside the map
frame. Ex:

raster elevation@PERMANENT
rectangle 637375 211190 643918 207236

note, the manual states:
rectangle east north east north -- typo?

I think it means *EN* coordinates of two corners (probably north west,
south east)

Yes, this is consistent with other objects.

      color black
      fcolor red
      width 2.0
      end

with r.info -g elevation:

north=228500
south=215000
east=645000
west=630000

So, that means that it is:
rectangle west north east south?

To be precise: it's easting northing of upper left corner and easting northing of lower right corner.

What about the following:

did you try to place a box that is 1/3 inside the map-frame and 2/3 outside?
The map border is drawn on top of the rectangle.

It's not working for me either. I think it is worth opening a ticket.

I can get it to "work" by deactivating the map border (border n) and then drawing two rectangles, one as map border and the other as the legend rectangle, with the latter below the former in the ps.map file:

maploc 0.705 1.158 6.671 6.017
border n

paper a4
     left 0.5
     right 0.5
     bottom 1
     top 1
     end

raster elevation@PERMANENT
rectangle 630000 228500 645000 215000
     color black
     fcolor none
     width 1.0
     end
rectangle 629830 218445 634471 213474
     color black
     fcolor 233:244:26
     width 2.0
     end

end

But I agree that this kind of detour shouldn't be necessary.

Moritz

Vincent Bain wrote:

> Not sure to understand your issue, so my answer might be off-target :

Nikos Alexandris wrote:

Reading the following, I think you do.

> perhaps you can have a look at the output ps file. If it's only a matter
> of display order, you can rearrange successive instructions within the
> file in order to have your background laying over the border.

Hey Vincent, very true -- thank you! Can this be "picked-up" by ps.map?

FWIW, I tried that in the ps.map script itself, i.e., first the border and
then the rectangle. Doesn't this affect the display order? Will try later
to edit the ps file.

I created two ps.map scripts: one containing a border and a rectangle, another
structurally identical, though with border's line- and the rectangle's fill-
colors changed.

Comparing with meld the two PSes shows where the (color) differences are.
This info along with the *beautifully* explained PS instructions, showed the
way :wink:

I just needed to change the very last part of the PS, from:

--%<---
grestore NP
399.7 478.2 M 706.7 478.2 LN
706.7 135.2 LN 399.7 135.2 LN
CP
0.000 1.000 0.000 C
F
0.502 0.502 0.502 C
0.10000000 W
D
0.000 0.000 1.000 C
0.72000000 W
36.5 72.5 507.8 522.8 B D
showpage
--->%--

to

--%<---
grestore
0.000 0.000 1.000 C
0.72000000 W
36.5 72.5 507.8 522.8 B D
NP
399.7 478.2 M 706.7 478.2 LN
706.7 135.2 LN 399.7 135.2 LN
CP
0.000 1.000 0.000 C
F
0.502 0.502 0.502 C
0.10000000 W
D
showpage
--->%--

And it works! With the modified instructions, the green-filled rectangle is
drawn on-top of the blue-line-colored border. Just for the records, the test-
pieces following.

The first one grey-line, black-box:

--%<---
# paper size
paper a4
  end

# border around map?
border
  color grey
  width 0.01i
  end

# background for the color-table?
rectangle 77% 90% 142% 14%
   fcolor 0:0:0
   color grey
   width 0.1
   end

end
--->%--

Blue line, green fill:

--%<---
# paper size
paper a4
  end

# border around map?
border
  color blue
  width 0.01i
  end

# raster map
# raster forest_fuel_classes
# scale 1:5000000
# maploc 0.5 0.5
# text 50% 115% ArcFUEL Forest Fuel Classes, Greece
# fontsize 20
# ref center
# end
# header
# end

# background for the color-table?
rectangle 77% 90% 142% 14%
   fcolor 0:255:0
   color grey
   width 0.1
   end
--->%--

Best, Nikos