Преглед на файлове

write out metadata; whitespace/msg cleanup (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38686 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman преди 15 години
родител
ревизия
ad979eab6e
променени са 2 файла, в които са добавени 99 реда и са изтрити 86 реда
  1. 86 83
      raster/r.horizon/main.c
  2. 13 3
      raster/r.horizon/r.horizon.html

+ 86 - 83
raster/r.horizon/main.c

@@ -50,7 +50,7 @@ Joint Research Centre of the European Commission, based on bits of the r.sun mod
 #define SMALL    1.e-20
 #define SMALL    1.e-20
 #define EPS      1.e-4
 #define EPS      1.e-4
 #define DIST     "1.0"
 #define DIST     "1.0"
-#define DEGREEINMETERS 111120.
+#define DEGREEINMETERS 111120.	/* 1852m/nm * 60nm/degree = 111120 m/deg */
 #define TANMINANGLE 0.008727	/* tan of minimum horizon angle (0.5 deg) */
 #define TANMINANGLE 0.008727	/* tan of minimum horizon angle (0.5 deg) */
 
 
 #define AMAX1(arg1, arg2) ((arg1) >= (arg2) ? (arg1) : (arg2))
 #define AMAX1(arg1, arg2) ((arg1) >= (arg2) ? (arg1) : (arg2))
@@ -72,7 +72,7 @@ const char *latin = NULL;
 const char *horizon = NULL;
 const char *horizon = NULL;
 const char *mapset = NULL;
 const char *mapset = NULL;
 const char *per;
 const char *per;
-char shad_filename[256];
+char shad_filename[GNAME_MAX];
 
 
 struct Cell_head cellhd;
 struct Cell_head cellhd;
 struct Key_value *in_proj_info, *in_unit_info;
 struct Key_value *in_proj_info, *in_unit_info;
@@ -109,7 +109,7 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 
 
 int ip, jp, ip100, jp100;
 int ip, jp, ip100, jp100;
 int n, m, m100, n100;
 int n, m, m100, n100;
-int degreeOutput = 0;
+int degreeOutput = FALSE;
 float **z, **z100, **horizon_raster;
 float **z, **z100, **horizon_raster;
 double stepx, stepy, stepxhalf, stepyhalf, stepxy, xp, yp, op, dp, xg0, xx0,
 double stepx, stepy, stepxhalf, stepyhalf, stepxy, xp, yp, op, dp, xg0, xx0,
     yg0, yy0, deltx, delty;
     yg0, yy0, deltx, delty;
@@ -140,9 +140,10 @@ void setMode(int val)
     mode = val;
     mode = val;
 }
 }
 
 
-int ll_correction = 0;
+int ll_correction = FALSE;
 double coslatsq;
 double coslatsq;
 
 
