[OSRS-PROJ] New projection routines??

Gerald I. Evenden gerald.evenden at verizon.net
Sun Mar 9 16:44:47 EST 2003


The following is the bash script I use to generate most of the
pseudo cylindrical illustrations.  The last bit is the control
string for 'gnuplot'.  Procedure coast reads world coast line data,
passes it through a call to the PJ library and transfers the
resultant xy vectors to the scratch file.  Procedure graticule
generates a graticule of constant lat-lon lines, passes ll data
though a call to PJ lib and concatinates the xy output to the
scratch file.  Finally, the scratch file is passed to gnuplot which
outputs an eps.

Execute as:
  proto eck4
First arg is projection name. A second arg contains any added
+operation details.  None In this case.

Process is pretty speedy:

[gie at localhost figs]$ time ./proto times
+proj=times

real    0m0.390s
user    0m0.156s
sys     0m0.018s

# prototype for generating illustration
BASE=/home/gie/MAPGEN
BIN=PROJ.4/graphics
COAST=$BASE
proj="+proj=$1 $2"
echo $proj
coastarg=.3,-180,180,-90,90
gratarg=.001,15,,-180,180,90,-90,90

$BASE/$BIN/graticule $gratarg $proj +R=1 >data.dat
echo -e "\n" >>data.dat
zcat $COAST/world | \
$BASE/$BIN/coast $coastarg $proj +R=1 >>data.dat
gnuplot <<EOF
set output "$1.eps"
set terminal postscript eps
set data style lines
set bmargin 0
set rmargin 0
set tmargin 0
set lmargin 0
set nolabel
set noxtics
set noytics
set nokey
set noborder
plot 'data.dat'
EOF

The main reason that gnuplot files are longer than 'plotter'
output is each output vector element in gnuplot looks like

-36 224 V
-25 215 V
-18 416 V

whereas plotter would generate something like:

-36 224 -25 215 -18 416 V

That is, a long string of delta pairs before doing a plot command.
Gnuplot also has an overhead of spec'ing characters in the
preample that plotter did not but that is only a 1 or 2k
overhead.

<blank>V per line takes a lot of bytes.

Gnuplot is fairly sophisticated, this job is pretty crude and
does not exercise the program.  I'm mostly turning off options.

On Sun, 2003-03-09 at 13:47, Karl Swartz wrote:
> > But tell me of an alternative with a GNU license or equivalence.
> 
> Good question.  I don't really know of any, though I don't do much with
> PostScript.
> 
> > But the bottom line is this: it replicates the ps files that
> > are in the PROJ.4 pdfs and the ps files are only about 70% larger
> > that the ps files generated by my old 'plotter' program.  Gnuplot
> > has a lot more flexibility than 'plotter'.
> 
> Fascinating.  I would have expected gnuplot to do a crude and cumbersome
> job at best.  Would you mind sharing the commands you're using (and a
> bit of sample data) so this old dog can learn some new tricks?  Thanks!
> 
>  -- Karl

----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list