Преглед изворни кода

remove sites modules (GRASS 7 should contain just v.in.sites at the end)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49208 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa пре 13 година
родитељ
комит
a581943049

+ 0 - 1
Makefile

@@ -38,7 +38,6 @@ DIRS = \
 	misc \
 	imagery \
 	ps \
-	sites \
 	scripts \
 	temporal \
 	doc \

+ 0 - 13
sites/Makefile

@@ -1,13 +0,0 @@
-
-MODULE_TOPDIR = ..
-
-SUBDIRS = \
-
-#	s.in.ascii \
-#	s.out.ascii 
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make
-
-default: parsubdirs
-
-

+ 0 - 12
sites/s.in.ascii/Makefile

@@ -1,12 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = s.in.ascii
-
-LIBES = $(SITESLIB) $(VECTLIB) $(GISLIB)
-DEPENDENCIES= $(VECTDEP) $(GISDEP)
-EXTRA_INC = $(VECT_INC)
-EXTRA_CFLAGS = $(VECT_CFLAGS)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 303
sites/s.in.ascii/get_site.c

@@ -1,303 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#include <grass/gis.h>
-#include <grass/site.h>
-
-#include "local_proto.h"
-
-
-#define isnull(c) (c=='\0')
-
-static char *my_next_att(char *);
-int is_decimal(char *);
-
-Site *get_site(FILE * fd, int dims, char *fs, int *has_cat)
-{
-    static char *ibuf = NULL, *buf = NULL, *save = NULL;
-    char *b;
-    char ebuf[256], nbuf[256];
-    static int first = 1;
-    static unsigned int line = 0;
-    static int tty;
-    static int proj;
-    int i, err, itmp;
-    int n = 0;			/* number of categories */
-    int d = 0;			/* number of floating point attributes */
-    int c = 0;			/* number of string attributes */
-    float ftmp;
-    static Site *site;
-
-    if (first) {
-	site = G_site_new_struct(-1, dims, 0, 0);
-
-	ibuf = G_malloc(1024 * sizeof(char));
-	buf = G_malloc(1024 * sizeof(char));
-	save = buf;
-	if (ibuf == NULL || buf == NULL)
-	    G_fatal_error("memory allocation errory");
-	tty = isatty(fileno(fd));
-	proj = G_projection();
-	if (tty) {
-	    fprintf(stdout, "Enter sites, one per line, in the format:\n");
-	    fprintf(stdout, "east north ");
-	    for (i = 3; i <= dims; ++i)
-		fprintf(stdout, "dim%d ", i);
-	    fprintf(stdout, "attributes\n");
-	    fprintf(stdout, "When finished, type: end\n");
-	}
-	first = 0;
-    }
-    err = 1;
-    while (err) {
-	if (tty)
-	    fprintf(stdout, "location attributes> ");
-	else
-	    line++;
-
-	if (!G_getl(ibuf, 1024, fd))
-	    return (Site *) NULL;
-
-	/* G_squeeze cleans DOS newlines, but that makes Mac OS9 impossible
-	   to check for, so we do this test first */
-	if (strchr(ibuf, '\r') != NULL) {
-	    if ('\r' == ibuf[strlen(ibuf) - 1]) {
-		ibuf[strlen(ibuf) - 1] = '\0';	/* cleanse */
-		if (strchr(ibuf, '\r') != NULL)	/* any left, eg a short Mac OS9 file */
-		    G_fatal_error
-			("Input file not in UNIX format (invalid newline)");
-		else if (1 == line)	/* ie DOS '\r\n' newline */
-		    G_warning
-			("Input file is DOS format. Attempting anyway ..");
-	    }
-	    else		/* any others, eg Mac OS9 '\r' or a backwards DOS newline */
-		/* fgets() gets it wrong, so there is little we can do.   */
-		G_fatal_error
-		    ("Line %d: Input file not in UNIX format (invalid newline)",
-		     line);
-	}
-
-	buf = save;
-	strcpy(buf, ibuf);
-	G_squeeze(buf);
-
-	if (*buf == 0)
-	    return (Site *) NULL;
-	if (strcmp(buf, "end") == 0)
-	    return (Site *) NULL;
-	if (fs) {
-	    for (b = buf; *b; b++)
-		if (*b == *fs)
-		    *b = ' ';
-	}
-	if (sscanf(buf, "%s %s", ebuf, nbuf) != 2
-	    || !G_scan_easting(ebuf, &site->east, proj)
-	    || !G_scan_northing(nbuf, &site->north, proj)) {
-	    if (!tty) {
-		fprintf(stderr, "%s - line %d ", G_program_name(), line);
-	    }
-	    fprintf(stderr, "** invalid format **\n");
-	    if (!tty)
-		fprintf(stderr, "<%s>\n", ibuf);
-	    /* return (Site *) NULL; */
-	}
-	else
-	    err = 0;
-    }
-
-    buf += strlen(ebuf) + strlen(nbuf) + 1;
-    dims -= 2;
-    for (i = 0; i < dims; ++i) {
-	sscanf(buf, "%s", ebuf);
-	sscanf(ebuf, "%lf", &(site->dim[i]));
-	buf += strlen(ebuf) + 1;
-    }
-
-    /* no more dimensions-now we parse attribute fields */
-    while (isspace(*buf))
-	buf++;
-
-    while (buf != NULL) {
-	switch (*buf) {
-	    /* check for prefixed atts first, then without prefix */
-	case '#':		/* category field */
-	    if (n == 0) {
-		sscanf(buf, "#%s ", ebuf);
-		if (strstr(ebuf, ".") == NULL &&
-		    sscanf(ebuf, "%d", &itmp) == 1) {
-		    site->cattype = CELL_TYPE;
-		    site->ccat = itmp;
-		    n++;
-		}
-		else if (strstr(ebuf, ".") != NULL &&
-			 sscanf(ebuf, "%f", &ftmp) == 1) {
-		    site->cattype = FCELL_TYPE;
-		    site->fcat = ftmp;
-		    n++;
-		}
-		else
-		    site->cattype = -1;
-	    }
-	    else
-		G_warning
-		    ("Only one category attribute allowed per record; ignoring");
-
-	    /* move to beginning of next attribute */
-	    buf = my_next_att(buf);
-	    break;
-	case '%':		/* decimal attribute */
-	    if (d >= site->dbl_alloc) {
-		site->dbl_alloc++;
-		site->dbl_att = (double *)G_realloc(site->dbl_att,
-						    site->dbl_alloc *
-						    sizeof(double));
-	    }
-	    if ((err = sscanf(buf, "%%%lf", &(site->dbl_att[d++]))) < 1)
-		G_warning("error scanning floating point attribute: [%s]",
-			  buf);
-	    buf = my_next_att(buf);
-	    break;
-	case '@':		/* string attribute */
-	    if (isnull(*buf) || isnull(*(buf + 1))) {
-		*buf = '\0';
-		break;
-	    }			/* moved copy of commented out code back into @ case 2/00 rsb */
-	    else {
-		buf++;
-
-		if (c >= site->str_alloc) {
-		    site->str_alloc++;
-		    site->str_att = (char **)G_realloc(site->str_att,
-						       site->str_alloc *
-						       sizeof(char *));
-		    if (site->str_att == NULL)
-			G_fatal_error("memory allocation error");
-		    site->str_att[site->str_alloc - 1] =
-			(char *)G_malloc(MAX_SITE_STRING * sizeof(char));
-		    if (site->str_att[site->str_alloc - 1] == NULL)
-			G_fatal_error("memory allocation error");
-		}
-
-		if ((err = cleanse_string(buf)) > 0) {
-		    strncpy(site->str_att[c++], buf, err);
-		    buf += err;
-		}
-		else
-		    *buf = '\0';
-		buf = my_next_att(buf);
-		break;		/* end of modification 2/00 rsb */
-	    }
-	case '\0':		/* EOL, null encountered */
-	    buf = my_next_att(buf);
-	    break;
-	default:		/* changed to unprefixed decimals */
-	    /* commented 12/99: default shall be decimal field! M.N. */
-	    /* defaults to string attribute */
-	    /* allow both prefixed and unprefixed strings */
-	    /* 
-	       if (c >= site->str_alloc) {
-	       site->str_alloc++;
-	       site->str_att = (char **) G_realloc (site->str_att,
-	       site->str_alloc * sizeof (char *));
-	       if (site->str_att == NULL) 
-	       G_fatal_error ("memory allocation error");
-	       site->str_att[site->str_alloc - 1] = 
-	       (char *) G_malloc (MAX_SITE_STRING * sizeof (char));
-	       if (site->str_att[site->str_alloc - 1] == NULL) 
-	       G_fatal_error ("memory allocation error");
-	       }
-
-	       if ((err = cleanse_string (buf)) > 0) {
-	       strncpy (site->str_att[c++], buf, err);
-	       buf += err;
-	       }
-	       else *buf = '\0';
-	       buf = my_next_att (buf);
-	       break;
-	       ** *//* end of comment (default=strings) */
-
-	    /* default is unprefixed decimal attribute */
-#ifdef USE_OTHER_CODE
-	    if (d >= site->dbl_alloc) {
-		site->dbl_alloc++;
-		site->dbl_att = (double *)G_realloc(site->dbl_att,
-						    site->dbl_alloc *
-						    sizeof(double));
-	    }
-	    if ((err = sscanf(buf, "%lf", &(site->dbl_att[d++]))) < 1)
-		G_warning("error scanning floating point attribute: <%s>",
-			  buf);
-	    buf = my_next_att(buf);
-	    break;
-#else
-	    if (is_decimal(buf)) {	/* Convert as double */
-		if (d >= site->dbl_alloc) {
-		    site->dbl_alloc++;
-		    site->dbl_att = (double *)G_realloc(site->dbl_att,
-							site->dbl_alloc *
-							sizeof(double));
-		}
-		if ((err = sscanf(buf, "%lf", &(site->dbl_att[d++]))) < 1)
-		    G_warning("error scanning floating point attribute: '%s'",
-			      buf);
-		buf = my_next_att(buf);
-	    }
-	    else {		/* Convert as string */
-		if (c >= site->str_alloc) {
-		    site->str_alloc++;
-		    site->str_att = (char **)G_realloc(site->str_att,
-						       site->str_alloc *
-						       sizeof(char *));
-		    if (site->str_att == NULL)
-			G_fatal_error("memory allocation error");
-		    site->str_att[site->str_alloc - 1] =
-			(char *)G_malloc(MAX_SITE_STRING * sizeof(char));
-		    if (site->str_att[site->str_alloc - 1] == NULL)
-			G_fatal_error("memory allocation error");
-		}
-
-		if ((err = cleanse_string(buf)) > 0) {
-		    strncpy(site->str_att[c++], buf, err);
-		    buf += err;
-		}
-		else
-		    *buf = '\0';
-		buf = my_next_att(buf);
-	    }
-#endif /* USE_OTHER_CODE */
-	}			/* switch */
-    }				/* while */
-    *has_cat = n;
-    return site;
-}
-
-
-static char *my_next_att(char *buf)
-{
-    while (!isspace(*buf) && !isnull(*buf))
-	buf++;
-    if (isnull(*buf) || isnull(*(buf + 1)))
-	return (char *)NULL;
-    else
-	while (isspace(*(buf + 1)) && !isnull(*(buf + 1)))
-	    buf++;
-    buf++;
-    return buf;
-}
-
-int is_decimal(char *att)
-{
-    char *p;
-
-    p = att;
-    while (*p != '\0' && !isspace(*p)) {
-	if (!isdigit(*p) && *p != '.' && *p != '-' && *p != '+') {
-	    return 0;
-	}
-	p++;
-    }
-    return 1;
-}
-
-/* vim: set softtabstop=4 shiftwidth=4 expandtab: */

