Browse Source

cleanup of unused r.digit

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62517 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 năm trước cách đây
mục cha
commit
f18c4d1d61

+ 12 - 16
imagery/i.gensig/i.gensig.html

@@ -34,7 +34,9 @@ raster digitizer. Of course other methods could be devised by the user
 for creating this training map - <em>i.gensig</em> makes no assumption
 about the origin of this map layer. It simply creates signatures for
 the classes defined in the training map for the image to be classified
-(the image is specified in other options - see below).
+(the image is specified in other options - see below). The
+<em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em> can be
+used for interactively creating the training map.
 
 <dt><b>group=</b><em>name</em> 
 <dd>imagery group
@@ -100,6 +102,7 @@ SIG file "lsat7_2000_gensig":
  9 0.561184 2.30762 5.18846 20.5364 20.4926 
 10 0.393218 1.2184 2.63628 9.61528 9.36025 5.85314 
 </pre></div>
+
 <ul>
 <li> Line 2: text label
 <li> Line 3: number of points in class
@@ -109,21 +112,14 @@ SIG file "lsat7_2000_gensig":
 
 <h2>SEE ALSO</h2>
 
-<em><a href="i.group.html">i.group</a></em>
-for creating groups and subgroups.
-<p>
-<em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em>
-and
-<em><a href="r.digit.html">r.digit</a></em>
-for interactively  creating the training map.
-<p>
-<em><a href="i.cluster.html">i.cluster</a></em>
-for unsupervised clustering as an alternative to 
-<em>i.gensig</em> to create signatures.
-<p>
-<em><a href="g.gui.iclass.html">g.gui.iclass</a></em>
-for a graphic/interactive as an alternative to 
-<em>i.gensig</em> to create signatures.
+<em>
+<a href="g.gui.iclass.html">g.gui.iclass</a>,
+<a href="i.group.html">i.group</a>,
+<a href="i.smap.html">i.smap</a>,
+<a href="r.info.html">r.info</a>,
+<a href="r.univar.html">r.univar</a>,
+<a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>
+</em>
 
 <h2>AUTHOR</h2>
 

+ 5 - 12
imagery/i.gensigset/i.gensigset.html

@@ -13,7 +13,6 @@ classification of the pixels in the training map and make
 these signatures available to
 <em><a href="i.smap.html">i.smap</a>.</em>
 
-
 <p>
 The user would then execute the GRASS program <em>
 <a href="i.smap.html">i.smap</a></em> to create the
@@ -37,20 +36,14 @@ the pixel has a non-zero value and unclassified means that
 the pixel has a zero value.
 
 <p>
-This map must be prepared by the user in advance.
-The user must use
-
-<em><a href="r.digit.html">r.digit</a></em>,
-
+This map must be prepared by the user in advance by using
 a combination of
 <em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em>
 and 
 <em><a href="v.to.rast.html">v.to.rast</a></em>,
 or some other import/developement process (e.g.,
 <em><a href="v.in.transects.html">v.in.transects</a>)</em>
-to define the areas
-representative
-of the classes in the image.
+to define the areas representative of the classes in the image.
 
 <p>
 At present, there is no fully-interactive tool specifically
@@ -211,13 +204,13 @@ then the user should check for:
 <ul>
 <li><A NAME="rissanen83">J. Rissanen,</a>
 "A Universal Prior for Integers and Estimation by Minimum Description Length,"
-<em>Annals of Statistics,</em> vol. 11, no. 2, pp. 417-431, 1983.
+<em>Annals of Statistics,</em> vol. 11, no. 2, pp. 417-431, 1983.</li>
 <li><A NAME="dempster77">A. Dempster, N. Laird and D. Rubin,</a>
 "Maximum Likelihood from Incomplete Data via the EM Algorithm,"
-<em>J. Roy. Statist. Soc. B,</em> vol. 39, no. 1, pp. 1-38, 1977.
+<em>J. Roy. Statist. Soc. B,</em> vol. 39, no. 1, pp. 1-38, 1977.</li>
 <li><A NAME="redner84">E. Redner and H. Walker,</a>
 "Mixture Densities, Maximum Likelihood and the EM Algorithm,"
-<em>SIAM Review,</em> vol. 26, no. 2, April 1984.
+<em>SIAM Review,</em> vol. 26, no. 2, April 1984.</li>
 </ul>
 
 <h2>SEE ALSO</h2>