+/* use G_distance() instead ??!?! */
 double distance(double x1, double x2, double y1, double y2)
 double distance(double x1, double x2, double y1, double y2)
 {
 {
     if (ll_correction) {
     if (ll_correction) {
@@ -340,9 +341,8 @@ int main(int argc, char *argv[])
     else {
     else {
 	setMode(SINGLE_POINT);
 	setMode(SINGLE_POINT);
 	if (sscanf(parm.coord->answer, "%lf,%lf", &xcoord, &ycoord) != 2) {
 	if (sscanf(parm.coord->answer, "%lf,%lf", &xcoord, &ycoord) != 2) {
-	    G_fatal_error
-		("Can't read the coordinates from the \"coord\" option.");
-
+	    G_fatal_error(
+		_("Can't read the coordinates from the \"coord\" option."));
 	}
 	}
 
 
 	/* Transform the coordinates to row/column */
 	/* Transform the coordinates to row/column */
@@ -359,15 +359,13 @@ int main(int argc, char *argv[])
 
 
     if (isMode(WHOLE_RASTER)) {
     if (isMode(WHOLE_RASTER)) {
 	if ((parm.direction->answer == NULL) && (parm.step->answer == NULL)) {
 	if ((parm.direction->answer == NULL) && (parm.step->answer == NULL)) {
-	    G_fatal_error
-		(_("You didn't specify a direction value or step size. Aborting."));
+	    G_fatal_error(
+		_("You didn't specify a direction value or step size. Aborting."));
 	}
 	}
 
 
-
 	if (parm.horizon->answer == NULL) {
 	if (parm.horizon->answer == NULL) {
-	    G_fatal_error
-		(_("You didn't specify a horizon raster name. Aborting."));
-
+	    G_fatal_error(
+		_("You didn't specify a horizon raster name. Aborting."));
 	}
 	}
 	horizon = parm.horizon->answer;
 	horizon = parm.horizon->answer;
 	if (parm.step->answer != NULL)
 	if (parm.step->answer != NULL)
@@ -376,9 +374,8 @@ int main(int argc, char *argv[])
     else {
     else {
 
 
 	if (parm.step->answer == NULL) {
 	if (parm.step->answer == NULL) {
-	    G_fatal_error
-		(_("You didn't specify an angle step size. Aborting."));
-
+	    G_fatal_error(
+		_("You didn't specify an angle step size. Aborting."));
 	}
 	}
 	sscanf(parm.step->answer, "%lf", &step);
 	sscanf(parm.step->answer, "%lf", &step);
 
 
@@ -390,43 +387,39 @@ int main(int argc, char *argv[])
     }
     }
 
 
     if (parm.bufferzone->answer != NULL) {
     if (parm.bufferzone->answer != NULL) {
-	if (sscanf(parm.bufferzone->answer, "%lf", &bufferZone) != 1) {
+	if (sscanf(parm.bufferzone->answer, "%lf", &bufferZone) != 1)
 	    G_fatal_error(_("Could not read bufferzone size. Aborting."));
 	    G_fatal_error(_("Could not read bufferzone size. Aborting."));
-	}
     }
     }
 
 
     if (parm.e_buff->answer != NULL) {
     if (parm.e_buff->answer != NULL) {
-	if (sscanf(parm.e_buff->answer, "%lf", &ebufferZone) != 1) {
-	    G_fatal_error(_("Could not read east bufferzone size. Aborting."));
-	}
+	if (sscanf(parm.e_buff->answer, "%lf", &ebufferZone) != 1)
+	    G_fatal_error(_("Could not read %s bufferzone size. Aborting."),
+			  _("east"));
     }
     }
 
 
     if (parm.w_buff->answer != NULL) {
     if (parm.w_buff->answer != NULL) {
-	if (sscanf(parm.w_buff->answer, "%lf", &wbufferZone) != 1) {
-	    G_fatal_error(_("Could not read west bufferzone size. Aborting."));
-	}
+	if (sscanf(parm.w_buff->answer, "%lf", &wbufferZone) != 1)
+	    G_fatal_error(_("Could not read %s bufferzone size. Aborting."),
+			  _("west"));
     }
     }
 
 
     if (parm.s_buff->answer != NULL) {
     if (parm.s_buff->answer != NULL) {
-	if (sscanf(parm.s_buff->answer, "%lf", &sbufferZone) != 1) {
-	    G_fatal_error
-		(_("Could not read south bufferzone size. Aborting."));
-	}
+	if (sscanf(parm.s_buff->answer, "%lf", &sbufferZone) != 1)
+	    G_fatal_error(
+		_("Could not read %s bufferzone size. Aborting."),
+		_("south"));
     }
     }
 
 
-
-
     if (parm.n_buff->answer != NULL) {
     if (parm.n_buff->answer != NULL) {
-	if (sscanf(parm.n_buff->answer, "%lf", &nbufferZone) != 1) {
-	    G_fatal_error
-		(_("Could not read north bufferzone size. Aborting."));
-	}
+	if (sscanf(parm.n_buff->answer, "%lf", &nbufferZone) != 1)
+	    G_fatal_error(
+		_("Could not read %s bufferzone size. Aborting."),
+		_("north"));
     }
     }
 
 
     if (parm.maxdistance->answer != NULL) {
     if (parm.maxdistance->answer != NULL) {
-	if (sscanf(parm.maxdistance->answer, "%lf", &fixedMaxLength) != 1) {
+	if (sscanf(parm.maxdistance->answer, "%lf", &fixedMaxLength) != 1)
 	    G_fatal_error(_("Could not read maximum distance. Aborting."));
 	    G_fatal_error(_("Could not read maximum distance. Aborting."));
-	}
     }
     }
 
 
 
 
@@ -464,10 +457,9 @@ int main(int argc, char *argv[])
 	deltx = fabs(new_cellhd.east - new_cellhd.west);
 	deltx = fabs(new_cellhd.east - new_cellhd.west);
 	delty = fabs(new_cellhd.north - new_cellhd.south);
 	delty = fabs(new_cellhd.north - new_cellhd.south);
 
 
-	n /*n_cols */  = new_cellhd.cols;
-	m /*n_rows */  = new_cellhd.rows;
-	/*G_debug(3,"%lf %lf %lf %lf \n",ymax, ymin, xmin,xmax);
-	 */
+	n /* n_cols */ = new_cellhd.cols;
+	m /* n_rows */ = new_cellhd.rows;
+	/* G_debug(3,"%lf %lf %lf %lf \n",ymax, ymin, xmin,xmax); */
 	n100 = ceil(n / 100.);
 	n100 = ceil(n / 100.);
 	m100 = ceil(m / 100.);
 	m100 = ceil(m / 100.);
 
 
@@ -478,15 +470,16 @@ int main(int argc, char *argv[])
     struct Key_Value *in_proj_info, *in_unit_info;
     struct Key_Value *in_proj_info, *in_unit_info;
 
 
     if ((in_proj_info = G_get_projinfo()) == NULL)
     if ((in_proj_info = G_get_projinfo()) == NULL)
-	G_fatal_error
-	    (_("Can't get projection info of current location: please set latitude via 'lat' or 'latin' option!"));
+	G_fatal_error(
+	    _("Can't get projection info of current location: "
+	      "please set latitude via 'lat' or 'latin' option!"));
 
 
     if ((in_unit_info = G_get_projunits()) == NULL)
     if ((in_unit_info = G_get_projunits()) == NULL)
 	G_fatal_error(_("Can't get projection units of current location"));
 	G_fatal_error(_("Can't get projection units of current location"));
 
 
     if (pj_get_kv(&iproj, in_proj_info, in_unit_info) < 0)
     if (pj_get_kv(&iproj, in_proj_info, in_unit_info) < 0)
-	G_fatal_error
-	    (_("Can't get projection key values of current location"));
+	G_fatal_error(
+	    _("Can't get projection key values of current location"));
 
 
     G_free_key_value(in_proj_info);
     G_free_key_value(in_proj_info);
     G_free_key_value(in_unit_info);
     G_free_key_value(in_unit_info);
@@ -499,8 +492,6 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("Unable to set up lat/long projection parameters"));
 	G_fatal_error(_("Unable to set up lat/long projection parameters"));
 
 
 
 
-
-
 /**********end of parser - ******************************/
 /**********end of parser - ******************************/
 
 
 
 
@@ -516,7 +507,7 @@ int main(int argc, char *argv[])
 	    exit(EXIT_FAILURE);
 	    exit(EXIT_FAILURE);
     }
     }
 
 
-    /*sorry, I've moved OUTGR to calculate() - into the loop */
+    /* sorry, I've moved OUTGR() to calculate() - into the loop */
     /*      if(isMode(WHOLE_RASTER))
     /*      if(isMode(WHOLE_RASTER))
        {
        {
        OUTGR(cellhd.rows,cellhd.cols);
        OUTGR(cellhd.rows,cellhd.cols);
@@ -530,6 +521,7 @@ int main(int argc, char *argv[])
 
 
 /**********************end of main.c*****************/
 /**********************end of main.c*****************/
 
 
+
 int INPUT(void)
 int INPUT(void)
 {
 {
     FCELL *cell1;
     FCELL *cell1;
@@ -570,7 +562,7 @@ int INPUT(void)
     }
     }
     Rast_close(fd1);
     Rast_close(fd1);
 
 
-    /*create low resolution array 100 */
+    /* create low resolution array 100 */
     for (i = 0; i < m100; i++) {
     for (i = 0; i < m100; i++) {
 	lmax = (i + 1) * 100;
 	lmax = (i + 1) * 100;
 	if (lmax > m)
 	if (lmax > m)
@@ -592,11 +584,10 @@ int INPUT(void)
     }
     }
 
 
 
 
-    /*find max Z */
+    /* find max Z */
     for (i = 0; i < m; i++) {
     for (i = 0; i < m; i++) {
 	for (j = 0; j < n; j++) {
 	for (j = 0; j < n; j++) {
 	    zmax = amax1(zmax, z[i][j]);
 	    zmax = amax1(zmax, z[i][j]);
-
 	}
 	}
     }
     }
 
 
@@ -620,10 +611,9 @@ int OUTGR(int numrows, int numcols)
 	cell1 = Rast_allocate_f_buf();
 	cell1 = Rast_allocate_f_buf();
 	fd1 = Rast_open_fp_new(shad_filename);
 	fd1 = Rast_open_fp_new(shad_filename);
 	if (fd1 < 0)
 	if (fd1 < 0)
-	    G_fatal_error(_("Unable to create raster map %s"), shad_filename);
+	    G_fatal_error(_("Unable to create raster map <%s>"), shad_filename);
     }
     }
 
 
-
     if (numrows != G_window_rows())
     if (numrows != G_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), numrows,
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), numrows,
 		      G_window_rows());
 		      G_window_rows());
