Browse Source

r.import manual: example added; v.import manual: minor cleanup

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@66528 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 9 years ago
parent
commit
9dcfbfc6c2
3 changed files with 73 additions and 24 deletions
  1. 60 14
      scripts/r.import/r.import.html
  2. 2 0
      scripts/r.import/r.import.py
  3. 11 10
      scripts/v.import/v.import.html

+ 60 - 14
scripts/r.import/r.import.html

@@ -1,13 +1,16 @@
 <h2>DESCRIPTION</h2>
 <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>.
-
-<h4>Resolution</h4>
+<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>.
+
+<h2>NOTES</h2>
+
+<h3>Resolution</h3>
+
 <em>r.import</em> reports the estimated target resolution for each 
 <em>r.import</em> reports the estimated target resolution for each 
 input band. The estimated resolution will usually be some floating 
 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
 point number, e.g. 271.301. In case option <b>resolution</b> is set to
@@ -20,7 +23,15 @@ and option <b>resolution</b>=<em>value</em>.
 For latlong locations, the resolution might be set to arc seconds, e.g. 1, 3, 7.5, 
 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.
 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 
 <b>nearest</b> is the simplest method and the only possible method for 
 categorical data.
 categorical data.
 <p>
 <p>
@@ -39,21 +50,56 @@ Both <b>bicubic</b> and <b>lanczos</b> preserve linear features. With
 features after reprojection.
 features after reprojection.
 
 
 <p>
 <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>
 <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>
 <h2>SEE ALSO</h2>
 
 
 <em>
 <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>
 <a href="r.proj.html">r.proj</a>
 </em>
 </em>
 
 
 <h2>AUTHORS</h2>
 <h2>AUTHORS</h2>
 
 
 Markus Metz<br>
 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>

+ 2 - 0
scripts/r.import/r.import.py

@@ -356,6 +356,8 @@ def main():
     if group:
     if group:
         grass.run_command('i.group', group=output, input=','.join(outfiles))
         grass.run_command('i.group', group=output, input=','.join(outfiles))
 
 
+    # TODO: write metadata with r.support
+
     return 0
     return 0
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":

+ 11 - 10
scripts/v.import/v.import.html

@@ -7,17 +7,17 @@ into the current location. If the projection of the input does match
 the projection of the location, the input is imported directly with
 the projection of the location, the input is imported directly with
 <a href="v.in.ogr.html">v.in.ogr</a>.
 <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
 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
 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>
 <h2>EXAMPLE</h2>
 
 
@@ -33,9 +33,10 @@ v.import input=research_area.shp output=research_area extent=input
 <a href="v.proj.html">v.proj</a>
 <a href="v.proj.html">v.proj</a>
 </em>
 </em>
 
 
-<h2>AUTHOR</h2>
+<h2>AUTHORS</h2>
 
 
-Markus Metz
+Markus Metz<br>
+Improvements: Martin Landa, Anna Petrasova
 
 
 <p>
 <p>
 <i>Last changed: $Date: 2015-01-20 20:52:27 +0100 (Tue, 20 Jan 2015) $</i>
 <i>Last changed: $Date: 2015-01-20 20:52:27 +0100 (Tue, 20 Jan 2015) $</i>