Browse Source

r.tile: msg cosmetics; example fix

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@60989 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 years ago
parent
commit
fe201fb721
2 changed files with 9 additions and 6 deletions
  1. 5 3
      raster/r.tile/main.c
  2. 4 3
      raster/r.tile/r.tile.html

+ 5 - 3
raster/r.tile/main.c

@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
 {
     struct GModule *module;
     int infile;
-    size_t xtile_size, cell_size;
+    size_t cell_size;
     int ytile, xtile, y, overlap;
     int *outfiles;
     void *inbuf;
@@ -58,14 +58,14 @@ int main(int argc, char *argv[])
     parm.width->type = TYPE_INTEGER;
     parm.width->required = YES;
     parm.width->multiple = NO;
-    parm.width->description = _("Width of tiles");
+    parm.width->description = _("Width of tiles (columns)");
 
     parm.height = G_define_option();
     parm.height->key = "height";
     parm.height->type = TYPE_INTEGER;
     parm.height->required = YES;
     parm.height->multiple = NO;
-    parm.height->description = _("Height of tiles");
+    parm.height->description = _("Height of tiles (rows)");
 
     parm.overlap = G_define_option();
     parm.overlap->key = "overlap";
@@ -121,8 +121,10 @@ int main(int argc, char *argv[])
     G_debug(1, "X: %d * %d, Y: %d * %d",
 	    xtiles, dst_w.cols, ytiles, dst_w.rows);
 
+    G_message(_("Generating %d x %d = %d tiles..."), xtiles, ytiles, xtiles * ytiles);
     for (ytile = 0; ytile < ytiles; ytile++) {
 	G_debug(1, "reading y tile: %d", ytile);
+	G_percent(ytile, ytiles, 2);
 	for (xtile = 0; xtile < xtiles; xtile++) {
 	    char name[GNAME_MAX];
 	    sprintf(name, "%s-%03d-%03d", parm.rastout->answer, ytile, xtile);

+ 4 - 3
raster/r.tile/r.tile.html

@@ -21,11 +21,12 @@ g.region rast=elevation -p
 # rows:       1350
 # cols:       1500
 
-r.tile input=elevation output=elev_tile width=135 height=150
+# generating 2 x 2 = 4 tiles (width=1500/2, height=rows/2)
+r.tile input=elevation output=elev_tile width=750 height=675
 </pre></div>
 
-creates 108 tiles with the prefix <em>elev_tile</em> (named:
-elev_tile-000-000, elev_tile-000-001, elev_tile-000-002, ...).
+creates 4 tiles with the prefix <em>elev_tile</em> (named:
+elev_tile-000-000, elev_tile-000-001, elev_tile-001-000, ...).
 
 <h2>SEE ALSO</h2>