[GRASS-SVN] r66529 - in grass/branches/releasebranch_7_0/scripts: r.import v.import

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 19 12:48:52 PDT 2015


Author: neteler
Date: 2015-10-19 12:48:52 -0700 (Mon, 19 Oct 2015)
New Revision: 66529

Modified:
   grass/branches/releasebranch_7_0/scripts/r.import/r.import.html
   grass/branches/releasebranch_7_0/scripts/r.import/r.import.py
   grass/branches/releasebranch_7_0/scripts/v.import/v.import.html
Log:
r.import manual: example added; v.import manual: minor cleanup (trunk, r66528)

Modified: grass/branches/releasebranch_7_0/scripts/r.import/r.import.html
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.import/r.import.html	2015-10-19 19:47:53 UTC (rev 66528)
+++ grass/branches/releasebranch_7_0/scripts/r.import/r.import.html	2015-10-19 19:48:52 UTC (rev 66529)
@@ -1,13 +1,16 @@
 <h2>DESCRIPTION</h2>
 
-<em>r.import</em> imports selected bands from a GDAL raster datasouce 
-into the current location and mapset. If the projection of the input 
-does not match the projection of the location, the input is reprojected 
-into the current location. If the projection of the input does match 
-the projection of the location, the input is imported directly with <a 
-href="r.in.gdal.html">r.in.gdal</a>.
+<em>r.import</em> imports a map or selected bands from a GDAL raster datasource
+into the current location and mapset. If the projection of the input
+does not match the projection of the location, the input is reprojected
+into the current location. If the projection of the input does match
+the projection of the location, the input is imported directly with
+<a href="r.in.gdal.html">r.in.gdal</a>.
 
-<h4>Resolution</h4>
+<h2>NOTES</h2>
+
+<h3>Resolution</h3>
+
 <em>r.import</em> reports the estimated target resolution for each 
 input band. The estimated resolution will usually be some floating 
 point number, e.g. 271.301. In case option <b>resolution</b> is set to
@@ -20,7 +23,15 @@
 For latlong locations, the resolution might be set to arc seconds, e.g. 1, 3, 7.5, 
 15, and 30 arc seconds are commonly used resolutions.
 
-<h4>Resampling methods</h4>
+<h3>Resampling methods</h3>
+
+When reprojecting a map to a new spatial reference system, the projected
+data is resampled with one of four different methods: nearest neighbor,
+bilinear, bicubic iterpolation or lanczos.
+
+<p>
+In the following common use cases:
+<p>
 <b>nearest</b> is the simplest method and the only possible method for 
 categorical data.
 <p>
@@ -39,21 +50,56 @@
 features after reprojection.
 
 <p>
-For explanation of <b>-l</b> flag, please refer to <a href="r.in.gdal.html">r.in.gdal</a> manual.
+For explanation of the <b>-l</b> flag, please refer to the
+<a href="r.in.gdal.html">r.in.gdal</a> manual.
+<p>
+When importing whole-world maps the user should disable map-trimming with
+the <b>-n</b> flag. For further explanations of <b>-n</b> flag, please refer
+the to <a href="r.proj.html">r.proj</a> manual.
 
+<h2>EXAMPLE</h2>
+
+Import of a subset from <a href="">Bioclim data set</a>, to be reprojected
+to current location projection (North Carolina sample dataset). While normally
+the full raster map is imported, we spatially subset using the <em>extent</em>
+parameter:
+
+<div class="code"><pre>
+# download selected Bioclim data
+wget http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip
+
+# extract BIO1 from package:
+unzip bio_2-5m_bil.zip bio1.bil bio1.hdr
+
+# set computational region to North Carolina, 4000 m target pixel resolution
+g.region -d res=4000 -ap
+
+# subset to current region and reproject on the fly to current location projection,
+# using -n since whole-world map is imported:
+r.import input=bio1.bil output=bioclim01 resample=bilinear \
+         extent=region resolution=region -n
+
+r.info bioclim01
+r.univar -e bioclim01
+</pre></div>
+
 <h2>KNOWN ISSUES</h2>
-Option <b>extent</b>=<em>region</em> works only when dataset has different
-projection than current location (<a href="r.proj.html">r.proj</a> is then used).
 
+The option <b>extent</b>=<em>region</em> only works when the dataset has a
+different projection than the current location (i.e., internally
+<a href="r.proj.html">r.proj</a> is invoked).
+
 <h2>SEE ALSO</h2>
 
 <em>
-<a href="r.in.gdal.html">r.in.gdal</a>,<br>
+<a href="r.in.gdal.html">r.in.gdal</a>,
 <a href="r.proj.html">r.proj</a>
 </em>
 
 <h2>AUTHORS</h2>
 
 Markus Metz<br>
+Improvements: Martin Landa, Anna Petrasova
 
-<p><i>Last changed: $Date: 2015-01-20 20:52:27 +0100 (Tue, 20 Jan 2015) $</i>
+<p>
+<i>Last changed: $Date: 2015-01-20 20:52:27 +0100 (Tue, 20 Jan 2015) $</i>

Modified: grass/branches/releasebranch_7_0/scripts/r.import/r.import.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.import/r.import.py	2015-10-19 19:47:53 UTC (rev 66528)
+++ grass/branches/releasebranch_7_0/scripts/r.import/r.import.py	2015-10-19 19:48:52 UTC (rev 66529)
@@ -356,6 +356,8 @@
     if group:
         grass.run_command('i.group', group=output, input=','.join(outfiles))
 
+    # TODO: write metadata with r.support
+
     return 0
 
 if __name__ == "__main__":

Modified: grass/branches/releasebranch_7_0/scripts/v.import/v.import.html
===================================================================
--- grass/branches/releasebranch_7_0/scripts/v.import/v.import.html	2015-10-19 19:47:53 UTC (rev 66528)
+++ grass/branches/releasebranch_7_0/scripts/v.import/v.import.html	2015-10-19 19:48:52 UTC (rev 66529)
@@ -7,18 +7,18 @@
 the projection of the location, the input is imported directly with
 <a href="v.in.ogr.html">v.in.ogr</a>.
 
-<h4>Topology cleaning</h4>
+<h2>NOTES</h2>
 
+<h3>Topology cleaning</h3>
+
 When importing polygons, non-topological polygons are converted to
-topological areas. If the original polygons contain errors (unexpected
+topological areas. By default, a very small snapping threshold is applied
+(1e-13 map units) to avoid topological errors caused by numerical inaccuracy
+of the input data format. If the original polygons contain errors (unexpected
 overlapping areas or small gaps between polygons), the import might
-need to be repeated using the <em>snap</em> option for
-<a href="v.in.ogr.html">v.in.ogr</a>. In this case, automated import and
-reprojection does not work, and the data need to be manually imported
-first with appropriate settings and optionally cleaned afterwards with
-<a href="v.clean.html">v.clean</a>. The cleaned import can then be
-manually reprojected to the target location.
+need to be repeated using a larger <em>snap</em> value.
 
+
 <h2>EXAMPLE</h2>
 
 <div class="code"><pre>
@@ -33,9 +33,10 @@
 <a href="v.proj.html">v.proj</a>
 </em>
 
-<h2>AUTHOR</h2>
+<h2>AUTHORS</h2>
 
-Markus Metz
+Markus Metz<br>
+Improvements: Martin Landa, Anna Petrasova
 
 <p>
 <i>Last changed: $Date: 2015-01-20 20:52:27 +0100 (Tue, 20 Jan 2015) $</i>



More information about the grass-commit mailing list