|
From: <le...@pr...> - 2004-11-07 05:46:47
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27534 Added Files: Tag: leonard-dev templ.ps Log Message: keep the postscript template here --- NEW FILE: templ.ps --- %!PS % $Id: templ.ps,v 1.1.2.1 2004/11/07 05:46:36 leonard Exp $ % David Leonard, 2002. Public domain. %-- copy the builtin operations as function objects rather than % wrap in a separate proc /l /lineto load def /m /moveto load def /s /stroke load def /f /fill load def /c /closepath load def /n /newpath load def /x /exch load def /r /rlineto load def %.ABBREV lineto=l moveto=m stroke=s fill=f closepath=c newpath=n %.DATABASE lib/globalm %.LIBRARY area %150 150 translate 0.5 0.5 scale % debug %-- clip to the viewing rectangle %%.SIZE %n 0 0 m dup 0 x r x 0 r 0 x neg r c clip %-- plot the sea area %.COVERAGE bnd %.FEATURE oceansea 0.678 0.847 0.902 setrgbcolor % light-blue %.PLOT %-- plot the land masses %.FEATURE polbnda 1 1 .7 setrgbcolor % yellow %.PLOT %-- plot the state boundaries (use=(23:intl, 26:state, 30:local)) %.IF scale < 12M %.COVERAGE bnd %.FEATURE polbndl 0.9 0.9 0.9 setrgbcolor % light-grey 3.0 setlinewidth %.PLOT use = 26 % (26=state) 1.0 0.9 0.9 setrgbcolor % light-pink %.PLOT use = 23 % (23=intl) %.ENDIF %.IF scale < 1M %-- plot some built-up areas %. COVERAGE pop %. FEATURE builtupa 0.83 0.83 0.83 setrgbcolor % light-grey %. PLOT %.ENDIF %.IF scale < 1.5M %-- plot some inland water %.COVERAGE hydro %.FEATURE inwatera 0.678 0.847 1 setrgbcolor % more-blue-than-light-blue %.PLOT hyc=8 %.FEATURE watrcrsl 0.3 setlinewidth 0.5 0.7 1 setrgbcolor %.PLOT hyc=8 %.ENDIF %.IF scale < 800k %-- plot the roads (rtt=(14:primary, 15:secondary, 16:fway) %. COVERAGE trans %. FEATURE railrdl 0.75 0.75 0.75 setrgbcolor % dark grey 0.4 setlinewidth %. PLOT %. FEATURE roadl 0.686 0.721 0.819 setrgbcolor % tan 2.0 setlinewidth %. PLOT rtt=16 % 'freeway' 1 0.8 0.8 setrgbcolor % red 1.0 setlinewidth %. PLOT rtt=15 % 'secondary route' %. IF scale < 400k .930 .871 .796 setrgbcolor % brown 1.0 setlinewidth %. PLOT rtt=14 % 'primary route' 0.2 setlinewidth 0.8 0.7 0.7 setrgbcolor % light grey %. PLOT rtt > 16 % 'other roads' %. ENDIF %.ENDIF %-- plot the coastlines %.IF scale < 15M %. COVERAGE bnd %. FEATURE coastl 0.5 setlinewidth 0.6 0.6 0.9 setrgbcolor % dark-blue %. PLOT %.ENDIF %%- show outline of database clip %%0.5 setlinewidth 0 0 0 setrgbcolor %%.WHOLEPATH %stroke showpage %-- draw the legend %.SIZE /h exch def /w exch def %.LEGEND 60 /legwidth exch def /segcount exch def /legstr exch def /segwidth legwidth segcount div def /legheight 8 def % height of legend /leginset 1 def % black inset around legend %-- draw legend outline (dark grey box) 0.6 setgray newpath w 0 moveto legwidth leginset 2 mul add neg 0 rlineto 0 legheight leginset 2 mul add rlineto legwidth leginset 2 mul add 0 rlineto closepath fill %-- draw grey/white segments 1 1 segcount { dup 2 mod 0 eq { 1.0 } { 0.9 } ifelse setgray newpath segwidth mul w exch sub leginset sub leginset moveto segwidth 0 rlineto 0 legheight rlineto segwidth neg 0 rlineto closepath fill } for %-- draw the legend dimension centred 0 setgray /Helvetica findfont legheight scalefont setfont legstr stringwidth pop 2 div legwidth 2 div add leginset add w exch sub leginset legheight 0.15 mul add moveto legstr show showpage |