MAPPROJECT
Section: Misc. Reference Manual Pages (l)
Updated: DATE
Index
Return to Main Contents
#ifdef SI
#define UNIT cm
#else
#define UNIT inch
#endif
NAME
mapproject - Forward and Inverse map transformation of 2-D coordinates
SYNOPSIS
mapproject infiles -Jparameters -Rwest/east/south/north[r]
[ -C ] [ -F[k|m] ] [ -H ] [ -I ] [ -M[flag] ] [ -S ] [ -V ] [ -: ]
DESCRIPTION
mapproject reads (longitude, latitude) positions from infiles [or standard input] and
computes (x,y) coordinates using the specified map projection and scales.
Optionally, it can read (x,y) positions and compute (longitude, latitude) values
doing the inverse transformation. This can be used to transform linear (x,y) points
obtained by digitizing a map of known projection to geographical coordinates.
Additional data fields are permitted after the first 2 columns which must have (longitude,latitude) or (x,y).
See option -: on how to read (latitude,longitude) files.
No space between the option flag and the associated arguments. Use upper case for the
option flags and lower case for modifiers.
- infiles
-
Data file(s) to be transformed. If not given, standard input is read.
#include "explain_-J.txt"
#include "explain_-R.txt"
OPTIONS
- infile(s)
-
input file(s) with 2 or more columns. If no file(s) is given, mapproject will read standard input.
- -C
-
Set center of projected coordinates to be at map projection center [Default is lower left corner].
- -F
-
Force 1:1 scaling, i.e., input data is in actual projected meters. Append k to get projected km,
or m to get miles.
#include "explain_-H.txt"
- -I
-
Do the Inverse transformation, i.e. get (longitude,latitude) from (x,y) data.
- -M
-
Multiple segment file. Segments are separated by a record whose first character is <flag>.
[Default is '>'].
- -S
-
Suppress points that fall outside the region.
#include "explain_-V.txt"
#include "explain_-t.txt"
EXAMPLES
To transform a file with (longitude,latitude) into (x,y) positions in UNIT on
a Mercator grid for a given scale, run
mapproject lonlatfile -R20/50/12/25 -Jm0.25 > xyfile
To transform several files with (latitude,longitude) into (x,y) positions in UNIT on
a Transverse Mercator grid (central longitude 75W) for scale = 1:500000 and suppress those points
that would fall outside the map area, run
mapproject tracks.* -R-80/-70/20/40 -Jt-75/1:500000 -: -S > tmfile.xy
RESTRICTIONS
The rectangular input region set with -R will in general be mapped into a
non-rectangular grid. Unless -C is set, the leftmost point on this grid has xvalue = 0.0, and the
lowermost point will have yvalue = 0.0. Thus, before you digitize a map, run the
extreme map coordinates through mapproject using the appropriate scale and see
what (x,y) values they are mapped onto. Use these values when setting up for
digitizing in order to have the inverse transformation work correctly, or alternatively,
use awk to scale and shift the (x,y) values before transforming.
SEE ALSO
gmtdefaults, gmt, project
#include "refs.i"
Snyder, J. P., 1987, Map Projections - A Working Manual, U.S. Geological Survey Prof. Paper 1395.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- EXAMPLES
-
- RESTRICTIONS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 07:10:47 GMT, January 07, 2025