[GRASS5] New Coordinate Conversion Programs

Bob Covill bcovill at tekmap.ns.ca
Wed Oct 10 20:56:54 EDT 2001


If anyone is interested I have applied to CVS two new coordinate
conversion programs based on the PROJ library. These programs should
eventually be able to replace the existing coordiante conversion

The first program - m.ll2db is taken from m.ll2u and will convert
between Lat. Long. and the users current database units. The exceptions
are a Lat. Long. GRASS database and an XY GRASS database.  The program
simply reads the users current projection parameters and converts to or
from (-i) latitude longitude coordinates. Input can be from a file,
standard input, or entered interactively. To convert Lat. Long.
coordinates to database coordinates use the -i flag (inverse
projection). I have used the program in a UTM database but it needs to
be tested with other projections.

The second program - m.proj2 is a modified version of m.proj intended to
be a little more flexible. This program still needs more testing and
improvements added. If no arguments are given with m.proj2 it prompts
the user for the appropriate projection and input parameters. Also, if
the user knows the input parameters they can be provided on the command
For example to convert a file (test.ll) of Latitudes Longitudes to a
file (test.utm) of UTM coordiantes use:

m.proj2 proj1=proj=ll
input=test.ll output=test.utm

where proj1 is a comma seperated list of input projection parameters
proj2 is a comma seperated list of output projection parameters
input is the input coordinate file
output is the output projection file

For those familiar with PROJ note that the "+" is left off the
projection parameters. If you do not know the projection parameters run
the program with no options and the options are printed to stderr.

This program (m.proj2) still needs several improvements and lots of
debugging. For example it needs an option to handle reversed coordinate
pairs. Also, it would be nice to have the program handle data piped to

Sorry about the long message. Comments or questions are welcome.
Bob Covill

Tekmap Consulting
P.O. Box 2016 Fall River, N.S.
B2T 1K6

E-Mail: bcovill at tekmap.ns.ca
Phone: 902-860-1496
Fax: 902-860-1498

More information about the grass-dev mailing list