+ 0 - 5
sites/s.in.ascii/local_proto.h

@@ -1,5 +0,0 @@
-/* get_site.c */
-Site *get_site(FILE *, int, char *, int *);
-
-/* main.c */
-int G_site_put_new(FILE *, Site *, int);

+ 0 - 255
sites/s.in.ascii/main.c

@@ -1,255 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       s.in.ascii
- * AUTHOR(S):    Michael Shapiro - US Army CERL
- *               Improvements:
- *                     Markus Neteler - neteler@geog.uni-hannover.de
- *                     Eric Miller
- *                     added timestamp 1/2002 MN
- * PURPOSE:      Import ASCII sites lists and their descriptions into
- *               a GRASS sites list file. 
- * COPYRIGHT:    (C) 2000 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 <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <grass/gis.h>
-#include <grass/site.h>
-#include <grass/glocale.h>
-#include "local_proto.h"
-
-static int loop;		/* added #cat support for site_list 11/99 M. Neteler
-				 * required for s.to.vect and s.to.rast */
-
-int main(int argc, char *argv[])
-{
-    char *me;
-    char *output, *input;
-    char *fs;
-    int dims, i, has_cat;
-    struct GModule *module;
-    FILE *in_fd, *out_fd;
-    Site *site;
-    Site_head shead;
-    struct TimeStamp ts;
-    struct
-    {
-	struct Option *input, *output, *dims, *fs, *date;
-    } parm;
-
-    G_gisinit(me = argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("sites"));
-    module->description =
-	"Convert an ASCII listing of site locations "
-	"into a GRASS site list file.";
-
-    parm.output = G_define_option();
-    parm.output->key = "output";
-    parm.output->type = TYPE_STRING;
-    parm.output->required = YES;
-    parm.output->description = "vector map to be created";
-    parm.output->gisprompt = "any,vector,vector";
-
-    parm.input = G_define_option();
-    parm.input->key = "input";
-    parm.input->type = TYPE_STRING;
-    parm.input->required = NO;
-    parm.input->description = "unix file containing sites";
-
-    parm.dims = G_define_option();
-    parm.dims->key = "d";
-    parm.dims->type = TYPE_INTEGER;
-    parm.dims->required = NO;
-    parm.dims->description = "number of dimensions (default=2)";
-
-    parm.fs = G_define_option();
-    parm.fs->key = "fs";
-    parm.fs->key_desc = "character|space|tab";
-    parm.fs->type = TYPE_STRING;
-    parm.fs->required = NO;
-    parm.fs->description = "input field separator";
-    parm.fs->answer = "space";
-
-    parm.date = G_define_option();
-    parm.date->key = "date";
-    parm.date->key_desc = "timestamp";
-    parm.date->required = NO;
-    parm.date->type = TYPE_STRING;
-    parm.date->description = "datetime or datetime1/datetime2";
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    if ((input = parm.input->answer)) {
-	in_fd = fopen(input, "r");
-	if (NULL == in_fd) {
-	    fprintf(stderr, "%s - ", me);
-	    perror(input);
-	    exit(1);
-	}
-    }
-    else
-	in_fd = stdin;
-
-    output = parm.output->answer;
-    shead.name = G_store(parm.output->answer);
-    shead.desc = G_store(G_recreate_command());
-    shead.form = shead.labels = shead.stime = (char *)NULL;
-
-    /* add here time parameter */
-    if (parm.date->answer) {
-	if (1 == G_scan_timestamp(&ts, parm.date->answer))
-	    shead.time = &ts;
-	else
-	    G_fatal_error("Invalid timestamp");
-    }
-    else
-	shead.time = (struct TimeStamp *)NULL;
-
-    dims = 2;
-    loop = 1;			/* added 11/99 MNeteler */
-
-    if (parm.dims->answer != NULL)
-	if ((i = sscanf(parm.dims->answer, "%d", &dims)) != 1)
-	    G_fatal_error("error scanning number of dimensions");
-    if (dims < 2)
-	G_fatal_error("number of dimensions must be greater than 1");
-
-    if (strlen(parm.fs->answer) < 1)
-	G_fatal_error("field separator cannot be empty");
-    else {
-	fs = parm.fs->answer;
-	if (strcmp(fs, "space") == 0)
-	    fs = NULL;
-	else if (strcmp(fs, "tab") == 0)
-	    fs = NULL;
-    }
-
-    out_fd = G_fopen_sites_new(output);
-    if (out_fd == NULL)
-	G_fatal_error("can't create sites file [%s].", output);
-
-    G_site_put_head(out_fd, &shead);
-
-    while ((site = get_site(in_fd, dims, fs, &has_cat)))
-	G_site_put(out_fd, site);
-
-    G_sites_close(out_fd);
-    exit(0);
-}
-static int format_double(double value, char *buf)
-{
-    int G_trim_decimal();
-
-    sprintf(buf, "%.8f", value);
-    G_trim_decimal(buf);
-    return 0;
-}
-
-#define DQUOTE '"'
-#define SPACE ' '
-#define BSLASH 92
-#define PIPE '|'
-
-#define ispipe(c) (c==PIPE)
-#define isnull(c) (c==(char)NULL)
-#define isquote(c) (c==DQUOTE)
-#define isbslash(c) (c==BSLASH)
-
-int G_site_put_new(FILE * fptr, Site * s, int has_cat)
-
-/* Writes a site to file open on fptr. */
-{
-    char ebuf[MAX_SITE_STRING], nbuf[MAX_SITE_STRING];
-    char xbuf[MAX_SITE_STRING], buf[MAX_SITE_LEN];
-    static int format_double();
-    int fmt, i, j, k;
-    int G_format_northing(), G_format_easting(), G_projection();
-
-    fmt = G_projection();
-
-    G_format_northing(s->north, nbuf, fmt);
-    G_format_easting(s->east, ebuf, fmt);
-    sprintf(buf, "%s|%s|", ebuf, nbuf);
-    for (i = 0; i < s->dim_alloc; ++i) {
-	format_double(s->dim[i], nbuf);
-	sprintf(xbuf, "%s|", nbuf);
-	strcat(buf, xbuf);
-    }
-
-    if (has_cat) {
-	switch (s->cattype) {
-	case CELL_TYPE:
-	    sprintf(xbuf, "#%d ", s->ccat);
-	    strcat(buf, xbuf);
-	    break;
-	case FCELL_TYPE:
-	    sprintf(xbuf, "#%g ", s->fcat);
-	    strcat(buf, xbuf);
-	    break;
-	case DCELL_TYPE:
-	    sprintf(xbuf, "#%g ", s->dcat);
-	    strcat(buf, xbuf);
-	    break;
-	}
-    }
-    else {			/* no cat there, so data in plain x,y,z format will be imported   12/99 MN */
-
-	/* we create a #cat entry in site_list from the current site number 11/99 */
-	sprintf(xbuf, "#%d ", loop);
-	loop++;
-	strcat(buf, xbuf);
-    }
-
-    /* now import attributes */
-    for (i = 0; i < s->dbl_alloc; ++i) {
-	format_double(s->dbl_att[i], nbuf);
-	sprintf(xbuf, "%%%s ", nbuf);
-	strcat(buf, xbuf);
-    }
-
-    for (i = 0; i < s->str_alloc; ++i) {
-	if (strlen(s->str_att[i]) != 0) {
-	    /* escape double quotes */
-	    j = k = 0;
-	    if (G_index(s->str_att[i], DQUOTE) != (char *)NULL) {
-		while (!isnull(s->str_att[i][j])) {
-		    if (isquote(s->str_att[i][j])) {
-			xbuf[k++] = BSLASH;
-			xbuf[k++] = DQUOTE;
-		    }
-		    else if (isbslash(s->str_att[i][j])) {
-			xbuf[k++] = BSLASH;
-			xbuf[k++] = BSLASH;
-		    }
-		    else
-			xbuf[k++] = s->str_att[i][j];
-		    j++;
-		}
-		xbuf[k] = (char)NULL;
-	    }
-	    else
-		strcpy(xbuf, s->str_att[i]);
-
-	    strcpy(s->str_att[i], xbuf);
-
-	    if (G_index(s->str_att[i], SPACE) != (char *)NULL)
-		sprintf(xbuf, "@\"%s\" ", s->str_att[i]);
-	    else
-		sprintf(xbuf, "@%s ", s->str_att[i]);
-
-	    strcat(buf, xbuf);
-	}
-    }
-    fprintf(fptr, "%s\n", buf);
-    return 0;
-}