@@ -644,13 +634,10 @@ int OUTGR(int numrows, int numcols)
 	    }
 	    }
 	    Rast_put_f_row(fd1, cell1);
 	    Rast_put_f_row(fd1, cell1);
 	}
 	}
-
     }				/* End loop over rows. */
     }				/* End loop over rows. */
 
 
     Rast_close(fd1);
     Rast_close(fd1);
 
 
-
-
     return 1;
     return 1;
 }
 }
 
 
@@ -762,7 +749,6 @@ double horizon_height(void)
 
 
 double calculate_shadow_onedirection(double shadow_angle)
 double calculate_shadow_onedirection(double shadow_angle)
 {
 {
-
     shadow_angle = horizon_height();
     shadow_angle = horizon_height();
 
 
     return shadow_angle;
     return shadow_angle;
@@ -971,20 +957,20 @@ int test_low_res()
 	    }
 	    }
 
 
 	    mindel = min(delx, dely);
 	    mindel = min(delx, dely);
-	    /*G_debug(3,"%d %d %d %lf %lf\n",ip, jp, mindel,xg0, yg0);*/
+	    /* G_debug(3,"%d %d %d %lf %lf\n",ip, jp, mindel,xg0, yg0);*/
 
 
 	    yy0 = yy0 + (mindel * stepsinangle);
 	    yy0 = yy0 + (mindel * stepsinangle);
 	    xx0 = xx0 + (mindel * stepcosangle);
 	    xx0 = xx0 + (mindel * stepcosangle);
