Browse Source

r.los: move to addons (backport of https://trac.osgeo.org/grass/changeset/61899), remove links, remove r.los-r.viewshed test script (now in r.los addon)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61901 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 years ago
parent
commit
3f4340d38c

+ 0 - 3
gui/wxpython/xml/toolboxes.xml

@@ -806,9 +806,6 @@
       <module-item name="r.viewshed">
         <label>Visibility</label>
       </module-item>
-      <module-item name="r.los">
-        <label>Visibility [DEPRECATED]</label>
-      </module-item>
       <module-item name="r.grow.distance">
         <label>Distance to features</label>
       </module-item>

+ 0 - 1
raster/Makefile

@@ -43,7 +43,6 @@ SUBDIRS = \
 	r.latlong \
 	r.lake \
 	r.li \
-	r.los \
 	r.mapcalc \
 	r.mfilter \
 	r.mode \

+ 0 - 1
raster/r.horizon/r.horizon.html

@@ -167,7 +167,6 @@ r.horizon elev_in=elevation horizon_step=30 bufferzone=200 horizon=horangle \
 <em>
 <a href="r.sun.html">r.sun</a>,
 <a href="r.sunmask.html">r.sunmask</a>,
-<a href="r.los.html">r.los</a>,
 <a href="r.viewshed.html">r.viewshed</a></em>
 
 

+ 0 - 11
raster/r.los/Makefile

@@ -1,11 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = r.los
-
-LIBES = $(SEGMENTLIB) $(RASTERLIB) $(GISLIB) $(MATHLIB)
-DEPENDENCIES = $(SEGMENTDEP) $(RASTERDEP) $(GISDEP)
-EXTRA_INC = $(PROJINC)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 17
raster/r.los/cmd_line.h

@@ -1,17 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      This header file declares the global variables and the  */
-/*      structures that are to be used for command line         */
-/*      processing                                              */
-/*                                                              */
-
-/****************************************************************/
-
-extern double east;
-extern double north;
-extern double obs_elev;
-extern double max_dist;
-extern char *elev_layer;
-extern char *patt_layer;
-extern char *out_layer;

+ 0 - 26
raster/r.los/color_rnge.c

@@ -1,26 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      decide_color_range.c    in      ~/src/Glos              */
-/*                                                              */
-/*      This function calculates the factor that should be      */
-/*      used to multiply every visible point's inclination      */
-/*      so that the full color range could be utilized. It      */
-/*      takes as input the max inclination and returns the      */
-/*      color factor.                                           */
-/*                                                              */
-
-/****************************************************************/
-
-
-double
-decide_color_range(double max_inclination, double COLOR_SHIFT,
-		   double COLOR_MAX)
-{
-    int i;
-
-    i = max_inclination + 0.99;
-    return ((COLOR_MAX - COLOR_SHIFT) / i);
-}
-
-/************* END OF FUNCTION "DECIDE_COLOR_FACTOR" ************/

+ 0 - 97
raster/r.los/delete.c

@@ -1,97 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      delete.c        in      ~/src/Glos                      */
-/*                                                              */
-/*      This function detaches a point data structure from      */
-/*      the linked list and frees memory allocated for it.      */
-/*                                                              */
-
-/****************************************************************/
-
-#include <stdlib.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/segment.h>
-#include "point.h"
-
-#define  PT_TO_DELETE_X		  PT_TO_DELETE->x
-#define  PT_TO_DELETE_Y		  PT_TO_DELETE->y
-#define  PT_NEXT_TO_DELETED	  PT_TO_DELETE->next
-#define  PT_PREVIOUS_TO_DELETED	  PT_TO_DELETE->previous
-#define  NEXT_PT_BACK_PTR	  PT_TO_DELETE->next->previous
-#define	 PREVIOUS_PT_NEXT_PTR     PT_TO_DELETE->previous->next
-
-struct point *delete(struct point *PT_TO_DELETE, struct point *head,
-		     SEGMENT * seg_out_p, int row_viewpt, int col_viewpt)
-{
-    FCELL data;
-    FCELL *value;
-
-    /*      mark deleted points by light brownish color     */
-    data = 1;
-    value = &data;
-    segment_put(seg_out_p, value,
-		row_viewpt - PT_TO_DELETE_Y, PT_TO_DELETE_X + col_viewpt);
-
-    /* If first and last point. This fixes a bug in r.los. See pts_elim.c for details */
-    if ((PT_TO_DELETE == head) && (PT_NEXT_TO_DELETED == NULL)) {
-	NEXT_PT_BACK_PTR = NULL;
-	head = PT_NEXT_TO_DELETED;
-	G_free(PT_TO_DELETE);
-	return (head);
-    }
-
-    if (PT_TO_DELETE == head) { /*  first one ?  */
-	NEXT_PT_BACK_PTR = NULL;
-	head = PT_NEXT_TO_DELETED;
-	/* 
-	   We cannot delete this point right now, as pts_elim.c might still
-	   reference it. Thus, we only mark it for deletion now by pointing
-	   the global DELAYED_DELETE to it and free it the next time we
-	   get here! 
-	*/
-	if ( DELAYED_DELETE != NULL ) {
-	    G_free ( DELAYED_DELETE );
-	    DELAYED_DELETE = NULL;
-	} else {
-	    if ( PT_TO_DELETE != NULL ) {
-	        DELAYED_DELETE = PT_TO_DELETE;
-	    }
-	}
-	
-	return (head);
-    }
-
-    /* If last point. This fixes a bug in r.los. See pts_elim.c for details */
-    if (PT_NEXT_TO_DELETED == NULL) {
-        PREVIOUS_PT_NEXT_PTR = PT_NEXT_TO_DELETED;
-	G_free(PT_TO_DELETE);
-	return (head);
-    }
-
-    /*  otherwise  */
-
-    NEXT_PT_BACK_PTR = PT_PREVIOUS_TO_DELETED;
-    PREVIOUS_PT_NEXT_PTR = PT_NEXT_TO_DELETED;
-	
-    /* 
-        We cannot delete this point right now, as pts_elim.c might still
-	reference it. Thus, we only mark it for deletion now by pointing
-	the global DELAYED_DELETE to it and free it the next time we
-	get here! 
-    */
-    if ( DELAYED_DELETE != NULL ) {
-        G_free ( DELAYED_DELETE );
-        DELAYED_DELETE = NULL;
-    } else {
-        if ( PT_TO_DELETE != NULL ) {
-	    DELAYED_DELETE = PT_TO_DELETE;
-	}
-    }
-
-    return (head);
-
-}
-
-/************* END OF FUNCTION "DELETE" *************************/

+ 0 - 10
raster/r.los/local_proto.h

@@ -1,10 +0,0 @@
-/* color_rnge.c */
-double decide_color_range(double, double, double);
-
-/* newsegment.c */
-struct point *segment(int, int, int, double, double, int, int, int, int,
-		      SEGMENT *, SEGMENT *, SEGMENT *, int, int, int, int,
-		      double);
-/* pts_elim.c */
-double find_orientation(int, int, int);
-double find_inclination(int, int, int, SEGMENT *, int, int, int, double);

+ 0 - 413
raster/r.los/main.c

@@ -1,413 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.los
- * AUTHOR(S):    Kewan Q. Khawaja, Intelligent Engineering Systems Laboratory, M.I.T. (original contributor)
- *               Markus Neteler <neteler itc.it> (original contributor)
- *               Ron Yorston <rmy tigress co uk>, Glynn Clements <glynn gclements.plus.com>,
- *               Hamish Bowman <hamish_b yahoo.com>, Jan-Oliver Wagner <jan intevation.de>
- * PURPOSE:      line of sight
- * 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.
- *
- *****************************************************************************/
-
-/****************************************************************
- *      main.c
- *
- *      This is the main program for line-of-sight analysis.
- *      It takes a digital elevation map and identifies all
- *      the grid cells that are visible from a user specified
- *      observer location.  Other input parameters to the
- *      program include the height of the observer above the
- *      ground, a map marking areas of interest in which the
- *      analysis is desired, and a maximum range for the line
- *      of sight.
- *
- ****************************************************************/
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <fcntl.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-
-#include <grass/segment.h>
-#include <grass/gprojects.h>
-#include <grass/glocale.h>
-#include "cmd_line.h"
-#include "point.h"
-#include "local_proto.h"
-
-#define   COLOR_SHIFT      155.0
-#define   COLOR_MAX        255.0
-
-#define   SEARCH_PT_INCLINATION		SEARCH_PT->inclination
-#define	  NEXT_SEARCH_PT		SEARCH_PT->next
-
-struct Cell_head window;	/*      database window         */
-
-struct point *DELAYED_DELETE;
-
-double east;
-double north;
-double obs_elev;
-double max_dist;
-char *elev_layer;
-char *patt_layer;
-char *out_layer;
-
-int main(int argc, char *argv[])
-{
-    int row_viewpt, col_viewpt, nrows, ncols, a, b, row, patt_flag;
-    int segment_no, flip, xmax, ymax, sign_on_y, sign_on_x;
-    int submatrix_rows, submatrix_cols, lenth_data_item;
-    int patt = 0, in_fd, out_fd, patt_fd = 0;
-    int old, new;
-    double slope_1, slope_2, max_vert_angle = 0.0, color_factor;
-    const char *old_mapset, *patt_mapset = NULL;
-    FCELL *value;
-    const char *search_mapset, *current_mapset;
-    const char *in_name, *out_name, *patt_name = NULL;
-    struct Categories cats;
-    struct Cell_head cellhd_elev, cellhd_patt;
-    extern struct Cell_head window;
-    CELL *cell;
-    FCELL *fcell, data, viewpt_elev;
-    SEGMENT seg_in, seg_out, seg_patt;
-    struct point *heads[16], *SEARCH_PT;
-    struct GModule *module;
-    struct Option *opt1, *opt2, *opt3, *opt5, *opt6, *opt7;
-    struct Flag *curvature;
-    struct History history;
-    char title[128];
-    double aa, e2;
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    G_add_keyword(_("viewshed"));
-    G_add_keyword(_("line of sight"));
-    module->description = _("Line-of-sight raster analysis program.");
-
-    /* Define the different options */
-
-    opt1 = G_define_standard_option(G_OPT_R_ELEV);
-    opt1->key = "input";
-
-    opt7 = G_define_standard_option(G_OPT_R_OUTPUT);
-
-    opt3 = G_define_standard_option(G_OPT_M_COORDS);
-    opt3->required = YES;
-    opt3->description = _("Coordinates of the viewing position");
-
-    opt2 = G_define_standard_option(G_OPT_R_COVER);
-    opt2->key = "patt_map";
-    opt2->required = NO;
-    opt2->description = _("Binary (1/0) raster map to use as a mask");
-
-    opt5 = G_define_option();
-    opt5->key = "obs_elev";
-    opt5->type = TYPE_DOUBLE;
-    opt5->required = NO;
-    opt5->answer = "1.75";
-    opt5->description = _("Viewing position height above the ground");
-
-    opt6 = G_define_option();
-    opt6->key = "max_dist";
-    opt6->type = TYPE_DOUBLE;
-    opt6->required = NO;
-    opt6->answer = "10000";
-    opt6->options = "0-5000000";	/* observer can be in a plane, too */
-    opt6->description = _("Maximum distance from the viewing point (meters)");
-    /* http://mintaka.sdsu.edu/GF/explain/atmos_refr/horizon.html */
-
-    curvature = G_define_flag();
-    curvature->key = 'c';
-    curvature->description =
-	_("Consider earth curvature (current ellipsoid)");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    /* initialize delayed point deletion */
-    DELAYED_DELETE =  NULL;
-
-    G_scan_easting(opt3->answers[0], &east, G_projection());
-    G_scan_northing(opt3->answers[1], &north, G_projection());
-
-    sscanf(opt5->answer, "%lf", &obs_elev);
-    sscanf(opt6->answer, "%lf", &max_dist);
-    elev_layer = opt1->answer;
-    patt_layer = opt2->answer;
-    out_layer = opt7->answer;
-
-    G_get_window(&window);
-
-    current_mapset = G_mapset();
-    /* set flag to indicate presence of areas of interest   */
-    if (patt_layer == NULL)
-	patt_flag = FALSE;
-    else
-	patt_flag = TRUE;
-
-    if ((G_projection() == PROJECTION_LL))
-	G_fatal_error(_("Lat/Long support is not (yet) implemented for this module."));
-
-    /* check if specified observer location inside window   */
-    if (east < window.west || east > window.east
-	|| north > window.north || north < window.south)
-	G_fatal_error(_("Specified observer coordinate is outside current region bounds."));
-
-    search_mapset = "";
-    old_mapset = G_find_raster2(elev_layer, search_mapset);
-
-    /*  check if elevation layer present in database    */
-    if (old_mapset == NULL)
-	G_fatal_error(_("Raster map <%s> not found"), elev_layer);
-
-    /* if pattern layer used, check if present in database  */
-    if (patt_flag == TRUE) {
-	patt_mapset = G_find_raster(patt_layer, search_mapset);
-	if (patt_mapset == NULL)
-	    G_fatal_error(_("Raster map <%s> not found"), patt_layer);
-    }
-
-    /*  read header info for elevation layer        */
-    Rast_get_cellhd(elev_layer, old_mapset, &cellhd_elev);
-
-    /*  if pattern layer present, read in its header info   */
-    if (patt_flag == TRUE) {
-	Rast_get_cellhd(patt_layer, patt_mapset, &cellhd_patt);
-
-	/*  allocate buffer space for row-io to layer           */
-	cell = Rast_allocate_buf(CELL_TYPE);
-    }
-
-    /*  allocate buffer space for row-io to layer           */
-    fcell = Rast_allocate_buf(FCELL_TYPE);
-
-    /*  find number of rows and columns in elevation map    */
-    nrows = Rast_window_rows();
-    ncols = Rast_window_cols();
-
-    /*      open elevation overlay file for reading         */
-    old = Rast_open_old(elev_layer, old_mapset);
-
-    /*      open cell layer for writing output              */
-    new = Rast_open_new(out_layer, FCELL_TYPE);
-
-    /* if pattern layer specified, open it for reading      */
-    if (patt_flag == TRUE) {
-	patt = Rast_open_old(patt_layer, patt_mapset);
-	if (Rast_get_map_type(patt) != CELL_TYPE)
-	    G_fatal_error(_("Pattern map should be a binary 0/1 CELL map"));
-    }
-
-    /*      parameters for map submatrices                  */
-    lenth_data_item = sizeof(FCELL);
-    submatrix_rows = nrows / 4 + 1;
-    submatrix_cols = ncols / 4 + 1;
-
-    /* create segmented format files for elevation layer,   */
-    /* output layer and pattern layer (if present)          */
-    in_name = G_tempfile();
-    in_fd = creat(in_name, 0666);
-    segment_format(in_fd, nrows, ncols,
-		   submatrix_rows, submatrix_cols, lenth_data_item);
-    close(in_fd);
-    out_name = G_tempfile();
-    out_fd = creat(out_name, 0666);
-    segment_format(out_fd, nrows, ncols,
-		   submatrix_rows, submatrix_cols, lenth_data_item);
-    close(out_fd);
-
-    if (patt_flag == TRUE) {
-	patt_name = G_tempfile();
-	patt_fd = creat(patt_name, 0666);
-	segment_format(patt_fd, nrows, ncols,
-		       submatrix_rows, submatrix_cols, sizeof(CELL));
-	close(patt_fd);
-    }
-
-    if (curvature->answer) {
-	/* try to get the radius the standard GRASS way from the libs */
-	G_get_ellipsoid_parameters(&aa, &e2);
-	if (aa == 0) {
-	    /* since there was a problem, take a hardcoded radius :( */
-	    G_warning(_("Problem to obtain current ellipsoid parameters, using sphere (6370997.0)"));
-	    aa = 6370997.00;
-	}
-	G_debug(3, "radius: %f", aa);
-    }
-    G_message(_("Using maximum distance from the viewing point (meters): %f"),
-	      max_dist);
-
-    /*      open, initialize and segment all files          */
-    in_fd = open(in_name, 2);
-    segment_init(&seg_in, in_fd, 4);
-    out_fd = open(out_name, 2);
-    segment_init(&seg_out, out_fd, 4);
-
-    if (patt_flag == TRUE) {
-	patt_fd = open(patt_name, 2);
-	segment_init(&seg_patt, patt_fd, 4);
-	for (row = 0; row < nrows; row++) {
-	    Rast_get_row(patt, cell, row, CELL_TYPE);
-	    segment_put_row(&seg_patt, cell, row);
-	}
-    }
-
-    for (row = 0; row < nrows; row++) {
-	Rast_get_row(old, fcell, row, FCELL_TYPE);
-	segment_put_row(&seg_in, fcell, row);
-    }
-
-    /* calc map array coordinates for viewing point         */
-    row_viewpt = (window.north - north) / window.ns_res;
-    col_viewpt = (east - window.west) / window.ew_res;
-
-    /*       read elevation of viewing point                */
-    value = &viewpt_elev;
-    segment_get(&seg_in, value, row_viewpt, col_viewpt);
-    viewpt_elev += obs_elev;
-
-    /*      DO LOS ANALYSIS FOR SIXTEEN SEGMENTS            */
-    for (segment_no = 1; segment_no <= 16; segment_no++) {
-	sign_on_y = 1 - (segment_no - 1) / 8 * 2;
-
-	if (segment_no > 4 && segment_no < 13)
-	    sign_on_x = -1;
-	else
-	    sign_on_x = 1;
-
-	/*      calc slopes for bounding rays of a segment      */
-	if (segment_no == 1 || segment_no == 4 || segment_no == 5 ||
-	    segment_no == 8 || segment_no == 9 || segment_no == 12 ||
-	    segment_no == 13 || segment_no == 16) {
-	    slope_1 = 0.0;
-	    slope_2 = 0.5;
-	}
-	else {
-	    slope_1 = 0.5;
-	    slope_2 = 1.0;
-	}
-
-	if (segment_no == 1 || segment_no == 2 || segment_no == 7 ||
-	    segment_no == 8 || segment_no == 9 || segment_no == 10 ||
-	    segment_no == 15 || segment_no == 16)
-	    flip = 0;
-	else
-	    flip = 1;
-
-	/*      calculate max and min 'x' and 'y'               */
-	a = ((ncols - 1) * (sign_on_x + 1) / 2 - sign_on_x * col_viewpt);
-	b = (1 - sign_on_y) / 2 * (nrows - 1) + sign_on_y * row_viewpt;
-
-	if (flip == 0) {
-	    xmax = a;
-	    ymax = b;
-	}
-	else {
-	    xmax = b;
-	    ymax = a;
-	}
-
-	/*      perform analysis for every segment              */
-	heads[segment_no - 1] = segment(segment_no, xmax, ymax,
-					slope_1, slope_2, flip, sign_on_y,
-					sign_on_x, viewpt_elev, &seg_in,
-					&seg_out, &seg_patt, row_viewpt,
-					col_viewpt, patt_flag,
-					curvature->answer, aa);
-
-	G_percent(segment_no, 16, 5);
-    }				/*      end of for-loop over segments           */
-
-    /* loop over all segment lists to find maximum vertical */
-    /* angle of any point when viewed from observer location */
-    for (segment_no = 1; segment_no <= 16; segment_no++) {
-	SEARCH_PT = heads[segment_no - 1];
-	while (SEARCH_PT != NULL) {
-	    if (fabs(SEARCH_PT_INCLINATION) > max_vert_angle)
-		max_vert_angle = fabs(SEARCH_PT_INCLINATION);
-	    SEARCH_PT = NEXT_SEARCH_PT;
-	}
-    }
-
-    /* calculate factor to be multiplied to every vertical  */
-    /* angle for suitable color variation on output map     */
-    /*    color_factor = decide_color_range(max_vert_angle * 57.3,
-       COLOR_SHIFT, COLOR_MAX);   */
-    color_factor = 1.0;		/* to give true angle? */
-
-    /* mark visible points for all segments on outputmap    */
-    for (segment_no = 1; segment_no <= 16; segment_no++) {
-	mark_visible_points(heads[segment_no - 1], &seg_out,
-			    row_viewpt, col_viewpt, color_factor,
-			    COLOR_SHIFT);
-    }
-
-    /*      mark viewpt on output map                       */
-    data = 180;
-    value = &data;
-    segment_put(&seg_out, value, row_viewpt, col_viewpt);
-
-    /* write pending updates by segment_put() to outputmap  */
-    segment_flush(&seg_out);
-
-    /* convert output submatrices to full cell overlay      */
-    for (row = 0; row < nrows; row++) {
-	int col;
-
-	segment_get_row(&seg_out, fcell, row);
-	for (col = 0; col < ncols; col++)
-	    /* set to NULL if beyond max_dist (0) or blocked view (1) */
-	    if (fcell[col] == 0 || fcell[col] == 1)
-		Rast_set_null_value(&fcell[col], 1, FCELL_TYPE);
-	Rast_put_row(new, fcell, FCELL_TYPE);
-    }
-
-    segment_release(&seg_in);	/* release memory       */
-    segment_release(&seg_out);
-
-    if (patt_flag == TRUE)
-	segment_release(&seg_patt);
-
-    close(in_fd);		/* close all files      */
-    close(out_fd);
-    unlink(in_name);		/* remove temp files as well */
-    unlink(out_name);
-    Rast_close(old);
-    Rast_close(new);
-
-    if (patt_flag == TRUE) {
-	close(patt_fd);
-	Rast_close(patt);
-    }
-
-    /*      create category file for output map             */
-    Rast_read_cats(out_layer, current_mapset, &cats);
-    Rast_set_cats_fmt("$1 degree$?s", 1.0, 0.0, 0.0, 0.0, &cats);
-    Rast_write_cats(out_layer, &cats);
-
-    sprintf(title, "Line of sight %.2fm above %s", obs_elev, opt3->answer);
-    Rast_put_cell_title(out_layer, title);
-    Rast_write_units(out_layer, "degrees");
-
-    Rast_short_history(out_layer, "raster", &history);
-    Rast_command_history(&history);
-    Rast_write_history(out_layer, &history);
-
-    /* release that last tiny bit of memory ... */
-    if ( DELAYED_DELETE != NULL ) {
-        G_free ( DELAYED_DELETE );
-    }
-
-    exit(EXIT_SUCCESS);
-}

+ 0 - 56
raster/r.los/make_list.c

@@ -1,56 +0,0 @@
-
-/****************************************************************
- *								*
- *	make_list.c	in	~/src/Glos			*
- *								*
- *	This function adds a new point to the point list	*
- *	for any segment of the map.				*
- *								*
- ****************************************************************/
-
-#include <stdlib.h>
-#include <math.h>
-#include <grass/segment.h>
-#include <grass/gis.h>
-#include "point.h"
-#include "local_proto.h"
-
-#define		NEXT_PT		PRESENT_PT->next
-
-struct point *make_list(struct point *head, int y, int x,
-			SEGMENT * seg_in_p, int viewpt_elev,
-			int quadrant, int row_viewpt, int col_viewpt,
-			int docurv, double ellps_a)
-{
-    double del_x, del_y, dist, orientation, inclination;
-    static struct point *PRESENT_PT;
-    extern struct Cell_head window;
-    extern double max_dist;
-
-    del_x = abs(x);
-    del_y = abs(y);
-
-    dist = sqrt(del_x * del_x + del_y * del_y) * window.ns_res;
-
-    /* if distance from viewpt is greater than the max      */
-    /*   range specified, neglect that point                */
-    if (dist > max_dist)
-	return (head);
-
-    /* otherwise find orientation and inclination           */
-    orientation = find_orientation(x, y, quadrant);
-    inclination = find_inclination(x, y, viewpt_elev, seg_in_p,
-				   row_viewpt, col_viewpt, docurv, ellps_a);
-
-    if (head == NULL) {		/*  first point ?           */
-	head = make_point(orientation, inclination, y, x);
-	PRESENT_PT = head;
-    }
-    else {			/*      add new point to tail of list           */
-	NEXT_PT = make_point(orientation, inclination, y, x);
-	PRESENT_PT = NEXT_PT;
-    }
-
-    return (head);
-
-}

+ 0 - 40
raster/r.los/make_point.c

@@ -1,40 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      make_point.c    in      ~/src/Glos                      */
-/*                                                              */
-/*      This function allocates memory space for a new point,   */
-/*      initializes the various fields using the values of      */
-/*      the parameters passed and returns the address of this   */
-/*      new point so that it could be attached in the linked    */
-/*      list.                                                   */
-/*                                                              */
-
-/****************************************************************/
-
-#include <grass/gis.h>
-#include "point.h"
-
-/* #define NULL 0  should be (char *0), or just let the compiler fix it. */
-
-#define		NEW_PT_X		NEW_PT->x
-#define		NEW_PT_Y		NEW_PT->y
-#define		NEW_PT_ORIENTATION	NEW_PT->orientation
-#define		NEW_PT_INCLINATION	NEW_PT->inclination
-#define		NEXT_NEW_PT		NEW_PT->next
-
-struct point *make_point(double orientation, double inclination, int y, int x)
-{
-    struct point *NEW_PT;
-
-    NEW_PT = (struct point *)G_malloc(sizeof(struct point));
-    NEW_PT_ORIENTATION = orientation;
-    NEW_PT_INCLINATION = inclination;
-    NEW_PT_Y = y;
-    NEW_PT_X = x;
-    NEXT_NEW_PT = NULL;
-
-    return (NEW_PT);
-}
-
-/********* END OF FUNCTION "MAKE_POINT" *************************/

+ 0 - 50
raster/r.los/mark_pts.c

@@ -1,50 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      mark_visible_points.c   in      ~/src/Glos              */
-/*                                                              */
-/*      This function marks all points that are visible in      */
-/*      any one segment on the outputmap                        */
-/*                                                              */
-
-/****************************************************************/
-
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/segment.h>
-#include "point.h"
-
-#define		PT_TO_MARK_X		PT_TO_MARK->x
-#define		PT_TO_MARK_Y		PT_TO_MARK->y
-#define		NEXT_PT_TO_MARK		PT_TO_MARK->next
-#define		PT_TO_MARK_INCL		PT_TO_MARK->inclination
-
-int
-mark_visible_points(struct point *head, SEGMENT * seg_out_p, int row_viewpt,
-		    int col_viewpt, double color_factor, double COLOR_SHIFT)
-{
-    struct point *PT_TO_MARK;
-    FCELL data;
-
-    PT_TO_MARK = head;
-
-    while (PT_TO_MARK != NULL) {	/*        loop till end of list   */
-	segment_get(seg_out_p, &data,
-		    row_viewpt - PT_TO_MARK_Y, PT_TO_MARK_X + col_viewpt);
-
-	if (data != (FCELL) 1) {	/* point has not been deleted previously        */
-	    /* old value    
-	       data = (FCELL ) (PT_TO_MARK_INCL* 57.3 * color_factor 
-	       + COLOR_SHIFT);
-	       end of old data      */
-	    data = (FCELL) (PT_TO_MARK_INCL * 57.325 + 90.0);
-	    segment_put(seg_out_p, &data,
-			row_viewpt - PT_TO_MARK_Y, PT_TO_MARK_X + col_viewpt);
-	}
-
-	PT_TO_MARK = NEXT_PT_TO_MARK;	/* next visible point   */
-    }
-    return 0;
-}
-
-/********* END OF FUNCTION "MARK_VISIBLE_POINTS" ****************/

+ 0 - 60
raster/r.los/point.h

@@ -1,60 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      point.h         in      ~/src/Glos                      */
-/*                                                              */
-/*      This header file defines the data structure of a        */
-/*      point (structure containing various attributes of       */
-/*      a grid cell).                                           */
-/*                                                              */
-
-/****************************************************************/
-
-struct point
-{
-
-    double orientation;
-    /* horizontal angle(degrees) measured from +ve x-axis   */
-
-    double inclination;
-    /* vertical angle(degrees) from the viewing point       */
-
-    int x;			/* x-coor measured from viewing point location  */
-    int y;			/* y-coor measured from viewing point location  */
-
-    struct point *next;		/* pointer to next point in list */
-    struct point *previous;	/* ptr to previous pt. in list  */
-
-};
-
-/* make_point.c */
-struct point *make_point(double, double, int, int);
-
-#ifdef GRASS_SEGMENT_H
-/* delete.c */
-struct point *delete(struct point *, struct point *, SEGMENT *, int, int);
-
-/* make_list.c */
-struct point *make_list(struct point *, int, int, SEGMENT *, int, int, int,
-			int, int, double);
-/* mark_pts.c */
-int mark_visible_points(struct point *, SEGMENT *, int, int, double, double);
-
-/* pts_elim.c */
-struct point *hidden_point_elimination(struct point *, int, SEGMENT *,
-				       SEGMENT *, SEGMENT *, int, int, int,
-				       int, int, int, int, double);
-/* segment.c */
-struct point *segment(int, int, int, double, double,
-		      int, int, int, int, SEGMENT *, SEGMENT *, SEGMENT *,
-		      int, int, int, int, double);
-/* 	
-	For delayed deletion of points (see delete3.c).
-	Initially set to NULL in main.c.
-*/
-
-extern struct point *DELAYED_DELETE;
-
-#endif
-
-/****************************************************************/

+ 0 - 313
raster/r.los/pts_elim.c

@@ -1,313 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      hidden_pts_elimination.c        in      ~/src/Glos      */
-/*                                                              */
-/*      This function prunes a linked list of all points        */
-/*      picked up from a map segment to leave only those        */
-/*      points in the list that are visible from the viewpt.    */
-/*                                                              */
-
-/****************************************************************/
-
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/segment.h>
-#include <grass/glocale.h>
-#include "point.h"
-#include "radians.h"
-#include "local_proto.h"
-
-#define	  SECOND_PT			head->next
-
-#define   NEXT_BLOCKING_PT		BLOCKING_PT->next
-#define   BLOCKING_PT_X	 		BLOCKING_PT->x
-#define   BLOCKING_PT_Y			BLOCKING_PT->y
-#define   BLOCKING_PT_INCLINATION 	BLOCKING_PT->inclination
-#define   BLOCKING_PT_ORIENTATION	BLOCKING_PT->orientation
-
-#define   NEXT_CHECKED_PT		CHECKED_PT->next
-#define	  CHECKED_PT_X			CHECKED_PT->x
-#define	  CHECKED_PT_Y			CHECKED_PT->y
-#define	  CHECKED_PT_INCLINATION	CHECKED_PT->inclination
-#define   CHECKED_PT_ORIENTATION	CHECKED_PT->orientation
-
-
-/****************************************************************/
-/*                                                              */
-/*      This function takes a linked list of points picked      */
-/*      up from a segment of the map and deletes all the points */
-/*      from the list that are not visible from the viewing pt. */
-/*                                                              */
-
-/****************************************************************/
-
-struct point *hidden_point_elimination(struct point *head, int viewpt_elev,
-				       SEGMENT * seg_in_p,
-				       SEGMENT * seg_out_p,
-				       SEGMENT * seg_patt_p, int quadrant,
-				       int sign_on_y, int sign_on_x,
-				       int row_viewpt, int col_viewpt,
-				       int patt_flag, int docurv,
-				       double ellps_a)
-{
-    struct point *CHECKED_PT, *BLOCKING_PT;
-    double orientation_neighbor_1, orientation_neighbor_2,
-	inclination_neighbor_1,
-	inclination_neighbor_2, interpolated_inclination,
-	correct_neighbor_inclination, correct_neighbor_orientation;
-    int correct_neighbor_x, correct_neighbor_y, neighbor_1_y,
-	neighbor_1_x, neighbor_2_x, neighbor_2_y, uu, vv;
-    CELL mask;
-
-    uu = (sign_on_y + sign_on_x) / 2;
-    vv = (sign_on_y - sign_on_x) / 2;
-
-    /* move blocking pt. from the 2nd pt till the end       */
-    for (BLOCKING_PT = SECOND_PT;
-	 BLOCKING_PT != NULL; BLOCKING_PT = NEXT_BLOCKING_PT) {
-	/* calc coors of the two immediate neighbors on either  */
-	/* side of the blocking point                           */
-
-	if (BLOCKING_PT_X == 0 || BLOCKING_PT_Y == 0) {
-	    neighbor_1_x = BLOCKING_PT_X - vv;
-	    neighbor_1_y = BLOCKING_PT_Y + uu;
-
-	    neighbor_2_x = BLOCKING_PT_X + uu;
-	    neighbor_2_y = BLOCKING_PT_Y + vv;
-	}
-	else {
-	    neighbor_1_x = BLOCKING_PT_X - uu;
-	    neighbor_1_y = BLOCKING_PT_Y - vv;
-
-	    neighbor_2_x = BLOCKING_PT_X + vv;
-	    neighbor_2_y = BLOCKING_PT_Y - uu;
-	}
-
-	/* find orientation and inclination for both neighbors  */
-	orientation_neighbor_1 =
-	    find_orientation(neighbor_1_x, neighbor_1_y, quadrant);
-
-	orientation_neighbor_2 =
-	    find_orientation(neighbor_2_x, neighbor_2_y, quadrant);
-
-	inclination_neighbor_1 =
-	    find_inclination(neighbor_1_x, neighbor_1_y, viewpt_elev,
-			     seg_in_p, row_viewpt, col_viewpt, docurv,
-			     ellps_a);
-
-	inclination_neighbor_2 =
-	    find_inclination(neighbor_2_x, neighbor_2_y, viewpt_elev,
-			     seg_in_p, row_viewpt, col_viewpt, docurv,
-			     ellps_a);
-
-
-	/* check all points behind the blocking point           */
-	for (CHECKED_PT = head;
-	     CHECKED_PT != BLOCKING_PT; CHECKED_PT = NEXT_CHECKED_PT) {
-
-	    /* if pattern layer specified, check to see if checked  */
-	    /* point is of interest. If not, delete it from list    */
-	    if (patt_flag == 1) {
-		segment_get(seg_patt_p, &mask,
-			    row_viewpt - CHECKED_PT_Y,
-			    col_viewpt + CHECKED_PT_X);
-
-		if (mask == 0 || Rast_is_null_value(&mask, CELL_TYPE)) {
-		    head = delete(CHECKED_PT, head, seg_out_p,
-				  row_viewpt, col_viewpt);
-		    goto next_iter;
-		}
-	    }
-
-
-	    if (BLOCKING_PT_INCLINATION <= CHECKED_PT_INCLINATION) ;	/*      no need for checking for blocking       */
-	    else {		/*      otherwise, proceed to check             */
-
-
-		/* if checked point directly behind, delete it          */
-		if (CHECKED_PT_ORIENTATION == BLOCKING_PT_ORIENTATION) {
-		    head = delete(CHECKED_PT, head, seg_out_p,
-				  row_viewpt, col_viewpt);
-		}
-		else {		/* if checked point not directly behind, check  */
-
-		    /* find the coors of the actual neighbor that might be  */
-		    /* required for interpolation.                          */
-		    if (CHECKED_PT_ORIENTATION > BLOCKING_PT_ORIENTATION) {
-			correct_neighbor_x = neighbor_1_x;
-			correct_neighbor_y = neighbor_1_y;
-			correct_neighbor_inclination = inclination_neighbor_1;
-			correct_neighbor_orientation = orientation_neighbor_1;
-		    }
-		    else {
-			correct_neighbor_x = neighbor_2_x;
-			correct_neighbor_y = neighbor_2_y;
-			correct_neighbor_inclination = inclination_neighbor_2;
-			correct_neighbor_orientation = orientation_neighbor_2;
-		    }
-
-		    if (fabs(BLOCKING_PT_ORIENTATION - CHECKED_PT_ORIENTATION)
-			<
-			fabs(BLOCKING_PT_ORIENTATION -
-			     correct_neighbor_orientation))
-		    {		/* yes, the point neighboring the blocking point      */
-			/* must be taken into consideration                     */
-
-			if (CHECKED_PT_Y == correct_neighbor_y && CHECKED_PT_X == correct_neighbor_x) ;	/* same point   */
-
-			else {	/*        CHECK !!                                */
-
-
-			    /* if the checked point's inclination is even lower     */
-			    /* than that of the blocking pt.'s neighbor, blocked    */
-			    if (CHECKED_PT_INCLINATION <
-				correct_neighbor_inclination) {
-				head =
-				    delete(CHECKED_PT, head, seg_out_p,
-					   row_viewpt, col_viewpt);
-			    }
-
-			    else {	/*       INTERPOLATION                          */
-
-
-				interpolated_inclination =
-				    BLOCKING_PT_INCLINATION +
-				    (CHECKED_PT_ORIENTATION -
-				     BLOCKING_PT_ORIENTATION) /
-				    (correct_neighbor_orientation -
-				     BLOCKING_PT_ORIENTATION) *
-				    (correct_neighbor_inclination -
-				     BLOCKING_PT_INCLINATION);
-
-				if (CHECKED_PT_INCLINATION < interpolated_inclination) {	/*      interpolated point blocks               */
-				    /* code folded from here */
-				    head = delete(CHECKED_PT, head, seg_out_p,
-						  row_viewpt, col_viewpt);
-				    /* unfolding */
-				}
-			    }
-			}
-		    }
-		}
-	    }
-	  next_iter:
-	    ;
-	}			/* end of loop over points to be checked        */
-
-	/* if pattern layer specified, check if blocking point  */
-	/* itself is an area of interest. If not, of no use     */
-	if (patt_flag == 1) {
-	    segment_get(seg_patt_p, &mask, row_viewpt - BLOCKING_PT_Y,
-			col_viewpt + BLOCKING_PT_X);
-	    if (mask == 0 || Rast_is_null_value(&mask, CELL_TYPE)) {
-	    
-	      /* Commenting out the following fixes a bug in r.los.
-		 In that program the 8 cells around the viewpoint
-		 are marked as visible (when visible)
-		 even if they fall outside the area of interest 
-		 specified by the patt_map.  This occurs because
-		 these cells are always the last blocking points
-		 on the segment lists, and therefore don't get 
-		 deleted when they should.  This fix allows them
-		 to be deleted, but it required modifications
-		 to delete.c.  MWL 25/6/99 */	    
-	    
-		/* if (NEXT_BLOCKING_PT != NULL) */
-		
-		    head = delete(BLOCKING_PT, head, seg_out_p,
-				  row_viewpt, col_viewpt);
-	    }
-	}
-
-    }				/* end of loop over blocking points             */
-
-    return (head);
-
-}
-
-/*********** END OF FUNCTION "HIDDEN_POINT_ELIMINATION" *********/
-
-
-
-
-/****************************************************************/
-/*                                                              */
-/*      This function finds the orientation of a point if       */
-/*      provided with the number of the quadrant and the        */
-/*      coordinates of that point.                              */
-/*                                                              */
-
-/****************************************************************/
-
-double find_orientation(int x, int y, int quadrant)
-{
-    double del_x, del_y, atan(), angle;
-    int abs();
-
-    del_x = abs(x);
-    del_y = abs(y);
-
-    if (del_x == 0.0)
-	angle = PIBYTWO;
-    else
-	angle = atan(del_y / del_x);
-
-    switch (quadrant) {
-    case 1:
-	break;
-    case 2:
-	angle = PI - angle;
-	break;
-    case 3:
-	angle = PI + angle;
-	break;
-    case 4:
-	angle = TWOPI - angle;
-	break;
-    default:
-	break;
-    }
-
-    return (angle);
-
-}				/* END OF FUNCTION ANGLE */
-
-/************* END OF FUNCTION "FIND_ORIENTATION" ***************/
-
-
-
-
-/****************************************************************/
-/*                                                              */
-/*      This function calculates the vertical angle of a point  */
-/*      with respect to the viewing pt.                         */
-/*                                                              */
-
-/****************************************************************/
-
-double
-find_inclination(int x, int y, int viewpt_elev, SEGMENT * seg_in_p,
-		 int row_viewpt, int col_viewpt, int docurv, double ellps_a)
-
-{
-    double del_x, del_y, dist;
-    int abs();
-    FCELL picked_pt_elev;
-    extern struct Cell_head window;
-
-    del_x = abs(x);
-    del_y = abs(y);
-
-    dist = sqrt(del_x * del_x + del_y * del_y) * window.ns_res;
-
-    segment_get(seg_in_p, &picked_pt_elev, row_viewpt - y, x + col_viewpt);
-
-    if (docurv)			/* decrease height of target point */
-	picked_pt_elev = picked_pt_elev - ((dist * dist) / (2 * ellps_a));
-
-    return (atan((picked_pt_elev - viewpt_elev) / dist));
-}
-
-/************ END OF FUNCTION "FIND_INCLINATION"*****************/

+ 0 - 89
raster/r.los/r.los.html

@@ -1,89 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>r.los</em> generates a raster output map in which the cells that are
-visible from a user-specified observer position are marked with the
-vertical angle (in degrees) required to see those cells (viewshed).
-A value of 0 is directly below the specified viewing position,
-90 is due horizontal, and 180 is directly above the observer.
-The angle to the cell containing the viewing position is undefined
-and set to 180.
-
-<p>To run <em>r.los</em>, the user must specify at least 
-an <b>input</b> map name, <b>output</b> map name, and the geographic 
-<b>coordinate</b>s of the user's viewing location; 
-any remaining parameters whose values are unspecified 
-will be set to their default values (see below). 
-
-<p>The <b>patt_map</b> is the name of a binary (1/0) raster map layer in which
-cells within the areas of interest are assigned the category value '1', and
-all other cells are assigned the category value '0' or NULL. If this parameter is
-omitted, the analysis will be performed for the whole area within a certain
-distance of the viewing point inside the geographic region boundaries.
-<br>
-Default: assign all cells that are within the <b>max_dist</b> and within
-the user's current geographic region boundaries a value of 1.
-
-<p>The <b>obs_elev</b> parameter defines the height of the observer (in
-meters) above the viewing point's elevation.
-<p>
-The <b>max_dist</b> parameter is the maximum distance (in meters) from the
-viewing point inside of which the line of sight analysis will be performed.
-The cells outside this distance range are assigned a NULL value.
-
-
-<h2>NOTES</h2>
-
-For accurate results, the program must be run with the resolution of the 
-geographic region set equal to the resolution of the data 
-(see <em><a href="g.region.html">g.region</a></em>).
-
-<p>The time to complete the calculation increases dramatically with the region size.
-Try to keep the columns and rows under 1000.
-
-<p>It is advisable to use a 'pattern layer' which identifies
-the areas of interest in which the line of sight analysis
-is required.  Such a measure will reduce the time taken by
-the program to run.
-
-<p>The curvature of the Earth is not taken into account for these calculations.
-However, for interest's sake, a handy calculation for distance to the true horizon
-is approximated by <i>d = sqrt(13*h)</i> where <i>h</i> is the height of the observer
-in meters (above sea level) and <i>d</i> is the distance to the horizon in km.
-This may be useful for setting the <b>max_dist</b> value.
-
-
-<h2>EXAMPLE</h2>
-
-Spearfish example - calculation of viewshed from 50m tower
-on top of a mountain:
-
-<div class="code"><pre>
-g.region rast=elevation.dem -p
-r.los elevation.dem out=los coord=598869,4916642 obs_elev=50 max_dist=10000
-r.colors -e los color=bgyr
-d.shadedmap relief=aspect drape=los bright=10
-echo "symbol extra/target 25 598869 4916642 red" | d.graph -m
-</pre></div>
-
-<h2>TODO</h2>
-
-a) Rewrite using ideas from <em>r.cva</em> and a method which scales better
-to large regions.<br>A suggested method is detailed in:<br>
-Izraelevitz, David (USACE).<br>
-'A Fast Algorithm for Approximate Viewshed Computation'<br>
-<i>Photogrammetric Engineering & Remote Sensing</i>, July 2003
-<!-- http://article.gmane.org/gmane.comp.gis.grass.devel/1781
-  Post by Paul Kelly 2003-08-13 to grass-dev, 
-  "Re: [bug #2061] (grass) r.los needs FP update" -->
-
-b) or fix r.viewshed in Addons
-
-<h2>SEE ALSO</h2>
-
-<em><a href="g.region.html">g.region</a></em>
-
-<h2>AUTHOR</h2>
-
-Kewan Q. Khawaja, Intelligent Engineering Systems Laboratory, M.I.T.
-
-<p><i>Last changed: $Date$</i>