+ 0 - 134
sites/s.in.ascii/s.in.ascii.html

@@ -1,134 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>s.in.ascii</em> converts an ASCII listing of site
-locations and category labels into GRASS vector format.
-
-<p>
-Input can be entered via standard input or from the file
-<b>input=</b><em>name</em>. Each line of input should
-contain the easting, northing, and either the category value
-or category label associated with a site.  The
-<b>fs=</b><em>name</em> option (where <em>name</em> is
-either a character, a space, or a tab) can be used to
-specify the use of a particular field separator between
-these three input fields. This is useful when input is
-obtained from other programs (see NOTES, below).  Output is
-stored in the vector map <b>output=</b><em>name</em>.
-
-<p>
-The GRASS program <em><a href="s.out.ascii.html">s.out.ascii</a></em>
-can be used to perform the reverse function, converting a file in GRASS
-vector sites format into an ASCII listing of eastings, northings, and 
-category labels associated with site locations.
-
-
-<h3>Parameters:</h3>
-
-<dl>
-<dt><b>output=</b><em>name</em>
-<dd>Name of the new GRASS site list file to be output. 
-<dt><b>input=</b><em>name</em>
-<dd>Name of an existing ASCII file containing site locations and labels. 
-<dt><b>d=</b><em>value</em>
-<dd>number of dimensions (default=2)
-<dt><b>fs=</b><em>character|space|tab</em>
-<dd>The field separator separating the easting, northing, and category label 
-    in each line of the <em>input</em> file. 
-    The field separator can be a character, a space, or a tab. 
-<br>
-    Default: space 
-<dt><b>date=</b><em>timestamp</em>[/<em>timestamp</em>]
-<dd>String specifying timestamp or timestamp range.
-</dl>
-
-<p>
-<em>s.in.ascii</em> can be run either non-interactively or
-interactively.  The program will be run non-interactively
-if the user specifies a name to be assigned to the
-<b>sites</b> file output, the name of an existing ASCII
-file containing <b>input</b>, and (optionally) a field
-separator <b>fs</b> appearing in the <b>input</b> file.
-
-<p>
-Alternately, the user can simply type <b>s.in.ascii</b> on
-the command line, without program arguments. In this case,
-the user will be prompted for parameter values using the
-standard GRASS parser interface described in the manual
-entry for <em><a href="parser.html">parser</a></em>. If 
-the user does not specify the name of an <b>input</b> 
-file containing site locations and category attributes,
-these should be entered to the program via standard input. 
-The <b>d</b> parameter allows the user to specify that more 
-than 2 dimensions will be imported. Otherwise the third (or 
-further) column in the <b>input</b> file will be treated as an attribute.
-
-<p>To define a <b>date</b> (timestamp), several date strings are accepted.
-Please see <em><a href="r.timestamp.html">r.timestamp</a></em> for details.
-
-<p><h2>NOTES</h2>
-
-<b>Importing from other GRASS programs</b>
-<p>Other GRASS programs can be used to produce output in a
-format suitable for input to <em>s.in.ascii</em>. For
-example, the user might pipe output produced by
-<em><a href="d.where.html">d.where</a></em> into 
-<em>s.in.ascii</em> to create a site
-list file called <em>my.sites</em> containing site
-locations pointed to with the mouse, as illustrated below.
-In this example it is unnecessary to specify the field
-separator used in the input, since <em>d.where</em> output
-separates the easting and northing values with spaces, and
-spaces are the default field separator assumed by
-<em>s.in.ascii</em>.
-<p><dl>
-<dd><b>d.where</b> | <b>s.in.ascii output=</b>my.sites
-</dl>
-<p><b>Importing from a spreadsheet</b>
-<p>Data may be imported from many spreadsheet programs by saving the spreadsheet
-as a comma separated variable (.csv) text file, and then using 
-the "<b>fs=</b><em>,</em>" command line parameter with <em>s.in.ascii</em>.
-<p><b>Importing latitude/longitude data</b>
-<p>Latitude/longitude data may be imported either in decimal degree format:<br>
-
-<pre>
-    8.314824 54.921730 site1
-    8.897605 54.872353 site2
-    9.549371 54.834080 site3
-</pre>
-
-or in DMS (degree, minutes, seconds) format:<br>
-
-<pre>
-    8:18:53.3664E 54:55:18.228N site1
-    8:53:51.378E  54:52:20.4708N site2
-    9:32:57.7356E 54:50:02.688N site3
-</pre>
-
-<p><b>Time as String Attributes</b>
-<p>
-In this example, we will work with the following site list:
-
-<pre>
-    10.8 0 9.8 Fri Sep 13 10:00:00 1986 31.4
-    11 5.5 9.9 Fri Sep 14 00:20:00 1985 36.4
-    5.1 3.9 10 Fri Sep 15 00:00:30 1984 28.4
-</pre>
-
-This data has three dimensions (assume easting, northing, and
-elevation),  five string attributes, and one decimal attribute.
-
-<h2>SEE ALSO</h2>
-
-<em><a href="d.vect.html">d.sites</a></em>,
-<em><a href="d.what.vect.html">d.what.vect</a></em>,
-<em><a href="d.where.html">d.where</a></em>,
-<em><a href="r.timestamp.html">r.timestamp</a></em>,
-<em><a href="s.out.ascii.html">s.out.ascii</a></em>
-
-<h2>AUTHOR</h2>
-
-Michael Shapiro,  
-U.S. Army Construction Engineering 
-Research Laboratory
-
-<p><i>Last changed: $Date$</i>

