~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to scripts/m.proj/description.html

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<H2>DESCRIPTION</H2> 
2
 
 
3
 
This program allows a user to convert coordinates from one projection to
4
 
another. Coordinates can be read from one file, converted, and results
5
 
written to another file. Alternatively, if the <b>input</b> and/or 
6
 
<b>output</b> options are omitted, eastings and northings may be passed 
7
 
to the program directly from <tt>stdin</tt> and results sent directly
8
 
to <tt>stdout</tt>. In this way <em>m.proj</em> can be used as a simple
9
 
frontend to the <tt><a href="http://proj.maptools.org">PROJ.4</a></tt>
10
 
<em>cs2cs</em> utility. The <b>-i</b> or <b>-o</b> flags make the task
11
 
especially easy for the common problem of converting to or from lat/long
12
 
WGS84.
13
 
<P>
14
 
<i>Note</i>: This program does not transform GRASS maps, it is designed to determine
15
 
the equivalent coordinate values of an individual position or list of
16
 
positions. Use <em>v.proj</em> or <em>r.proj</em> to reproject GRASS maps.
17
 
 
18
 
 
19
 
<H2>NOTES</H2>
20
 
 
21
 
<em>cs2cs</em> expects input data to formatted as "<tt>x y</tt>", so if working
22
 
with latitude-longitude data be sure to send the <tt>x</tt> value first,
23
 
i.e., "<tt>longitude&nbsp;latitude</tt>". Output data will be exported using
24
 
the same convention.
25
 
<P>
26
 
<em>cs2cs</em> will treat a third data column as a <tt>z</tt> value (elevation)
27
 
and will modify the value accordingly. This usually translates into small but
28
 
real differences in that data column.
29
 
<P>
30
 
<em>cs2cs</em> does not expect the input stream to contain column headings,
31
 
only numbers. If your data file has lines you wish to have passed through
32
 
without being processed, they must start with the '<tt>#</tt>' character.
33
 
<P>
34
 
If sending <em>m.proj</em> data from <tt>stdin</tt>, be aware that the data is
35
 
first stored to a temporary file before being processed with <em>cs2cs</em>.
36
 
It is therefore not advisable to send <em>m.proj</em> data from an open data
37
 
stream. The module will stop listening for incoming data after 2 seconds of
38
 
inactivity. You may use the projection parameters gleaned from <em>m.proj</em>'s
39
 
verbose mode (<b>-v</b>) with <em>cs2cs</em> directly in this case.
40
 
<P>
41
 
Custom projection parameters can be used via the <b>proj_in</b> and
42
 
<b>proj_out</b> options. Full documentation of the projection parameter
43
 
format may be found on the <tt><a href="http://proj.maptools.org">PROJ.4</a></tt>
44
 
website. Using these options will fully override the default parameters the
45
 
module would normally use.
46
 
<P>
47
 
By using the <b>-v</b> verbose flag, the user can see exactly what projection
48
 
parameters will be used in the conversion as well as some other informative
49
 
messages.
50
 
<P>
51
 
If output is to lat/long, it will be formatted using <tt>PROJ.4</tt>'s 
52
 
Degree:Minute:Second (DMS) convention of <tt>DDDdMM'SSS.SS"H</tt>. This can be handy
53
 
if you wish to quickly convert lat/long decimal degree data into its DMS
54
 
equivalent.<BR>
55
 
Alternatively, to have <em>m.proj</em> output data in decimal degrees, use the
56
 
<b>-d</b> flag. This flag can also be used with non-lat/long data to force a
57
 
higher number of decimal places (the <em>cs2cs</em> default is 2).
58
 
<P>
59
 
Lat/long output can be converted to GRASS's DMS convention (<tt>DDD:MM:SSS.SSSH</tt>)
60
 
by piping the results of <em>m.proj</em> through the <em>sed</em> stream
61
 
editor as follows.
62
 
<div class="code"><pre>
63
 
m.proj -o | sed -e 's/d/:/g' -e "s/'/:/g"  -e 's/"//g'
64
 
</pre></div>
65
 
<P>
66
 
The <em>m.proj</em> module is designed to work seamlessly with point data 
67
 
exported from the GIS with <em>v.out.ascii</em>, as the following example
68
 
shows.
69
 
<div class="code"><pre>
70
 
v.out.ascii bugsites | m.proj -o
71
 
</pre></div>
72
 
 
73
 
 
74
 
<H2>EXAMPLES</H2>
75
 
 
76
 
To convert a WGS84 long/lat coordinate to the current map projection using
77
 
the <b>-i</b> flag to set projection parameters automaticlly:
78
 
<div class="code"><pre>
79
 
GRASS> echo "170.510125 -45.868537" | m.proj -i
80
 
2316541.70      5479193.51 1.23
81
 
</pre></div>
82
 
 
83
 
<P><BR>
84
 
The same, but load points from a file named "<tt>waypoints.txt</tt>" and
85
 
continue on to import the results into a GRASS vector points map in the
86
 
current map projection:
87
 
<div class="code"><pre>
88
 
m.proj -i in=waypoints.txt | cut -f1 -d' ' | v.in.ascii out=test_pt fs=tab
89
 
</pre></div>
90
 
Here the standard UNIX <em>cut</em> tool is used to discard the <tt>z</tt>
91
 
residual.
92
 
 
93
 
<P><BR>
94
 
To convert all coordinates from a vector points map in the current projection
95
 
to WGS84 long/lat, with output in decimal form:
96
 
<div class="code"><pre>
97
 
v.out.ascii bugsites | m.proj -od
98
 
</pre></div>
99
 
 
100
 
<P><BR>
101
 
To transform points from a UTM projection into the Gauss-Kr&uuml;ger Grid
102
 