-	    /*G_debug(3,"  %lf %lf\n",xx0,yy0);*/
+	    /* G_debug(3,"  %lf %lf\n",xx0,yy0);*/
 
 
 	    return (3);
 	    return (3);
 	}
 	}
 	else {
 	else {
-	    return (1);		/*change of low res array - new cell is reaching limit for high resolution processing */
+	    return (1);	/* change of low res array - new cell is reaching limit for high resolution processing */
 	}
 	}
     }
     }
     else {
     else {
-	return (1);		/*no change of low res array */
+	return (1);	/* no change of low res array */
     }
     }
 }
 }
 
 
@@ -1004,9 +990,8 @@ double searching()
 	if (succes != 1) {
 	if (succes != 1) {
 	    break;
 	    break;
 	}
 	}
-	/*
-	   curvature_diff = EARTHRADIUS*(1.-cos(length/EARTHRADIUS));
-	 */
+
+	/* curvature_diff = EARTHRADIUS*(1.-cos(length/EARTHRADIUS)); */
 	curvature_diff = 0.5 * length * length * invEarth;
 	curvature_diff = 0.5 * length * length * invEarth;
 
 
 	z2 = z_orig + curvature_diff + length * tanh0;
 	z2 = z_orig + curvature_diff + length * tanh0;
@@ -1051,7 +1036,7 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
     double delt_dist;
     double delt_dist;
 
 
     char formatString[10];
     char formatString[10];
