Skip to content

Commit

Permalink
r.slope.aspect: fix title and color table for -n flag (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Feb 3, 2020
1 parent b98dc11 commit 85db9ed
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions raster/r.slope.aspect/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,12 @@ int main(int argc, char *argv[])
360);

Rast_read_cats(aspect_name, G_mapset(), &cats);
Rast_set_cats_title
("Aspect counterclockwise in degrees from east", &cats);

if (flag.n->answer)
Rast_set_cats_title
("Aspect clockwise in degrees from north", &cats);
else
Rast_set_cats_title
("Aspect counterclockwise in degrees from east", &cats);
G_verbose_message(_("Min computed aspect %.4f, max computed aspect %.4f"),
min_asp, max_asp);
/* the categries quant intervals are 1.0 long, plus
Expand Down Expand Up @@ -1068,7 +1071,10 @@ int main(int argc, char *argv[])
Rast_init_colors(&colors);
Rast_read_fp_range(aspect_name, G_mapset(), &range);
Rast_get_fp_range_min_max(&range, &min, &max);
Rast_make_aspect_fp_colors(&colors, min, max);
if (flag.n->answer)
Rast_make_aspect_fp_colors(&colors, 0, max);
else
Rast_make_aspect_fp_colors(&colors, min, max);
Rast_write_colors(aspect_name, G_mapset(), &colors);

/* writing history file */
Expand Down

0 comments on commit 85db9ed

Please sign in to comment.