+ 0 - 20
raster/r.los/radians.h

@@ -1,20 +0,0 @@
-
-/****************************************************************/
-/*                                                              */
-/*      radians.h       in ~/src/Glos                           */
-/*                                                              */
-/*      This header file defines the syntactic sugar to be      */
-/*      used for some prominent radian measures.                */
-/*                                                              */
-
-/****************************************************************/
-
-#include <grass/gis.h>
-
-#define		PI		M_PI
-#define		PIBYFOUR 	M_PI_4
-#define		PIBYTWO		M_PI_2
-#define		TWOPI		M_PI * 2.
-#define 	THREEPIBYTWO	M_PI * 3./2.
-
-/****************************************************************/

+ 0 - 90
raster/r.los/segment.c

@@ -1,90 +0,0 @@
-
-/****************************************************************
- *								*
- *	segment.c	in	~/src/Glos			*
- *								*
- *	This function picks up all the points in one segment	*
- *	and performs los analysis on them.			*
- *								*
- ****************************************************************/
-
-#include <grass/segment.h>
-#include "point.h"
-
-#define	  NEXT_PT		PRESENT_PT->next
-#define	  NEXT_PT_BACK_PTR	PRESENT_PT->next->previous
-#define	  HEAD_BACK_PTR		head->previous
-
-struct point *segment(int segment_no, int xmax, int ymax,
-		      double slope_1, double slope_2, int flip,
-		      int sign_on_y, int sign_on_x, int viewpt_elev,
-		      SEGMENT * seg_in_p, SEGMENT * seg_out_p,
-		      SEGMENT * seg_patt_p, int row_viewpt, int col_viewpt,
-		      int patt_flag, int docurv, double ellps_a)
-{
-    int lower_limit_y, upper_limit_y, less, x, y,
-	x_actual, y_actual, x_flip, y_flip;
-    struct point *head = (struct point *)NULL, *PRESENT_PT;
-    int quadrant;
-
-    /*      decide which one of the four quadrants          */
-    quadrant = 1 + (segment_no - 1) / 4;
-
-    if (slope_1 != 0) {
-	less = ymax / slope_1 + 0.99;
-	xmax = (xmax <= less) ? xmax : less;
-    }
-
-    /*      outer loop over x coors for picking up points   */
-    for (x = xmax; x > 0; x--) {
-
-	/*      calculate limits for range of y for a single x  */
-	lower_limit_y = x * slope_1 + 0.9;
-	upper_limit_y = x * slope_2;
-	upper_limit_y = (upper_limit_y <= ymax) ? upper_limit_y : ymax;
-
-	/*      loop over y range to pick up correct points     */
-	for (y = upper_limit_y; y >= lower_limit_y; y--) {
-	    /*  calculate actual x, y that lie in current segment   */
-
-	    if (flip == 0) {
-		x_flip = x;
-		y_flip = y;
-	    }
-	    else {
-		y_flip = x;
-		x_flip = y;
-	    }
-
-	    x_actual = sign_on_x * x_flip;
-	    y_actual = sign_on_y * y_flip;
-
-	    /*      add chosen point to the point list              */
-	    head = make_list(head, y_actual, x_actual, seg_in_p,
-			     viewpt_elev, quadrant, row_viewpt, col_viewpt,
-			     docurv, ellps_a);
-
-	}
-    }				/* end of outer loop */
-
-
-    if (head != NULL) {
-	/*      assign back pointers in linked list             */
-	HEAD_BACK_PTR = NULL;
-	PRESENT_PT = head;
-
-	while (NEXT_PT != NULL) {
-	    NEXT_PT_BACK_PTR = PRESENT_PT;
-	    PRESENT_PT = NEXT_PT;
-	}
-
-	head = hidden_point_elimination(head, viewpt_elev,
-					seg_in_p, seg_out_p, seg_patt_p,
-					quadrant, sign_on_y, sign_on_x,
-					row_viewpt, col_viewpt, patt_flag,
-					docurv, ellps_a);
-    }
-
-    return (head);
-
-}