-
+    char msg_buff[256];
 
 
     int hor_row_start = buffer_s;
     int hor_row_start = buffer_s;
     int hor_row_end = m - buffer_n;
     int hor_row_end = m - buffer_n;
@@ -1069,7 +1054,7 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
     yindex = (int)((ycoord - ymin) / stepy);
     yindex = (int)((ycoord - ymin) / stepy);
 
 
     if ((G_projection() == PROJECTION_LL)) {
     if ((G_projection() == PROJECTION_LL)) {
-	ll_correction = 1;
+	ll_correction = TRUE;
     }
     }
 
 
 
 
@@ -1117,9 +1102,8 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 		    horizon_raster[j][i] = 0.;
 		    horizon_raster[j][i] = 0.;
 	    }
 	    }
 	}
 	}
-	/*
-	   definition of horizon angle in loop
-	 */
+
+	/* definition of horizon angle in loop */
 	if (step == 0.0) {
 	if (step == 0.0) {
 	    dfr_rad = 0;
 	    dfr_rad = 0;
 	    arrayNumInt = 1;
 	    arrayNumInt = 1;
@@ -1138,12 +1122,13 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 
 
 	    if (step != 0.0)
 	    if (step != 0.0)
 		sprintf(shad_filename, formatString, horizon, k);
 		sprintf(shad_filename, formatString, horizon, k);
+
 	    angle = (single_direction * deg2rad) + (dfr_rad * k);
 	    angle = (single_direction * deg2rad) + (dfr_rad * k);
 	    /*              
 	    /*              
 	       com_par(angle);
 	       com_par(angle);
 	     */
 	     */
-	    G_message(_("Calculating map %01d of %01d (angle %lf, raster map <%s>)"), (k + 1), arrayNumInt,
-		   angle * rad2deg, shad_filename);
+	    G_message(_("Calculating map %01d of %01d (angle %.2f, raster map <%s>)"),
+		     (k + 1), arrayNumInt, angle * rad2deg, shad_filename);
 
 
 	    for (j = hor_row_start; j < hor_row_end; j++) {
 	    for (j = hor_row_start; j < hor_row_end; j++) {
 		G_percent(j - hor_row_start, hor_numrows - 1, 2);
 		G_percent(j - hor_row_start, hor_numrows - 1, 2);
@@ -1169,11 +1154,10 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 
 
 
 
 		    if ((G_projection() != PROJECTION_LL)) {
 		    if ((G_projection() != PROJECTION_LL)) {
-
-			if (pj_do_proj(&longitude, &latitude, &iproj, &oproj) <	0) {
+			if (pj_do_proj(&longitude, &latitude, &iproj, &oproj) <	0)
 			    G_fatal_error("Error in pj_do_proj");
 			    G_fatal_error("Error in pj_do_proj");
-			}
 		    }
 		    }
+
 		    latitude *= deg2rad;
 		    latitude *= deg2rad;
 		    longitude *= deg2rad;
 		    longitude *= deg2rad;
 
 
@@ -1183,16 +1167,15 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 			 twopi) ? inputAngle - twopi : inputAngle;
 			 twopi) ? inputAngle - twopi : inputAngle;
 
 
 
 
-		    delt_lat = -0.0001 * cos(inputAngle);	/* Arbitrary small distance in latitude */
+		    delt_lat = -0.0001 * cos(inputAngle);  /* Arbitrary small distance in latitude */
 		    delt_lon = 0.0001 * sin(inputAngle) / cos(latitude);
 		    delt_lon = 0.0001 * sin(inputAngle) / cos(latitude);
 
 
 		    latitude = (latitude + delt_lat) * rad2deg;
 		    latitude = (latitude + delt_lat) * rad2deg;
 		    longitude = (longitude + delt_lon) * rad2deg;
 		    longitude = (longitude + delt_lon) * rad2deg;
 
 
 		    if ((G_projection() != PROJECTION_LL)) {
 		    if ((G_projection() != PROJECTION_LL)) {
-			if (pj_do_proj(&longitude, &latitude, &oproj, &iproj) < 0) {
+			if (pj_do_proj(&longitude, &latitude, &oproj, &iproj) < 0)
 			    G_fatal_error("Error in pj_do_proj");
 			    G_fatal_error("Error in pj_do_proj");
-			}
 		    }
 		    }
 
 
 		    delt_east = longitude - xp;
 		    delt_east = longitude - xp;
@@ -1228,11 +1211,12 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 		    maxlength =
 		    maxlength =
 			(maxlength <
 			(maxlength <
 			 fixedMaxLength) ? maxlength : fixedMaxLength;
 			 fixedMaxLength) ? maxlength : fixedMaxLength;
+
 		    if (z_orig != UNDEFZ) {
 		    if (z_orig != UNDEFZ) {
 
 
-			/*G_debug(3,"**************new line %d %d\n", i, j);
-			 */
+			/* G_debug(3,"**************new line %d %d\n", i, j); */
 			shadow_angle = horizon_height();
 			shadow_angle = horizon_height();
+
 			if (degreeOutput) {
 			if (degreeOutput) {
 			    shadow_angle *= rad2deg;
 			    shadow_angle *= rad2deg;
 			}
 			}
@@ -1247,7 +1231,7 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 			horizon_raster[j - buffer_s][i - buffer_w] =
 			horizon_raster[j - buffer_s][i - buffer_w] =
 			    shadow_angle;
 			    shadow_angle;
 
 
-		    }		/* undefs */
+		    }	/* undefs */
 		}
 		}
 	    }
 	    }
 
 
