[GRASS-SVN] r70871 - grass/branches/releasebranch_7_2/scripts/m.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 14 00:00:28 PDT 2017


Author: neteler
Date: 2017-04-14 00:00:28 -0700 (Fri, 14 Apr 2017)
New Revision: 70871

Modified:
   grass/branches/releasebranch_7_2/scripts/m.proj/m.proj.html
Log:
m.proj manual: modernize examples; add sections

Modified: grass/branches/releasebranch_7_2/scripts/m.proj/m.proj.html
===================================================================
--- grass/branches/releasebranch_7_2/scripts/m.proj/m.proj.html	2017-04-14 06:59:46 UTC (rev 70870)
+++ grass/branches/releasebranch_7_2/scripts/m.proj/m.proj.html	2017-04-14 07:00:28 UTC (rev 70871)
@@ -62,17 +62,22 @@
 use the <b>-d</b> flag. This flag can also be used with non-lat/long
 data to force a higher number of decimal places (the <em>cs2cs</em>
 default is 2).
-
-<h2>EXAMPLES</h2>
-
-Lat/long output can be converted to GRASS's DMS convention
+<p>
+Note that Lat/long output can be converted to GRASS's DMS convention
 (<tt>DDD:MM:SSS.SSSH</tt>) by piping the results of <em>m.proj</em>
 through the <em>sed</em> stream editor as follows.
 
 <div class="code"><pre>
-m.proj -o | sed -e 's/d/:/g' -e "s/'/:/g"  -e 's/"//g'
+m.proj -o ... | sed -e 's/d/:/g' -e "s/'/:/g"  -e 's/"//g'
 </pre></div>
 
+<h2>EXAMPLES</h2>
+
+The examples are suitable for the North Carolina sample dataset if not
+stated otherwise:
+
+<h3>Reproject vector point coordinate pairs to Long/Lat WGS84</h3>
+
 <p>
 The <em>m.proj</em> module is designed to work seamlessly with point
 data exported from the GIS
@@ -80,15 +85,21 @@
 following example shows.
 
 <div class="code"><pre>
-v.out.ascii bugsites | m.proj -o
+# Long/Lat WGS84 output in DMS
+v.out.ascii bridges | m.proj -o input=-
+
+# Long/Lat WGS84 output in decimal degree
+v.out.ascii bridges | m.proj -o input=-
 </pre></div>
 
-<p>
-To convert a WGS84 long/lat coordinate to the current map projection
-using the <b>-i</b> flag to set projection parameters automatically:
+<h3>Reproject Long/Lat WGS84 coordinate pair to current map projection</h3>
+
+To convert a Long/Lat WGS84 coordinate pair to the current map projection
+using the <b>-i</b> flag which sets the target projection parameters
+automatically from the current location definition:
 <div class="code"><pre>
-echo "170.510125 -45.868537" | m.proj -i input=-
-2316541.70|5479193.51|1.23
+echo "-78.61168178 33.92225767" | m.proj -i input=-
+645513.47|19180.31|0.00
 </pre></div>
 
 <p>
@@ -96,23 +107,31 @@
 continue on to import the results into a GRASS vector points map in
 the current map projection:
 <div class="code"><pre>
-m.proj -i in=waypoints.txt | cut -f1-2 -d'|' | v.in.ascii out=test_pt
-</pre></div>
+# check file content
+cat waypoints.txt 
+-78.43977824 33.89587173
+-78.54944691 33.88964566
+-78.51078074 33.88141495
+-77.14037951 35.60543020
 
-Here the standard UNIX <em>cut</em> tool is used to discard
-the <tt>z</tt> residual.
+# reproject points and generate vector map on the fly
+m.proj -i input=waypoints.txt | v.in.ascii input=- output=test_pnts 
 
-<p>
-To convert all coordinates from a vector points map in the current
-projection to WGS84 long/lat, with output in decimal form:
-<div class="code"><pre>
-v.out.ascii bugsites | m.proj -od input=-
+# verify result
+v.db.select test_pnts cat|dbl_1|dbl_2|dbl_3
+1|661427.74|16329.14|0
+2|651285.43|15586.79|0
+3|654867.21|14690.64|0
+4|778074.58|207402.6|0
 </pre></div>
 
-<p>
-To transform points from a UTM projection into the Gauss-Krüger
-Grid System, importing and exporting to files:
 
+<h3>Custom projection parameter usage</h3>
+
+To transform points from a UTM projection (here specified with detailed
+projection definition rather than using an EPSG code) into the
+Gauss-Krüger Grid System, importing from and exporting to files:
+
 <div class="code"><pre>
 m.proj proj_in="+proj=utm +name=utm +a=6378137.0 +es=0.006694380 \
     +zone=32 +unfact=1.0" proj_out="+proj=tmerc +name=tmerc \
@@ -186,9 +205,9 @@
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="g.proj.html">g.proj</a>,
+<a href="r.proj.html">r.proj</a>,
 <a href="v.proj.html">v.proj</a>,
-<a href="r.proj.html">r.proj</a>,
-<a href="g.proj.html">g.proj</a>,
 <a href="i.rectify.html">i.rectify</a>,
 <a href="v.in.ascii.html">v.in.ascii</a>,
 <a href="v.out.ascii.html">v.out.ascii</a>



More information about the grass-commit mailing list