[GRASS-SVN] r41126 - grass/trunk/raster/r.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 20 02:41:42 EST 2010


Author: hamish
Date: 2010-02-20 02:41:41 -0500 (Sat, 20 Feb 2010)
New Revision: 41126

Modified:
   grass/trunk/raster/r.proj/main.c
   grass/trunk/raster/r.proj/r.proj.html
Log:
sync text with devbr65, add -g example

Modified: grass/trunk/raster/r.proj/main.c
===================================================================
--- grass/trunk/raster/r.proj/main.c	2010-02-20 07:17:14 UTC (rev 41125)
+++ grass/trunk/raster/r.proj/main.c	2010-02-20 07:41:41 UTC (rev 41126)
@@ -208,7 +208,7 @@
     gprint_bounds = G_define_flag();
     gprint_bounds->key = 'g';
     gprint_bounds->description =
-	_("Print bounds and exit (shell style)");
+	_("Print input map's bounds in the current projection and exit (shell style)");
 
 
     /* The parser checks if the map already exists in current mapset,

Modified: grass/trunk/raster/r.proj/r.proj.html
===================================================================
--- grass/trunk/raster/r.proj/r.proj.html	2010-02-20 07:17:14 UTC (rev 41125)
+++ grass/trunk/raster/r.proj/r.proj.html	2010-02-20 07:41:41 UTC (rev 41126)
@@ -137,11 +137,23 @@
 <em>PROJ.4</em> co-ordinate system translation library.
 </p>
 
+
 <h2>NOTES</h2>
 
 To avoid excessive time consumption when reprojecting a map the region and 
 resolution of the target location should be set appropriately beforehand.
-A simple way to do this is to generate a vector "box" map of the region in  
+
+<p>
+A simple way to do this is to check the projected bounds of the input map
+inthe current location's projection using the <b>-p</b> flag. The  <b>-g</b>
+flag reports the same thing, but in a form which can be directly cut and
+pasted into a <em>g.region</em> command. After setting the region in that
+way you might check the cell resolution with "<em>g.region -p</em>" then
+snap it to a regular grid with <em>g.region</em>'s -a flag. E.g.
+<tt>g.region&nbsp;-a&nbsp;res=5 -p</tt>.
+
+<p>
+A more involved way to do this is to generate a vector "box" map of the region in
 the source location using <em><a href="v.in.region.html">v.in.region</a></em>.
 This "box" map is then reprojected into the target location with
 <em><a href="v.proj.html">v.proj</a></em>.
@@ -158,10 +170,68 @@
 impossible) to find in projections other than latitude-longitude so results
 may be odd with trimming.
 
+
 <h2>EXAMPLES</h2>
 
+<h4>Inline method</h4>
+With GRASS running in the destination location use the <b>-g</b> flag to
+show the input map's bounds once projected into the current working projection,
+then use that to set the region bounds before performing the reprojection:
+
 <div class="code"><pre>
+# calculate where output map will be
+GRASS> r.proj in=elevation location=ll_wgs84 mapset=user1 -p
+Source cols: 8162
+Source rows: 12277
+Local north: -4265502.30382993
+Local south: -4473453.15255565
+Local west: 14271663.19157564
+Local east: 14409956.2693866
 
+# same calculation, but in a form which can be cut and pasted into a g.region call
+GRASS> r.proj in=elevation location=ll_wgs84 mapset=user1 -g
+n=-4265502.30382993 s=-4473453.15255565 w=14271663.19157564 e=14409956.2693866 rows=12277 cols=8162
+
+GRASS> g.region n=-4265502.30382993 s=-4473453.15255565 \
+  w=14271663.19157564 e=14409956.2693866 rows=12277 cols=8162 -p
+projection: 99 (Mercator)
+zone:       0
+datum:      wgs84
+ellipsoid:  wgs84
+north:      -4265502.30382993
+south:      -4473453.15255565
+west:       14271663.19157564
+east:       14409956.2693866
+nsres:      16.93824621
+ewres:      16.94352828
+rows:       12277
+cols:       8162
+cells:      100204874
+
+# round resolution to something cleaner
+GRASS> g.region res=17 -a -p
+projection: 99 (Mercator)
+zone:       0
+datum:      wgs84
+ellipsoid:  wgs84
+north:      -4265487
+south:      -4473465
+west:       14271653
+east:       14409965
+nsres:      17
+ewres:      17
+rows:       12234
+cols:       8136
+cells:      99535824
+
+# finally, perform the reprojection
+GRASS> r.proj in=elevation location=ll_wgs84 mapset=user1 memory=800
+</pre></div>
+
+
+<h4>v.in.region method</h4>
+<div class="code"><pre>
+
 # In the source location, use v.in.region to generate a bounding box around the
 # region of interest:
 
@@ -187,23 +257,26 @@
 
 <h2>REFERENCES</h2>
 
-[1] Evenden, G.I.  (1990) <a href="http://proj.maptools.org/">Cartographic projection procedures for
-the UNIX environment - a user's manual.</a>  USGS Open-File Report 90-284 (OF90-284.pdf)
+[1] Evenden, G.I.  (1990) <a href="http://proj.osgeo.org">Cartographic
+projection procedures for the UNIX environment - a user's manual.</a>
+USGS Open-File Report 90-284 (OF90-284.pdf)
 See also there: Interim Report and 2nd Interim Report on Release 4, Evenden 1994).
 <p>
 Richards, John A. (1993), Remote Sensing Digital Image Analysis,
 Springer-Verlag, Berlin, 2nd edition. 
 <p>
-<a href="http://proj.maptools.org/">PROJ.4</a>: Projection/datum support library.
+<a href="http://proj.osgeo.org">PROJ.4</a>: Projection/datum support library.
 <p>
 <b>Further reading</b>
 <ul>
 <li> <a href="http://www.asprs.org/resources/grids/">ASPRS Grids and Datum</a>
 <li> <a href="http://www.remotesensing.org/geotiff/proj_list/">Projections Transform List</a> (PROJ.4)
-<li> <a href="http://www.mapref.org">MapRef - The Collection of Map Projections and Reference Systems for Europe</a> 
+<li> <a href="http://www.mapref.org">MapRef -
+     The Collection of Map Projections and Reference Systems for Europe</a> 
 <li> <a href="http://www.crs-geo.eu">Information and Service System for European Coordinate Reference Systems - CRS</a>
 </ul>
 
+
 <h2>SEE ALSO</h2>
 
 <em>
@@ -220,6 +293,7 @@
 The 'gdalwarp' and 'gdal_translate' utilities are available from the 
 <a href="http://www.gdal.org">GDAL</a> project.
 
+
 <h2>AUTHORS</h2>
 
 Martin Schroeder, University of Heidelberg, Germany<p>
@@ -229,4 +303,5 @@
 <p>
 Datum tranformation support and cleanup by Paul Kelly
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>



More information about the grass-commit mailing list