@@ -1259,19 +1243,38 @@ void calculate(double xcoord, double ycoord, int buffer_e, int buffer_w,
 		    horizon_raster[j][i] = 0.;
 		    horizon_raster[j][i] = 0.;
 	    }
 	    }
 
 
-	    /*return back the buffered region */
+	    /* return back the buffered region */
 	    if (bufferZone > 0.) {
 	    if (bufferZone > 0.) {
 		if (Rast_set_window(&new_cellhd) == -1)
 		if (Rast_set_window(&new_cellhd) == -1)
 		    exit(0);
 		    exit(0);
 	    }
 	    }
 
 
+	    /* write metadata */
 	    Rast_short_history(shad_filename, "raster", &history);
 	    Rast_short_history(shad_filename, "raster", &history);
+
+	    sprintf(msg_buff,
+		    "Angular height of terrain horizon, map %01d of %01d",
+		    (k + 1), arrayNumInt);
+	    Rast_put_cell_title(shad_filename, msg_buff);
+
+	    if (degreeOutput)
+		Rast_write_units(shad_filename, "degrees");
+	    else
+		Rast_write_units(shad_filename, "radians");
+
 	    Rast_command_history(&history);
 	    Rast_command_history(&history);
-	    Rast_write_history(shad_filename, &history);
 
 
+	    /* insert a blank line */
+	    history.edhist[history.edlinecnt][0] = '\0';
+	    history.edlinecnt++;
 
 
-	}
+	    sprintf(msg_buff,
+		    "Horizon view from azimuth angle %.2f degrees CCW from East",
+		    angle * rad2deg);
+	    strcpy(history.edhist[history.edlinecnt], msg_buff);
+	    history.edlinecnt++;
 
 
+	    Rast_write_history(shad_filename, &history);
+	}
     }
     }
-
 }
 }

+ 13 - 3
raster/r.horizon/r.horizon.html

@@ -26,12 +26,14 @@ East, North, West and South. The only exception of this feature is
 LOCATION with x,y coordinate system, where this correction is
 LOCATION with x,y coordinate system, where this correction is
 not applied. 
 not applied. 
 
 
+
 <H3>Flags:</H3>
 <H3>Flags:</H3>
 <dl>
 <dl>
   <dt><B>-d</B>
   <dt><B>-d</B>
   <dd>Output horizon height in degrees (the default is radians)</dd>
   <dd>Output horizon height in degrees (the default is radians)</dd>
 </dl>
 </dl>
 
 
+
 <H3>Input parameters:</H3>
 <H3>Input parameters:</H3>
 <P>The <I>elevin</I> parameter is an input elevation raster map. If
 <P>The <I>elevin</I> parameter is an input elevation raster map. If
 the buffer options are used (see below), this raster should extend
 the buffer options are used (see below), this raster should extend
