mapproject - Forward and Inverse map transformation of 2-D coordinates

mapprojectinfiles-Jparameters-Rwest/east/south/north[r] [-C] [-Dc|i|m|p] [-F[k|m|n] ] [-H[nrec] ] [-I] [-M[flag] ] [-S] [-V] [-:] [-bi[s][n] ] [-bo[s] ]

mapprojectreads (longitude, latitude) positions frominfiles[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.infilesData file(s) to be transformed. If not given, standard input is read.-JSelects the map projection. The following character determines the projection. If the character is upper case then the argument(s) supplied as scale(s) is interpreted to be the map width (or axis lengths) in inch, else the scale argument(s) is the map scale (see its definition for each projection). Choose one of the following projections (TheEorCafter projection names stands for Equal-Area and Conformal, respectively):CYLINDRICALPROJECTIONS:-Jclon0/lat0/scaleor-JClon0/lat0/width(Cassini) Give projection center and scale (1:xxxx or inch/degree).-Jjlon0/scaleor-JJlon0/width(Miller Cylindrical Projection) Give the central meridian and scale (1:xxxx or inch/degree).-Jmparameters(Mercator[C]). Specify one of:-Jmscaleor-JMwidthGive scale along equator (1:xxxx or inch/degree).-Jmlon0/lat0/scaleor-JMlon0/lat0/widthGive central meridian, standard latitude and scale along parallel (1:xxxx or inch/degree).-Joparameters(Oblique Mercator[C]). Specify one of:-Joalon0/lat0/azimuth/scaleor-JOalon0/lat0/azimuth/widthSet projection center, azimuth of oblique equator, and scale.-Joblon0/lat0/lon1/lat1/scaleor-JOblon0/lat0/lon1/lat1/scaleSet projection center, another point on the oblique equator, and scale.-Joclon0/lat0/lonp/latp/scaleor-JOclon0/lat0/lonp/latp/scaleSet projection center, pole of oblique projection, and scale. Give scale along oblique equator (1:xxxx or inch/degree).-Jqlon0/scaleor-JQlon0/width(Equidistant Cylindrical Projection (Plate Carree)) Give the central meridian and scale (1:xxxx or inch/degree).-Jtlon0/scaleor-JTlon0/width(TM - Transverse Mercator[C]) Give the central meridian and scale (1:xxxx or inch/degree).-Juzone/scaleor-JUzone/width(UTM - Universal Transverse Mercator[C]) Give the zone number and scale (1:xxxx or inch/degree). Use negative zone numbers for the southern hemisphere.-Jylon0/lats/scaleor-JYlon0/lats/width(Basic Cylindrical Projections[E]) Give the central meridian, standard parallel, and scale (1:xxxx or inch/degree). The standard parallel is typically one of these (but can be any value): 45 - The Peters projection 37.4 - The Trystan Edwards projection 30 - The Behrman projection 0 - The Lambert projectionAZIMUTHALPROJECTIONS:-Jalon0/lat0/scaleor-JAlon0/lat0/width(Lambert[E]).lon0/lat0specifies the projection center. Give scale as 1:xxxx orradius/lat, whereradiusis distance in inch from origin to the oblique latitudelat.-Jelon0/lat0/scaleor-JElon0/lat0/width(Equidistant).lon0/lat0specifies the projection center. Give scale as 1:xxxx orradius/lat, whereradiusis distance in inch from origin to the oblique latitudelat.-Jflon0/lat0/horizon/scaleor-JFlon0/lat0/horizon//width(Gnomonic).lon0/lat0specifies the projection center.horizonspecifies the max distance from projection center (in degrees, < 90). Give scale as 1:xxxx orradius/lat, whereradiusis distance in inch from origin to the oblique latitudelat.-Jglon0/lat0/scaleor-JGlon0/lat0/width(Orthographic).lon0/lat0specifies the projection center. Give scale as 1:xxxx orradius/lat, whereradiusis distance in inch from origin to the oblique latitudelat.-Jslon0/lat0/scaleor-JSlon0/lat0/width(General Stereographic[C])lon0/lat0specifies the projection center. Give scale as 1:xxxx orradius/lat, whereradiusis distance in inch from origin to the oblique latitudelat.CONICPROJECTIONS:-Jblon0/lat0/lat1/lat2/scaleor-JBlon0/lat0/lat1/lat2/width(Albers[E]) Give projection center, two standard parallels, and scale (1:xxxx or inch/degree).-Jllon0/lat0/lat1/lat2/scaleor-JLlon0/lat0/lat1/lat2/width(Lambert[C]) Give origin, 2 standard parallels, and scale along these (1:xxxx or inch/degree).MISCELLANEOUSPROJECTIONS:-Jhlon0/scaleor-JHlon0/width(Hammer[E]) Give the central meridian and scale along equator (1:xxxx or inch/degree).-Jilon0/scaleor-JIlon0/width(Sinusoidal[E]) Give the central meridian and scale along equator (1:xxxx or inch/degree).-Jklon0/scaleor-JKlon0/width(Eckert VI[E]) Give the central meridian and scale along equator (1:xxxx or inch/degree).-Jnlon0/scaleor-JNlon0/width(Robinson) Give the central meridian and scale along equator (1:xxxx or inch/degree).-Jrlon0/scale-JRlon0/width(Winkel Tripel) Give the central meridian and scale along equator (1:xxxx or inch/degree).-Jwlon0/scaleor-JWlon0/width(Mollweide[E]) Give the central meridian and scale along equator (1:xxxx or inch/degree).NON-GEOGRAPHICALPROJECTIONS:-Jpscaleor-JPwidth(Linear projection for polar (theta,r) coordinates) Give scale in inch/r-unit.-Jxx-scale[/y-scale] or-JXwidth[/height]scale[orwidth] can be any of the following 3 types:-Jxscale- Regular linear scaling.-Jxscalel- Take log10 of values before scaling.-Jxscaleppower- Raise values topowerbefore scaling. Givex-scalein inch/x-unit andy-scalein inch/y-unit. (y-scale=x-scaleif not specified separately). Use negative scale(s) to reverse the direction of an axis (e.g., to have y be positive down). Appenddif x and y are geographical coordinates in degrees. Default axes lengths (see gmtdefaults) can be invoked using-JXh(for landscape);-JXv(for portrait) will swap the x- and y-axes lengths. TheGMTdefault unit for this installation is inch. However, you may change this by editing your .gmtdefaults file(s) (run gmtdefaults to create one if you don't have it). The ellipsoid used in the map projections is user-definable by editing the .gmtdefaults file in your home directory. 13 commonly used ellipsoids and a spheroid are currently supported, and users may also specify their own ellipsoid parameters (see man gmtdefaults for more details).GMTdefault is WGS-84.-Rwest,east,south, andnorthspecify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Appendrif lower left and upper right map coordinates are given instead of wesn.

infile(s) input file(s) with 2 or more columns. If no file(s) is given, mapproject will read standard input.-CSet center of projected coordinates to be at map projection center [Default is lower left corner].-DTemporarily override MEASURE_UNIT and usec(cm),i(inch),m(meter), orp(points) instead.-FForce 1:1 scaling, i.e., output (or input, see-I) data are in actual projected meters. To specify other units, appendk(km),m(mile),n(nautical mile),i(inch),c(cm), orp(points). Without-F, the output (or input, see-I) are in the units specified by MEASURE_UNIT (but see-D).-HInput file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used,GMTdefault is 1 header record.-IDo the Inverse transformation, i.e. get (longitude,latitude) from (x,y) data.-MMultiple segment file(s). Segments are separated by a special record. For ASCII files the first character must beflag[Default is '>']. For binary files all fields must be NaN.-SSuppress points that fall outside the region.-VSelects verbose mode, which will send progress reports to stderr [Default runs "silently"].-:Toggles between (longitude,latitude) and (latitude,longitude) input/output. [Default is (longitude,latitude)].-biSelects binary input. Appendsfor single precision [Default is double]. Appendnfor the number of columns in the binary file(s). [Default is 2 input columns]-boSelects binary output. Appendsfor single precision [Default is double].

To transform a file with (longitude,latitude) into (x,y) positions in inch on a Mercator grid for a given scale of 0.25 inch per degree, run mapproject lonlatfile-R20/50/12/25-Jm0.25i> xyfile To transform several 2-column, binary, double precision files with (latitude,longitude) into (x,y) positions in inch 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-bo-bi2> tmfile.b

The rectangular input region set with-Rwill in general be mapped into a non-rectangular grid. Unless-Cis 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 throughmapprojectusing 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, useawkto scale and shift the (x,y) values before transforming.

gmtdefaults, gmt, project

Snyder, J. P., 1987, Map Projections - A Working Manual, U.S. Geological Survey Prof. Paper 1395.

Man(1) output converted with man2html