+ 36 - 34
imagery/i.ifft/i.ifft.html

@@ -7,43 +7,45 @@ images (produced by
 
 <h2>NOTES</h2>
 
-The current mask is respected when reading the real and
-imaginary component files;  thus, creating a mask is a 
-primary step for
-selecting the portion of the frequency space data to be included in the
-inverse transform.  The GRASS program <em>r.digit</em> can be used to create
-masks while viewing the real or imaginary component image. Alternatively
-<em>r.circle</em> can be used to generate high-, low- and donut filters
-specifying the DC point as circle/ring center.
-When <em>i.ifft</em> is executed, it (automatically) uses the same GRASS
-region definition setting that was used during the original transformation
-done with <em><a href="i.fft.html">i.fft</a></em>.
+The current mask is respected when reading the real and imaginary 
+component files;  thus, creating a mask is a primary step for selecting 
+the portion of the frequency space data to be included in the inverse 
+transform.  The module <em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em>
+can be used to create masks while viewing the real 
+or imaginary component image. Alternatively <em>r.circle</em> can be 
+used to generate high-, low- and donut filters specifying the DC point 
+as circle/ring center. When <em>i.ifft</em> is executed, it 
+(automatically) uses the same GRASS region definition setting that was 
+used during the original transformation done with
+<em><a href="i.fft.html">i.fft</a></em>.
+
 
 <h2>SEE ALSO</h2>
 
-M. Frigo and S. G. Johnson (1998): "FFTW: An Adaptive Software Architecture
-for the FFT". See <a href="http://www.fftw.org/">www.fftw.org</a>: FFTW is a C subroutine library
-for computing the Discrete Fourier Transform (DFT) in one or more
-dimensions, of both real and complex data, and of arbitrary input size.
-
-<p>
-<b>Remote Sensing Digital Image Analysis</b>,
-by John A. Richards,
-Springer-Verlag, 1986.
-
-<p>
-Personal communication,
-between program author and Ali R. Vali, Space Research Center,
-University of Texas, Austin, 1990.
-
-<p>
-<em><a href="i.cca.html">i.cca</a></em>, 
-<em><a href="g.gui.iclass.html">g.gui.iclass</a></em>, 
-<em><a href="i.fft.html">i.fft</a></em>, 
-<em><a href="i.pca.html">i.pca</a></em>, 
-<em><a href="r.circle.html">r.circle</a></em>
-
-<h2>AUTHOR</h2>
+<em>
+<a href="i.cca.html">i.cca</a>,
+<a href="g.gui.iclass.html">g.gui.iclass</a>,
+<a href="i.fft.html">i.fft</a>,
+<a href="i.pca.html">i.pca</a>,
+<a href="r.circle.html">r.circle</a>,
+<a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>
+</em>
+
+<h2>REFERENCES</h2>
+
+<ul>
+<li> M. Frigo and S. G. Johnson (1998): "FFTW: An Adaptive Software 
+Architecture for the FFT". See <a href="http://www.fftw.org/">www.fftw.org</a>:
+FFTW is a C subroutine library for computing the Discrete Fourier 
+Transform (DFT) in one or more dimensions, of both real and complex 
+data, and of arbitrary input size.</li>
+<li> Richards, J.A (1986): <b>Remote Sensing Digital Image 
+Analysis</b>, Springer-Verlag, 1986.</li>
+<li> Personal communication, between program author and Ali R. Vali, 
+Space Research Center, University of Texas, Austin, 1990.</li>
+</ul>
+	
+<h2>AUTHORS</h2>
 
 David Satnik, GIS Laboratory, 
 Central Washington University

+ 0 - 10
raster/r.digit/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = r.digit
-
-LIBES = $(DISPLAYLIB) $(GISLIB)
-DEPENDENCIES = $(DISPLAYDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 4
raster/r.digit/TODO

@@ -1,4 +0,0 @@
-
-NULL not supported yet. Writes 0 to background.
-
-The initialization seems to be wrong.

+ 0 - 42
raster/r.digit/bnw_line.c

@@ -1,42 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <stdlib.h>
-#include <grass/display.h>
-
-
-int
-black_and_white_line(int screen_x, int screen_y, int cur_screen_x,
-		     int cur_screen_y)
-{
-    R_standard_color(D_translate_color("white"));
-    R_move_abs(cur_screen_x, cur_screen_y);
-    R_cont_abs(screen_x, screen_y);
-    R_standard_color(D_translate_color("black"));
-    if (abs(screen_y - cur_screen_y) <= abs(screen_x - cur_screen_x)) {
-	R_move_abs(cur_screen_x, cur_screen_y - 1);
-	R_cont_abs(screen_x, screen_y - 1);
-    }
-    else {
-	R_move_abs(cur_screen_x + 1, cur_screen_y);
-	R_cont_abs(screen_x + 1, screen_y);
-    }
-
-    return 0;
-}

+ 0 - 31
raster/r.digit/create_map.c

@@ -1,31 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-
-int create_map(char *name, char *polyfile)
-{
-    char buf[1024];
-
-    sprintf(buf, "r.in.poly rows=512 i=\"%s\" o=\"%s\"", polyfile, name);
-    fprintf(stdout, "Creating raster map %s\n", name);
-    return system(buf);
-}

+ 0 - 53
raster/r.digit/digitize.c

@@ -1,53 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <grass/gis.h>
-#include <grass/glocale.h>
-#include "local_proto.h"
-
-
-int digitize(FILE * fd)
-{
-    int any;
-    struct Categories labels;
-
-    Rast_init_cats((CELL) 0, "", &labels);
-    any = 0;
-    for (;;) {
-	switch (get_type()) {
-	case 'A':		/* area */
-	    if (get_area(fd, &labels))
-		any = 1;
-	    break;
-	case 'C':		/* circle */
-	    if (get_circle(fd, &labels))
-		any = 1;
-	    break;
-	case 'L':		/* line */
-	    if (get_line(fd, &labels))
-		any = 1;
-	    break;
-	case 'X':		/* done */
-	    return any;
-	case 'Q':		/* exit without saving */
-	    if (G_yes(_("Quit without creating a map?? "), 0))
-		return 0;
-	}
-    }
-}

+ 0 - 56
raster/r.digit/get_area.c

@@ -1,56 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-
-int get_area(FILE * fd, struct Categories *labels)
-{
-    int x, y;
-    int px, py;
-    int x0, y0;
-    int any;
-    char east[256], north[256];
-
-    instructions(0);
-    x = y = -9999;
-    any = 0;
-    while (get_point(&x, &y, east, north)) {
-	if (!any) {
-	    fprintf(fd, "AREA\n");
-	    any = 1;
-	    x0 = x;
-	    y0 = y;
-	}
-	else {
-	    black_and_white_line(px, py, x, y);
-	    R_flush();
-	}
-	px = x;
-	py = y;
-	fprintf(fd, " %s %s\n", east, north);
-    }
-    black_and_white_line(x0, y0, x, y);
-    R_flush();
-    get_category(fd, "area", labels);
-
-    return any;
-}

+ 0 - 141
raster/r.digit/get_circle.c

@@ -1,141 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-
-static int first;
-static int prevx, prevy;
-
-
-int get_circle(FILE * fd, struct Categories *labels)
-{
-    static struct point		/* used to build 1/4 arc of the circle */
-    {
-	int x, y;
-    } *points = NULL;
-
-    char east[128], north[128];
-
-    int cx, cy, px, py;
-    int radius;
-    int i, count;
-    double r2, atx, aty;
-
-    fprintf(stdout, "Mark the center of the circle\n");
-    instructions(0);
-    instructions(1);
-
-    cx = cy = -9999;
-    if (!get_point(&cx, &cy, east, north))
-	return 0;
-
-    px = cx;
-    py = cy;
-    first = 1;
-    do {
-	fprintf(stdout, "Mark a point on the perimeter\n");
-	if (first)
-	    instructions(0);
-	instructions(1);
-	first = 0;
-
-	if (!get_point(&px, &py, east, north))
-	    return 0;
-
-	radius = (int)(hypot((double)(cx - px), (double)(cy - py)) + 0.5);
-	if (radius <= 0) {
-	    fprintf(stdout, "Circle too small\n");
-	    instructions(1);
-	}
-    }
-    while (radius <= 0);
-
-    r2 = (double)radius *radius;
-
-    points = (struct point *)G_realloc(points, sizeof(*points) * radius + 1);
-
-    count = 0;
-    for (atx = (double)radius, aty = 0.0; atx >= aty; /*empty */ ) {
-	points[count].x = (int)(atx + 0.5);
-	points[count].y = (int)(aty + 0.5);
-	count++;
-	aty += 1.0;
-	atx = sqrt(r2 - aty * aty);
-    }
-
-    first = 1;
-    fprintf(fd, "AREA (circle)\n");
-
-    /* 0 to 45 degrees */
-    for (i = 0; i < count; i++)
-	draw_and_record(fd, points[i].x, points[i].y, cx, cy);
-
-    /* 45 to 90 degrees */
-    for (i = count - 1; i >= 0; i--)
-	draw_and_record(fd, points[i].y, points[i].x, cx, cy);
-
-    /* 90 to 135 degrees */
-    for (i = 0; i < count; i++)
-	draw_and_record(fd, -points[i].y, points[i].x, cx, cy);
-
-    /* 135 to 180 degrees */
-    for (i = count - 1; i >= 0; i--)
-	draw_and_record(fd, -points[i].x, points[i].y, cx, cy);
-
-    /* 180 to 225 degrees */
-    for (i = 0; i < count; i++)
-	draw_and_record(fd, -points[i].x, -points[i].y, cx, cy);
-
-    /* 225 to 270 degrees */
-    for (i = count - 1; i >= 0; i--)
-	draw_and_record(fd, -points[i].y, -points[i].x, cx, cy);
-
-    /* 270 to 315 degrees */
-    for (i = 0; i < count; i++)
-	draw_and_record(fd, points[i].y, -points[i].x, cx, cy);
-
-    /* 315 to 360 degrees */
-    for (i = count - 1; i >= 0; i--)
-	draw_and_record(fd, points[i].x, -points[i].y, cx, cy);
-
-    R_flush();
-
-    get_category(fd, "circle", labels);
-    return 1;
-}
-
-int draw_and_record(FILE * fd, int x, int y, int cx, int cy)
-{
-    char east[128], north[128];
-
-    x += cx;
-    y += cy;
-    get_east_north(x, y, east, north);
-    fprintf(fd, " %s %s\n", east, north);
-    if (!first)
-	black_and_white_line(prevx, prevy, x, y);
-    first = 0;
-    prevx = x;
-    prevy = y;
-    return 0;
-}

+ 0 - 32
raster/r.digit/get_en.c

@@ -1,32 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <grass/gis.h>
-
-
-int get_east_north(int x, int y, char *east, char *north)
-{
-    double e, n;
-
-    G_plot_where_en(x, y, &e, &n);
-    G_format_easting(e, east, G_projection());
-    G_format_northing(n, north, G_projection());
-
-    return 0;
-}

+ 0 - 74
raster/r.digit/get_label.c

@@ -1,74 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-
-
-long get_cat(char *type)
-{
-    char buffer[256];
-    long cat;
-
-    for (;;) {
-	fprintf(stdout, _("Enter the category number for this %s: "), type);
-	if (!G_gets(buffer))
-	    continue;;
-	if (sscanf(buffer, "%ld", &cat) != 1)
-	    continue;
-	break;
-    }
-    return cat;
-}
-
-char *get_label(long cat, struct Categories *labels)
-{
-    static char buffer[1024];
-
-    for (;;) {
-	fprintf(stdout, _("Enter a label for category %ld [%s] "),
-		cat, Rast_get_c_cat((CELL *) &cat, labels));
-	if (!G_gets(buffer))
-	    continue;;
-	G_strip(buffer);
-	break;
-    }
-    return buffer;
-}
-
-int get_category(FILE * fd, char *type, struct Categories *labels)
-{
-    long cat;
-    char *lbl;
-
-    R_stabilize();		/* force out all graphics */
-    do {
-	fprintf(stdout, "\n");
-	cat = get_cat(type);
-	lbl = get_label(cat, labels);
-	fprintf(stdout, "%ld [%s]\n", cat,
-		*lbl ? lbl : Rast_get_c_cat((CELL) cat, labels));
-    } while (!G_yes(_("Look ok? "), 1));
-    if (*lbl)
-      Rast_set_c_cat((CELL *) &cat, (CELL *) &cat, lbl, labels);
-
-    fprintf(fd, "= %ld %s\n", cat, lbl);
-    return (0);
-}

+ 0 - 50
raster/r.digit/get_line.c

@@ -1,50 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-
-int get_line(FILE * fd, struct Categories *labels)
-{
-    int x, y;
-    int px = 0, py = 0;
-    int any;
-    char east[256], north[256];
-
-    instructions(0);
-    x = y = -9999;
-    any = 0;
-    while (get_point(&x, &y, east, north)) {
-	if (!any) {
-	    fprintf(fd, "LINE\n");
-	    any = 1;
-	}
-	else {
-	    black_and_white_line(px, py, x, y);
-	    R_flush();
-	}
-	px = x;
-	py = y;
-	fprintf(fd, " %s %s\n", east, north);
-    }
-    get_category(fd, "line", labels);
-    return any;
-}

+ 0 - 56
raster/r.digit/get_point.c

@@ -1,56 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <grass/display.h>
-#include "local_proto.h"
-
-
-/* button 1 is whereami: no return, keep looping
- *        2 is mark point, return 1 (ok)
- *        3 is done, return 0 (done)
- */
-
-int get_point(int *x, int *y, char *east, char *north)
-{
-    int button;
-    int curx, cury;
-
-    curx = *x;
-    cury = *y;
-    do {
-	if (curx >= 0 && cury >= 0)
-	    R_get_location_with_line(curx, cury, &curx, &cury, &button);
-	else
-	    R_get_location_with_pointer(&curx, &cury, &button);
-
-	if (button == 3)
-	    return (0);
-
-	get_east_north(curx, cury, east, north);
-	fprintf(stdout, "EAST:  %-20s", east);
-	fprintf(stdout, "NORTH: %s\n", north);
-	instructions(1);
-
-    } while (button == 1);
-
-    *x = curx;
-    *y = cury;
-    return (1);
-}

+ 0 - 58
raster/r.digit/get_type.c

@@ -1,58 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <grass/gis.h>
-#include <grass/glocale.h>
-
-
-int get_type(void)
-{
-    char buffer[256];
-
-    for (;;) {
-	G_clear_screen();
-	fprintf(stdout, _("Please choose one of the following\n"));
-	fprintf(stdout, _("   A define an area\n"));
-	fprintf(stdout, _("   C define a circle\n"));
-	fprintf(stdout, _("   L define a line\n"));
-	fprintf(stdout, _("   X exit (and create map)\n"));
-	fprintf(stdout, _("   Q quit (without creating map)\n"));
-	fprintf(stdout, "> ");
-	if (!G_gets(buffer))
-	    continue;
-	switch (buffer[0] & 0177) {
-	case 'l':
-	case 'L':
-	    return ('L');
-	case 'a':
-	case 'A':
-	    return ('A');
-	case 'c':
-	case 'C':
-	    return ('C');
-	case 'q':
-	case 'Q':
-	    return ('Q');
-	case 'x':
-	case 'X':
-	    return ('X');
-	}
-    }
-}

+ 0 - 48
raster/r.digit/instruct.c

@@ -1,48 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <stdio.h>
-#include "local_proto.h"
-
-
-#define MAXLINES 18
-#define TITLE (char *) 0
-
-static char *Title = TITLE;
-
-static int nlines = 0;
-
-
-int instructions(int n)
-{
-    if (n == 0)
-	nlines = MAXLINES;
-    if (nlines >= MAXLINES) {
-	if (Title)
-	    fprintf(stdout, "%s\n", Title);
-	fprintf(stdout, " Buttons:\n");
-	fprintf(stdout, "  Left:   where am i\n");
-	fprintf(stdout, "  Middle: mark point\n");
-	fprintf(stdout, "  Right:  done\n\n");
-	nlines = 0;
-    }
-    nlines += n;
-
-    return 0;
-}

+ 0 - 70
raster/r.digit/local_proto.h

@@ -1,70 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#ifndef LOCAL_PROTO_H
-#define	LOCAL_PROTO_H
-
-/* bnw_line.c */
-int black_and_white_line(int, int, int, int);
-
-/* create_map.c */
-int create_map(char *, char *);
-
-/* digitize.c */
-int digitize(FILE *);
-
-/* get_en.c */
-int get_east_north(int, int, char *, char *);
-
-/* get_point.c */
-int get_point(int *, int *, char *, char *);
-
-/* get_type.c */
-int get_type(void);
-
-/* instruct.c */
-int instructions(int);
-int reset_instructions(void);
-int left_button(char *);
-int middle_button(char *);
-int right_button(char *);
-
-/* setup_graph.c */
-int move(int, int);
-int cont(int, int);
-int setup_graphics(void);
-
-#ifdef GRASS_GIS_H
-/* get_area.c */
-int get_area(FILE *, struct Categories *);
-
-/* get_circle.c */
-int get_circle(FILE *, struct Categories *);
-int draw_and_record(FILE *, int, int, int, int);
-
-/* get_label.c */
-long get_cat(char *);
-char *get_label(long, struct Categories *);
-int get_category(FILE *, char *, struct Categories *);
-
-/* get_line.c */
-int get_line(FILE *, struct Categories *);
-#endif
-
-#endif

+ 0 - 102
raster/r.digit/main.c

@@ -1,102 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features 
- *               on a graphics monitor using a pointing device (mouse) 
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "local_proto.h"
-#include <grass/glocale.h>
-
-
-int main(int argc, char **argv)
-{
-    FILE *fd;
-    char *polyfile, *mapname;
-    int any;
-    struct GModule *module;
-    struct Option *output, *bgcmd;
-
-    /* must run in a term window */
-    G_putenv("GRASS_UI_TERM", "1");
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    module->description =
-	_("Interactive tool used to draw and save vector features on a graphics"
-	 " monitor using a pointing device (mouse) and save to a raster map.");
-
-    output = G_define_standard_option(G_OPT_R_OUTPUT);
-
-    bgcmd = G_define_option();
-    bgcmd->key = "bgcmd";
-    bgcmd->type = TYPE_STRING;
-    bgcmd->description =
-	_("Display commands to be used for canvas backdrop (separated by ';')");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    mapname = output->answer;
-
-#ifdef DEBUG
-    polyfile = "/tmp/r.digit.out";
-#else
-    polyfile = G_tempfile();
-#endif
-    fd = fopen(polyfile, "w");
-    if (fd == NULL) {
-	perror(polyfile);
-	exit(EXIT_FAILURE);
-    }
-
-    if (bgcmd->answer)
-	G_system(bgcmd->answer);
-
-    /* open the graphics and get it setup */
-    if (R_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected!"));
-    setup_graphics();
-
-    /* Do the digitizing and record the output into the polyfile */
-    any = digitize(fd);
-    fclose(fd);
-
-    /* close the graphics */
-    R_close_driver();
-
-
-#ifdef DEBUG
-    fprintf(stdout, "Output is in %s\n", polyfile);
-    exit(EXIT_FAILURE);
-#endif
-
-    if (any)
-	create_map(mapname, polyfile);
-    else
-	G_message(_("No map created"));
-
-    unlink(polyfile);
-
-    return (EXIT_SUCCESS);
-}

+ 0 - 76
raster/r.digit/r.digit.html

@@ -1,76 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-The GRASS tool <em>r.digit</em> provides the user with a
-way to draw lines, areas, and circles on a monitor screen,
-and to save these features in a raster map.  Lines, areas,
-and circles are to be drawn using a pointing device
-(mouse).  A mouse button menu indicates the consequences of
-pressing each mouse button.  The user is requested to enter
-the category number associated with the line, area, or
-circle subsequently drawn by the user.  Lines, areas, and
-circles are defined by the series of points marked by the
-user inside the map window.  <em>r.digit</em> will close
-areas when the user has not.  By drawing a series of such
-features, the user can repair maps, identify areas of
-interest, or simply draw graphics for advertisement.  When
-drawing is completed, a raster map based on the user's
-instructions is generated.  It is available for use as a
-mask, in analyses, and for display.
-
-<p>The <b>bgcmd</b> option is intended to be used with display (d.*) commands.
-If several display commands are to be used to render the background
-they should be separated with the semi-colon ';' character.
-When run from the command line, these display commands will generally
-need to be "quoted" as they will contain spaces (see examples).
-<p>Digitizing is done in a "polygon" method.  Each area is
-circumscribed completely.  Two or more overlapping areas and/or lines
-might define a single part of a map.  Each part of the map,
-however, is assigned only the LAST area or line which
-covered it.
-
-<h3>THE PROCESS:</h3>
-
-<h4>Start a monitor and display a raster to help setup and zoom to area of interest</h4>
-<div class="code"><pre>
-d.mon x0
-</pre></div>
-<p>
-<h4>Digitizing an area based on a existing map; creating a new raster map</h4>
-<div class="code"><pre>
-r.digit out=name_of_new_raster_map bgcmd="d.rast map=name_of_raster"
-</pre></div>
-
-<ol>
-
-<li>Choose to define an area or line, exit, or quit.
-If you choose to finish (<tt>exit</tt>) a new map is then created.
-If you quit, the session exits with nothing created.
-
-<li>If you choose to make an area or line you must identify
-the category number for that area or line.
-
-<li>Using the mouse trace the line or circumscribe the area;
-or, finish (go to Step 1).
-
-</ol>
-
-<h2>SEE ALSO</h2>
-
-<em>
-  <a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>
-  <a href="d.graph.html">d.graph</a>,
-  <a href="d.linegraph.html">d.linegraph</a>,
-  <a href="g.region.html">g.region</a>,
-  <a href="r.in.poly.html">r.in.poly</a>,
-  <a href="r.mapcalc.html">r.mapcalc</a>,
-  <a href="r.to.vect.html">r.to.vect</a>,
-  <a href="v.in.ascii.html">v.in.ascii</a>
-</em>
-
-
-<h2>AUTHOR</h2>
-
-Michael Shapiro, U.S.Army Construction Engineering 
-Research Laboratory
-
-<p><i>Last changed: $Date$</i>

+ 0 - 40
raster/r.digit/setup_graph.c

@@ -1,40 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.digit
- *
- * AUTHOR(S):    Michael Shapiro - CERL
- *
- * PURPOSE:      Interactive tool used to draw and save vector features
- *               on a graphics monitor using a pointing device (mouse)
- *               and save to a raster map.
- *
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- ***************************************************************************/
-
-#include <grass/display.h>
-
-
-int move(int x, int y)
-{
-    return 0;
-}
-
-int cont(int x, int y)
-{
-    return 0;
-}
-
-int setup_graphics(void)
-{
-    D_setup(0);
-    G_setup_plot(D_get_d_north(), D_get_d_south(), D_get_d_west(),
-		 D_get_d_east(), move, cont);
-
-    return 0;
-}

+ 7 - 8
raster/r.in.poly/r.in.poly.html

@@ -93,14 +93,13 @@ A
 <h2>SEE ALSO</h2>
 
 <em>
-  <a href="r.digit.html">r.digit</a>
-  <a href="r.colors.html">r.colors</a>,
-  <a href="d.rast.edit.html">d.rast.edit</a>,
-  <a href="g.region.html">g.region</a>,
-  <a href="r.in.xyz.html">r.in.xyz</a>,
-  <a href="r.patch.html">r.patch</a>,
-  <a href="v.in.ascii.html">v.in.ascii</a>,
-  <a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>
+<a href="r.colors.html">r.colors</a>,
+<a href="d.rast.edit.html">d.rast.edit</a>,
+<a href="g.region.html">g.region</a>,
+<a href="r.in.xyz.html">r.in.xyz</a>,
+<a href="r.patch.html">r.patch</a>,
+<a href="v.in.ascii.html">v.in.ascii</a>,
+<a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>
 </em>
 
 <h2>AUTHOR</h2>

+ 3 - 4
raster/r.le/r.le.setup/r.le.setup.html

@@ -92,9 +92,9 @@ command).
 
 <p>
 
-The user can also use the GRASS <em>r.digit</em> or <em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em> 
-programs to digitize circular or polygonal regions and to create a 
-sampling regions map without using <em>r.le.setup</em>.  Or, as mention 
+The user can also use the GRASS <em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em> 
+to digitize circular or polygonal regions and to create a 
+sampling regions map without using <em>r.le.setup</em>.  Or, as mentioned
 above, an existing raster map can be used as a regions map.
 
 <p>
@@ -442,7 +442,6 @@ then be analyzed directly (without setting up group limits) with the
 <em>r.le</em> programs.
 
 
-
 <h2>REFERENCES</h2>
 
 Baker, W.L. and Y. Cai. 1992. The r.le programs for multiscale analysis of