System, importing and exporting to files:
103
 
 
104
 
<div class="code"><pre>
105
 
m.proj <b>proj_in</b>="+proj=utm +name=utm +a=6378137.0 +es=0.006694380 \
106
 
    +zone=32 +unfact=1.0" <b>proj_out</b>="+proj=tmerc +name=tmerc \
107
 
    +a=6377397.155 +es=0.0066743720 +lat_0=0.0 +lon_0=9.0 +k=1.0 \
108
 
    +x_0=3500000.0" <b>input</b>=utm.coord.txt <b>output</b>=new.gk.coord.txt
109
 
</pre></div>
110
 
 
111
 
<P>
112
 
Projection parameters provided in the above case: "<tt>+proj</tt>" (projection
113
 
type), "<tt>+name</tt>" (projection name), "<tt>+a</tt>" (ellipsoid: equatorial
114
 
radius), "<tt>+es</tt>" (ellipsoid: eccentricity squared), "<tt>+zone</tt>"
115
 
(zone for the area), "<tt>+unfact</tt>" (conversion factor from meters to other
116
 
units, e.g. feet), "<tt>+lat_0</tt>" (standard parallel), "<tt>+lon_0</tt>"
117
 
(central meridian), "<tt>+k</tt>" (scale factor) and "<tt>+x_0</tt>" (false
118
 
easting). Sometimes false northing is needed which is coded as "<tt>+y_0</tt>".
119
 
Internally, the underlying
120
 
<a href="http://www.remotesensing.org/proj/"><tt>PROJ.4</tt> projection library</a>
121
 
performs an inverse projection to latitude-longitude and then projects the 
122
 
coordinate list to the target projection.
123
 
<P><BR>
124
 
<!-- HB 4/2006: I'm leaving this in from the GRASS 5 help page, but is it accurate? -->
125
 
Datum conversions are automatically handled by the <tt>PROJ.4</tt> library if
126
 
"<tt>+datum</tt>" setings are specified on <b>both</b> the input <b>and</b> output
127
 
projections on the command line. The "<tt>+towgs84</tt>" parameter can be used to 
128
 
define either 3 or 7 term datum transform coefficients, satisfying this requirement.
129
 
<P>
130
 
If a datum is specified there is no need for the '<tt>+ellps=</tt>' or underlying
131
 
parameters, '<tt>+a=</tt>', '<tt>+es=</tt>', etc.
132
 
<p>
133
 
<h4>Another custom parameter usage example:</h4>
134
 
 
135
 
<div class="code"><pre>
136
 
m.proj <B>proj_in</B>="+proj=tmerc +datum=ire65 +lat_0=53.5 +lon_0=-8 +x_0=200000 \
137
 
    +y_0=250000 +k=1.000035" <B>proj_out</B>="+proj=ll +datum=wgs84" <B>input</B>=wpt.txt
138
 
</pre></div>
139
 
 
140
 
or without datum transformation:
141
 
 
142
 
<div class="code"><pre>
143
 
m.proj <B>proj_in</B>="+proj=tmerc +ellps=modif_airy +lat_0=53.5 +lon_0=-8 +x_0=200000 \
144
 
    +y_0=250000 +k=1.000035" <B>proj_out</B>="+proj=ll +datum=wgs84" <B>input</B>=wpt.txt
145
 
</pre></div>
146
 
 
147
 
<P>
148
 
In this example no datum transformation will take place as a datum was not
149
 
specified for the input projection. The datum specified for the output
150
 
projection will thus be silently ignored and may be left out; all that is
151
 
achieved a simple conversion from projected to geodetic co-ordinates,
152
 
keeping the same datum (and thus also the same ellipsoid).</p>
153
 
 
154
 
<p>
155
 
For more usage examples, see the documentation for the 
156
 
<tt><a href="http://proj.maptools.org">PROJ.4</a></tt> <em>cs2cs</em> program.
157
 
 
158
 
 
159
 
<H2>REFERENCES</H2>
160
 
 
161
 
[1] Evenden, G.I.  (1990) <a href="http://proj.maptools.org/">Cartographic projection procedures for
162
 
the UNIX environment - a user's manual.</a>  USGS Open-File Report 90-284 (OF90-284.pdf)
163
 
See also there: Interim Report and 2nd Interim Report on Release 4, Evenden 1994).
164
 
<P>
165
 
[2] <tt><a href="http://proj.maptools.org">PROJ.4</a></tt> Cartographic Projection Library
166
 
 
167
 
 
168
 
<H2>SEE ALSO</H2>
169
 
 
170
 
<EM>
171
 
<A HREF="v.proj.html">v.proj</A>,
172
 
<A HREF="r.proj.html">r.proj</A>,
173
 
<A HREF="g.proj.html">g.proj</A>,
174
 
<A HREF="g.setproj.html">g.setproj</A>,
175
 
<A HREF="i.rectify.html">i.rectify</A>,
176
 
<!-- <A HREF="i.rectify3.html">i.rectify3</A> -->
177
 
<A HREF="v.in.ascii.html">v.in.ascii</A>,
178
 
<A HREF="v.out.ascii.html">v.out.ascii</A>
179
 
</EM>
180
 
 
181
 
 
182
 
<H2>AUTHOR</H2>
183
 
 
184
 
M. Hamish Bowman, Dept. Marine Science, Otago University, New Zealand<BR>
185
 
Functionality inspired by the <em>m.proj</em> and <em>m.proj2</em> modules for
186
 
GRASS GIS 5.
187
 
 
188
 
<p><i>Last changed: $Date: 2006-08-31 10:47:06 +0200 (Thu, 31 Aug 2006) $</i></p>
189