@@ -97,6 +99,7 @@ be in meters. The buffer parameters must be in the same units as the
 raster coordinates.
 raster coordinates.
 </p>
 </p>
 
 
+
 <H2>METHOD</H2>
 <H2>METHOD</H2>
 <P>The calculation method is based on the method used in <B>r.sun</B>
 <P>The calculation method is based on the method used in <B>r.sun</B>
 to calculate shadows. It starts at a very shallow angle and walks
 to calculate shadows. It starts at a very shallow angle and walks
@@ -114,18 +117,21 @@ actually are. It also accounts for the changes of angles towards
 cardinal directions caused by the projection (see above). 
 cardinal directions caused by the projection (see above). 
 </P>
 </P>
 
 
+
 <H2>EXAMPLE</H2>
 <H2>EXAMPLE</H2>
 
 
 Single point mode:
 Single point mode:
 <div class="code"><pre>
 <div class="code"><pre>
-r.horizon elevin=DEM horizonstep=30 direction=15 bufferzone=200 coord=47.302,7.365 dist=0.7 &gt; horizon.out
+r.horizon elevin=DEM horizonstep=30 direction=15 bufferzone=200 \
+    coord=47.302,7.365 dist=0.7 &gt; horizon.out
 </pre></div>
 </pre></div>
 
 
 
 
 Raster map mode (for r.sun):
 Raster map mode (for r.sun):
 <div class="code"><pre>
 <div class="code"><pre>
 # we put a bufferzone of 10% of maxdistance around the study area
 # we put a bufferzone of 10% of maxdistance around the study area
-r.horizon elevin=DEM horizonstep=30 bufferzone=200 horizon=horangle dist=0.7 maxdistance=2000
+r.horizon elevin=DEM horizonstep=30 bufferzone=200 horizon=horangle \
+    dist=0.7 maxdistance=2000
 </pre></div>
 </pre></div>
 
 
 
 
@@ -133,8 +139,10 @@ r.horizon elevin=DEM horizonstep=30 bufferzone=200 horizon=horangle dist=0.7 max
 
 
 <em>
 <em>
 <A HREF="r.sun.html">r.sun</A>,
 <A HREF="r.sun.html">r.sun</A>,
+<A HREF="r.sunmask.html">r.sunmask</A>,
 <A HREF="r.los.html">r.los</A></em>
 <A HREF="r.los.html">r.los</A></em>
 
 
+
 <H2>REFERENCES</H2>
 <H2>REFERENCES</H2>
 <P>Hofierka J., 1997. Direct solar radiation modelling within an
 <P>Hofierka J., 1997. Direct solar radiation modelling within an
 open GIS environment. Proceedings of JEC-GI'97 conference in Vienna,
 open GIS environment. Proceedings of JEC-GI'97 conference in Vienna,
@@ -155,6 +163,7 @@ A New GIS-based Solar Radiation Model and Its Application for
 Photovoltaic Assessments. <A HREF="http://www.blackwellpublishing.com/toc.asp?ref=1361-1682">Transactions
 Photovoltaic Assessments. <A HREF="http://www.blackwellpublishing.com/toc.asp?ref=1361-1682">Transactions
 in GIS</A>, 8(2), 175-190</P>
 in GIS</A>, 8(2), 175-190</P>
 
 
+
 <H2>AUTHORS</H2>
 <H2>AUTHORS</H2>
 <P>
 <P>
 Thomas Huld, Joint Research Centre of
 Thomas Huld, Joint Research Centre of
@@ -178,4 +187,5 @@ European Commission, Ispra, Italy</P>
 <A HREF="mailto:Marcel.Suri@jrc.it">Marcel.Suri@jrc.it</A> 
 <A HREF="mailto:Marcel.Suri@jrc.it">Marcel.Suri@jrc.it</A> 
 </ADDRESS>
 </ADDRESS>
 
 
-<P><I>Last changed: $Date: 2007/05/16 16:22:04 $</I> 
+<P>
+<I>Last changed: $Date: 2007/05/16 16:22:04 $</I>