NAME

m.proj2 - Calculates conversion coordinates for geographic positions.
(GRASS Map Development Program)

SYNOPSIS

m.proj2 [inproj=name[,name,...]] [outproj=name[,name,...]] [input=name] [output=name]

Parameters:

inproj
Comma separated input projection parameters
outproj
Comma separated output projection parameters
input
Input coordinate file
output
Output coordinate file

DESCRIPTION

This program allows a user to (optionally interactively) convert coordinates from one projection to another. It allows a user to convert coordinates from a file, writing to a file.

Note: The program does not transform GRASS files, it is designed to determine coordinate values on an individual position.

The map projections currently supported are listed in etc/projections file.

Each of the above projections (with the exception of State Plane) can be computed with the spheroids listed in etc/ellipse.table file.

INPUT FILE FORMAT

When reading from a file of LATITUDE/LONGITUDE data the file will contain three (2) columns of information:
the first column - latitude - in degrees minutes seconds,
the second column - longitude - in degrees minutes seconds,

For example:

	+40 36 31.4563	-87 2 7.8193	
	40n 36 31.4563	87w 2 7.8193

When reading from a file of PROJECTION COORDINATES data the file will contain three (2) columns of information:
the first column - easting - ground coordinates
the second column - northing - ground coordinates

For example:

 	 500000.00	4496918.64	
	-424489.11	1908736.13

USAGE EXAMPLE

For example, if desired to transform points from UTM projection to the Gauss-Krüger Grid System it can be done by running:
         m.proj2 inproj="proj=utm,name=utm,a=6378137.0,es=0.006694380,\
         zone=32,unfact=1.0" outproj="proj=tmerc,name=tmerc,\
         a=6377397.155,es=0.0066743720,lat_0=0.0,lon_0=9.0,k=1.0,\
         x_0=3500000.0" input=utm.coord output=new.gk.coord

Projection parameters have to be provided, in above case: "proj" (projection type), "name" (projection name), "a" (ellipsoid: equatorial radius), "es" (ellipsoid: eccentricity squared), "zone" (zone for the area), "unfact" (conversion factor from meters to other units, e.g. feet), "lat_0" (standard parallel), "lon_0" (central meridian), "k" (scale factor) and "x_0" (false easting). Sometimes false northing is needed which is coded as "y_0". Internally, the underlying PROJ 4 projection library performs an inverse projection to latitude-longitude and then projects the coordinate list to the target projection.

Note: NO column headings are required, just the numbers.

Datum conversions are automatically handled by the PROJ.4 library, if 'datum=' is specified in both the input and output projections on the command line. (N.B. When using the command interactively, the user will not be asked for a datum, and datum transformation will not take place.)

If a datum is specified there is no need for the 'ellps=' or underlying parameters, 'a=', 'es=' etc.

Another Usage example:

m.proj2 inproj="proj=tmerc,datum=ire65,lat_0=53.5,lon_0=-8,x_0=200000,\
y_0=250000,k=1.000035" outproj="proj=ll,datum=wgs84" input=test.txt
or without datum transformation:
m.proj2 inproj="proj=tmerc,ellps=modif_airy,lat_0=53.5,lon_0=-8,x_0=200000,\
y_0=250000,k=1.000035" outproj="proj=ll,datum=wgs84" input=test.txt
In this example no datum transformation will take place as a datum was not specified for the input projection. The datum specified for the output projection will thus be silently ignored and may be left out; all that is achieved a simple conversion from projected to geodetic co-ordinates, keeping the same datum (and thus also the same ellipsoid).

For more usage examples, see documentation for the PROJ.4 'cs2cs' program. [2]

BUGS

References:

[1]Evenden, G.I. (1990) Cartographic projection procedures for the UNIX environment - a user's manual. USGS Open-File Report 90-284 (Also see Interim Report and 2nd Interim Report on Release 4, Evenden 1994).

[2] PROJ4 software

SEE ALSO

m.proj, s.proj, s.proj, v.proj, g.setproj, i.rectify, i.rectify3, r.support, r.stats, s.sample, s.surf.idw, s.surf.rst

AUTHOR

Bob Covill, code based on m.proj

Last changed: $Date: 2003/02/03 21:42:06 $