+ 0 - 1
raster/r.viewshed/r.viewshed.html

@@ -226,7 +226,6 @@ and Combinatorics (ALENEX/ANALCO 2007)</em>.</li>
 <h2>SEE ALSO</h2>
 
 <em>
-<a href="r.los.html">r.los</a>,
 <a href="r.mapcalc.html">r.mapcalc</a>
 </em>
 

+ 0 - 38
raster/r.viewshed/testscript.sh

@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# Test script for r.viewshed based on a synthetic DEM
-# RUN THIS IS ANY GRASS LOCATION, e.g. NC or Spearfish
-
-# create first hemisphere
-g.region n=1000 s=0 w=0 e=1000 -p res=1
-r.mapcalc 'disk.15031=if(sqrt((col() - 500)^2 + (500 - row())^2)<500,sqrt((col() - 500)^2 + (500 - row())^2),null())'
-r.mapcalc 'hemisphere1=500 * sin(acos (disk.15031/500))'
-
-# create second hemisphere
-g.region n=500 s=0 w=0 e=500 -p res=1
-r.mapcalc 'disk.14947=if(sqrt((col() - 500)^2 + (500 - row())^2)<500,sqrt((col() - 500)^2 + (500 - row())^2),null())'
-r.mapcalc 'hemisphere2=500 * sin(acos (disk.14947/500))'
-g.remove --q rast=disk.14947,disk.15031
-# merge both
-r.mapcalc "hemisphere=hemisphere1 + hemisphere2"
-
-d.mon x0
-d.rast hemisphere
-
-# run r.viewshed
-r.viewshed hemisphere out=hemisphere_viewshed coord=250,250 max=1000000 obs=100 mem=2000 --o
-r.shaded.relief hemisphere --o
-d.his h=hemisphere_viewshed i=hemisphere.shade
-
-# compare to r.los
-r.los hemisphere out=hemisphere_los coord=250,250 max=1000000 obs=100 --o
-d.mon x1
-d.his h=hemisphere_los i=hemisphere.shade
-
-r.mapcalc "hemisphere_diff = hemisphere_viewshed - hemisphere_los"
-r.colors hemisphere_diff color=differences
-d.mon x2
-d.rast.leg pos=80 map=hemisphere_diff
-
-nviz hemisphere col=hemisphere_viewshed
-