+ 0 - 12
sites/s.out.ascii/Makefile

@@ -1,12 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = s.out.ascii
-
-LIBES = $(SITESLIB) $(VECTLIB) $(GISLIB)
-DEPENDENCIES= $(VECTDEP) $(GISDEP)
-EXTRA_INC = $(VECT_INC)
-EXTRA_CFLAGS = $(VECT_CFLAGS)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 141
sites/s.out.ascii/main.c

@@ -1,141 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       s.out.ascii
- * AUTHOR(S):    Michael Shapiro CERL (original contributor)
- *               Radim Blazek <radim.blazek gmail.com> (GRASS 6)
- *               Glynn Clements <glynn gclements.plus.com>, Markus Neteler <neteler itc.it>
- * PURPOSE:      
- * COPYRIGHT:    (C) 1999-2007 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 <grass/gis.h>
-#include <grass/site.h>
-#include <grass/glocale.h>
-
-int main(int argc, char *argv[])
-{
-    char *mapset, *name;
-    char ebuf[128], nbuf[128];
-    Site *site;
-    char *fs;
-    int full, all, strip, n = 0, s = 0, d = 0;
-    RASTER_MAP_TYPE c = -1;
-    char msg[200];
-    FILE *fd;
-    struct Cell_head window;
-    struct GModule *module;
-    struct
-    {
-	struct Flag *full, *all, *strip;
-    } flag;
-    struct
-    {
-	struct Option *input, *fs;
-    } parm;
-    int G_trim_decimal();
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("sites"));
-    module->description =
-	"Converts a GRASS site list file into an ASCII listing of "
-	"site locations and their descriptions.";
-
-    parm.input = G_define_option();
-    parm.input->key = "input";
-    parm.input->type = TYPE_STRING;
-    parm.input->required = YES;
-    parm.input->description = "name of a vector map to be output";
-    parm.input->gisprompt = "old,vector,vector";
-
-    parm.fs = G_define_option();
-    parm.fs->key = "fs";
-    parm.fs->key_desc = "character|space|tab";
-    parm.fs->type = TYPE_STRING;
-    parm.fs->required = NO;
-    parm.fs->description = "Output field separator";
-    parm.fs->answer = "space";
-
-    flag.all = G_define_flag();
-    flag.all->key = 'a';
-    flag.all->description =
-	"Output all sites (do not limit to current region)";
-
-    flag.full = G_define_flag();
-    flag.full->key = 'd';
-    flag.full->description = "Include site attributes in the output";
-
-    flag.strip = G_define_flag();
-    flag.strip->key = 'i';
-    flag.strip->description =
-	"Include site attribute identifiers in the output";
-
-    if (G_parser(argc, argv))
-	exit(1);
-    full = flag.full->answer;
-    all = flag.all->answer;
-    strip = flag.strip->answer;
-
-    name = parm.input->answer;
-    mapset = G_find_sites(name, "");
-    if (mapset == NULL) {
-	sprintf(msg, "sites file [%s] not found", name);
-	G_fatal_error(msg);
-    }
-
-    if ((fs = parm.fs->answer)) {
-	if (strcmp(fs, "space") == 0)
-	    fs = " ";
-	else if (strcmp(fs, "tab") == 0)
-	    fs = "\t";
-    }
-    else
-	fs = " ";
-
-    if (!all)
-	G_get_window(&window);
-    fd = G_fopen_sites_old(name, mapset);
-    if (fd == NULL) {
-	sprintf(msg, "can't open sites file [%s]", name);
-	G_fatal_error(msg);
-    }
-
-    if (G_site_describe(fd, &n, &c, &s, &d) != 0)
-	G_fatal_error("failed to guess format");
-    site = G_site_new_struct(c, n, s, d);
-
-    while (G_site_get(fd, site) == 0) {
-	if (all || G_site_in_region(site, &window)) {
-	    if (!full) {
-		G_format_easting(site->east, ebuf,
-				 G_projection() == PROJECTION_LL ? -1 : 0);
-		G_format_northing(site->north, nbuf,
-				  G_projection() == PROJECTION_LL ? -1 : 0);
-		fprintf(stdout, "%s%s%s", ebuf, fs, nbuf);
-
-		for (n = 0; n < site->dim_alloc; ++n) {
-		    sprintf(nbuf, "%.8f", site->dim[n]);
-		    G_trim_decimal(nbuf);
-		    fprintf(stdout, "%s%s", fs, nbuf);
-		}
-		fprintf(stdout, "\n");
-	    }
-	    else {
-		char *str = G_site_format(site, fs, strip);
-
-		fprintf(stdout, "%s\n", str);
-		G_free(str);
-	    }
-	}
-    }
-    G_sites_close(fd);
-    exit(0);
-}

