[GRASS-SVN] r36564 - grass/branches/develbranch_6/raster/r.random
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 2 06:06:06 EDT 2009
Author: neteler
Date: 2009-04-02 06:06:06 -0400 (Thu, 02 Apr 2009)
New Revision: 36564
Modified:
grass/branches/develbranch_6/raster/r.random/description.html
grass/branches/develbranch_6/raster/r.random/local_proto.h
grass/branches/develbranch_6/raster/r.random/main.c
grass/branches/develbranch_6/raster/r.random/random.c
Log:
-b flag added to avoid vector topology
Modified: grass/branches/develbranch_6/raster/r.random/description.html
===================================================================
--- grass/branches/develbranch_6/raster/r.random/description.html 2009-04-02 07:08:59 UTC (rev 36563)
+++ grass/branches/develbranch_6/raster/r.random/description.html 2009-04-02 10:06:06 UTC (rev 36564)
@@ -6,7 +6,7 @@
determined. The program locates these randomly generated
vector points (sites) within the current geographic region and mask (if
any), on non-NULL category value data areas within a
-user-specified raster map layer. If the user sets the
+user-specified raster map layer. If the user sets the
<b>-z</b> flag, points will be randomly generated across all
cells (even those with NULL values).
@@ -37,6 +37,11 @@
the <em>cover</em> map.
<p>
+If the user sets the <b>-b</b> flag, vector points are written without
+topology to minimize the required resources. This is suitable input
+to <em>v.surf.rst</em> and other vector modules.
+
+<p>
The user may specify the quantity of random locations to be
generated either as a <em>positive integer</em> (e.g., 10),
or as a <em>percentage of the raster map layer's cells</em>
@@ -108,9 +113,12 @@
<h2>SEE ALSO</h2>
-<em><a href="g.region.html">g.region</a></em><br>
-<em><a href="r.reclass.html">r.reclass</a></em><br>
-<em><a href="v.random.html">v.random</a></em><br>
+<em>
+<a href="g.region.html">g.region</a><br>
+<a href="r.reclass.html">r.reclass</a><br>
+<a href="v.random.html">v.random</a><br>
+<a href="v.surf.rst.html">v.surf.rst</a>
+</em>
<h2>AUTHOR</h2>
Modified: grass/branches/develbranch_6/raster/r.random/local_proto.h
===================================================================
--- grass/branches/develbranch_6/raster/r.random/local_proto.h 2009-04-02 07:08:59 UTC (rev 36563)
+++ grass/branches/develbranch_6/raster/r.random/local_proto.h 2009-04-02 10:06:06 UTC (rev 36564)
@@ -29,6 +29,7 @@
struct RASTER_MAP_PTR nulls, cnulls, buf, cover, min, max, cmin, cmax;
FILE *fsites;
int z_geometry;
+ int notopol;
};
Modified: grass/branches/develbranch_6/raster/r.random/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.random/main.c 2009-04-02 07:08:59 UTC (rev 36563)
+++ grass/branches/develbranch_6/raster/r.random/main.c 2009-04-02 10:06:06 UTC (rev 36564)
@@ -42,7 +42,7 @@
} parm;
struct
{
- struct Flag *zero, *info, *z_geometry;
+ struct Flag *zero, *info, *z_geometry, *notopol_flag;
} flag;
G_gisinit(argv[0]);
@@ -89,6 +89,11 @@
flag.z_geometry->key = 'd';
flag.z_geometry->description = _("Generate vector points as 3D points");
+ flag.notopol_flag = G_define_flag();
+ flag.notopol_flag->key = 'b';
+ flag.notopol_flag->description = _("Do not build topology in points mode");
+ flag.notopol_flag->guisection = _("Points");
+
if (G_parser(argc, argv) != 0)
exit(EXIT_FAILURE);
@@ -107,6 +112,7 @@
myState.outraster = parm.raster->answer;
myState.outvector = parm.sites->answer;
myState.z_geometry = flag.z_geometry->answer;
+ myState.notopol = flag.notopol_flag->answer;
myState.mapset = G_find_cell(myState.inraster, "");
if (myState.mapset == NULL)
Modified: grass/branches/develbranch_6/raster/r.random/random.c
===================================================================
--- grass/branches/develbranch_6/raster/r.random/random.c 2009-04-02 07:08:59 UTC (rev 36563)
+++ grass/branches/develbranch_6/raster/r.random/random.c 2009-04-02 10:06:06 UTC (rev 36564)
@@ -252,7 +252,8 @@
if (theState->outvector) {
db_commit_transaction(driver);
db_close_database_shutdown_driver(driver);
- Vect_build(&Out);
+ if (theState->notopol != 1)
+ Vect_build(&Out);
Vect_close(&Out);
}
if (theState->outraster)
More information about the grass-commit
mailing list