Ps.output: Difference between revisions
Jump to navigation
Jump to search
⚠️Ejtizado (talk | contribs) No edit summary |
⚠️Ejtizado (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
The '''master file''', to repeat the creation of all maps with the same layout, is as: | The '''master file''', to repeat the creation of all maps with the same layout, is as: | ||
<source lang="bash"> | |||
#!/bin/bash | #!/bin/bash | ||
Line 23: | Line 24: | ||
makemap map_1 | makemap map_1 | ||
makemap map_2 | makemap map_2 | ||
</source> | |||
---- | |||
The file '''map_pre''' include all code to execute ''ps.out'' and design the basic elements of the map | The file '''map_pre''' include all code to execute ''ps.out'' and design the basic elements of the map: title, graticule, scalebar, north-arrow, etc. | ||
A example content is: | A example content is: | ||
<source lang="bash"> | |||
OUTPUT=$1 | OUTPUT=$1 | ||
ps.out -g out=$OUTPUT.ps << EOF | ps.out -g out=$OUTPUT.ps << EOF | ||
Line 37: | Line 39: | ||
top 2cm | top 2cm | ||
landscape y | landscape y | ||
draw | |||
color 70:70:70 | |||
linewidth .4mm | |||
rect 22cm 2cm 28cm 19cm 240:240:240 | |||
color black | |||
font OffensiveBold 10 .8 | |||
text 25cm 6cm "MAIN TITLE" | |||
end | |||
end | end | ||
Line 71: | Line 81: | ||
end | end | ||
end | end | ||
</source> | |||
---- | |||
The file '''map_post''' include the final ending code, and perhaps the common legend style. For example, | The file '''map_post''' include the final ending code, and perhaps the common legend style. For example, | ||
<source lang="bash"> | |||
vlegend Legend | vlegend Legend | ||
frame | frame | ||
Line 99: | Line 112: | ||
echo "GO Go go: $OUTPUT.pdf" | echo "GO Go go: $OUTPUT.pdf" | ||
ps2pdf14 $OUTPUT.ps | ps2pdf14 $OUTPUT.ps | ||
</source> | |||
---- | |||
The file '''map_#''' include the specific code to draw the particular maps. For example, | The file '''map_#''' include the specific code to draw the particular maps. For example, | ||
<source lang="bash"> | |||
vareas risk_range | vareas risk_range | ||
label Probabilidad de infección | label Probabilidad de infección | ||
Line 132: | Line 149: | ||
masked y | masked y | ||
end | end | ||
</source> | |||
Revision as of 18:57, 27 September 2010
The ps.out try to update the standard postscript output of Grass adding new feature to design borders, graticules, categorized legends, etc
Creating maps with same layout using ps.out
To make several maps with the same layout, we use three files: map_pre, map_post, and a master file. Also we need the map_# with the particular content of the map.
The master file, to repeat the creation of all maps with the same layout, is as:
#!/bin/bash
MAP=map_ps
function makemap()
{
echo "#!/bin/bash" > $MAP
cat map_pre >> $MAP
cat $1 >> $MAP
cat map_post >> $MAP
chmod +x $MAP
./$MAP $1
rm $MAP
}
makemap map_1
makemap map_2
The file map_pre include all code to execute ps.out and design the basic elements of the map: title, graticule, scalebar, north-arrow, etc. A example content is:
OUTPUT=$1
ps.out -g out=$OUTPUT.ps << EOF
paper A4
left 2cm
top 2cm
landscape y
draw
color 70:70:70
linewidth .4mm
rect 22cm 2cm 28cm 19cm 240:240:240
color black
font OffensiveBold 10 .8
text 25cm 6cm "MAIN TITLE"
end
end
scale 1:500000
grid
format iho
trim -1
major 50000
width .18mm
color none
end
minor 25000
width .18mm
color none
style 2
end
subminor 5
font
name Univers
size 10
color black
end
fcolor black
end
vlines bz_lim
type boundary
label Límite del Bierzo
lpos -1
line
width .3mm
color black
end
end
The file map_post include the final ending code, and perhaps the common legend style. For example,
vlegend Legend
frame
where 25cm 12cm
ref center center
offset 0 0
border .3mm
fcolor white
margin 12
end
title
name Univers-Bold
size 10
extend 1.25
end
font
name Univers
size 9
end
end
EOF
echo "GO Go go: $OUTPUT.pdf"
ps2pdf14 $OUTPUT.ps
The file map_# include the specific code to draw the particular maps. For example,
vareas risk_range
label Probabilidad de infección
legend 0
line
width .01mm
color none
style 1
end
fcolor GRASSRGB$.7 cat
masked y
setrule 1 Muy baja
setrule 2 Baja
setrule 3 Media
setrule 4 Alta
setrule 5 Muy alta
end
vpoint cs_parcela
label Intensidad de ataque
where ch_pr > 0
symbol basic/circle
line
width .1mm
color black
end
fcolor white$.3
size ch_prx 8
scale 5 2
masked y
end