+ 0 - 144
sites/s.out.ascii/s.out.ascii.html

@@ -1,144 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>s.out.ascii</em> converts an existing site list file
-(<b>input=</b><em>name</em>) into an ASCII listing of site
-locations and (optionally) their category labels, in a
-format suitable for input to other program). 
-
-<p>
-Each line of output consists of the easting, northing, and
-category label for a site listed in the named <b>vector points</b> (sites)
-file.  The <b>fs=</b><em>name</em> option (where
-<em>name</em> is either a character, a space, or a tab) can
-be used to place a particular field separator between these
-three output fields. This is useful when output is to be
-manipulated by other programs, like <em>awk</em> or
-<em>sed</em>.
-
-<p>
-The GRASS program <em>s.in.ascii</em> can be used to
-perform the reverse function, converting a UNIX file
-containing eastings, northings, and category labels
-associated with site locations into GRASS site list file
-format.
-
-<h2>OPTIONS</h2>
-
-<h3>Flags:</h3>
-
-<dl>
-<dt><b>-a</b>
-<dd>Output all sites found in the named <b>vector points</b>
-file, rather than limiting output to sites falling within
-the current geographic region.
-
-<dt><b>-d</b>
-<dd>Include site descriptions (category labels) in the output. 
-
-<dt><b>-i</b>
-<dd>Include site attribute identifiers in the output
-
-</dl>
-
-<h3>Parameters:</h3>
-
-<dl>
-
-<dt><b>input=</b><em>name</em>
-
-<dd>Name of an existing site list file. 
-
-<dt><b>fs=</b>character|space|tab
-
-<dd>The field separator to be placed between the easting,
-northing, and (optionally) category label on each line of
-output.  The field separator can be a character, a space,
-or a tab.
-
-<br>
-Default: space 
-</dl>
-
-<em>s.out.ascii</em> can be run either non-interactively or
-interactively.  The program will be run non-interactively
-if the user specifies the name of an existing site list
-file and (optionally) a value for <b>fs</b>, using the form
-
-<p><dl>
-<dd>
-<b>s.out.ascii</b> 
-[<b>-adi</b>] 
-<b>input=</b><em>name</em> 
-[<b>fs=</b>character|space|tab] 
-</dl>
-
-
-where <em>name</em> is the name of an existing site list
-file to be converted to a brief ASCII listing, and
-<b>fs</b> is the field separator to be placed between
-output fields. The user can also the <b>-a</b> and
-<b>-d</b> options to use all sites in the named
-<b>sites</b> file and to include site descriptions in the
-output.
-
-<p>
-Alternately, the user can simply type <b>s.out.ascii</b> on
-the command line, without program arguments. In this case,
-the user will be prompted for parameter values using the
-standard GRASS 
-
-<a href="parser.html">parser</a>
-
-interface.
-
-<h2>NOTES</h2>
-
-To output GRASS data in x,y,z ASCII style, the s.out.ascii may be used:
-<p><dl>
-<dd>
-<b>s.out.ascii -d input=</b>sitesmap
-</dl>
-Resulting to:
-
-<pre>
-     3566393.75 5773293.75 168.3
-     3566818.75 5773293.75 158.8
-     3568843.75 5773293.75 114.3
-     3568981.25 5773293.75 117.5
-     [...]
-</pre>
-
-To export raster maps into this x,y,z format, the raster map can be
-converted to sites format using <em>r.to.sites</em> and <em>s.out.ascii</em>
-subsequently as described above.
-
-<p>The output from <em>s.out.ascii</em> may be placed into a
-file by using the UNIX redirection mechanism; e.g.:
-
-<p><dl>
-<dd>
-<b>s.out.ascii input=</b>archsites &gt; out.file
-</dl>
-
-<em>s.out.ascii</em> output may also be redirected into
-other programs; e.g.:
-
-<p><dl>
-<dd>
-<b>s.out.ascii input=</b>archsites | d.points <b>color=</b>red <b>size=</b>10 <b>type=</b>diamond
-</dl>
-
-<h2>SEE ALSO</h2>
-
-<em><a href="d.points.html">d.points</a></em><br>
-<em><a href="d.vect.html">d.vect</a></em><br>
-<em><a href="s.in.ascii.html">s.in.ascii</a></em><br>
-<em><a href="r.to.vect.html">r.to.vect</a></em>
-
-<h2>AUTHOR</h2>
-
-Michael Shapiro,  
-U.S. Army Construction Engineering 
-Research Laboratory
-
-<p><i>Last changed: $Date$</i>