[GRASS-SVN] r64483 - grass/trunk/vector/v.generalize
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 6 12:08:21 PST 2015
Author: mmetz
Date: 2015-02-06 12:08:21 -0800 (Fri, 06 Feb 2015)
New Revision: 64483
Modified:
grass/trunk/vector/v.generalize/main.c
Log:
v.generalize: simplify code
Modified: grass/trunk/vector/v.generalize/main.c
===================================================================
--- grass/trunk/vector/v.generalize/main.c 2015-02-06 12:50:32 UTC (rev 64482)
+++ grass/trunk/vector/v.generalize/main.c 2015-02-06 20:08:21 UTC (rev 64483)
@@ -430,30 +430,19 @@
/* check if any of the centroids is selected */
Vect_get_line_areas(&Out, i, &left, &right);
+ if (left < 0)
+ left = Vect_get_isle_area(&Out, abs(left));
+ if (right < 0)
+ right = Vect_get_isle_area(&Out, abs(right));
+
if (left > 0) {
Vect_get_area_cats(&Out, left, Cats);
do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
}
- else if (left < 0) {
- left = Vect_get_isle_area(&Out, abs(left));
- if (left > 0) {
- Vect_get_area_cats(&Out, left, Cats);
- do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
- }
- }
- if (!do_line) {
- if (right > 0) {
- Vect_get_area_cats(&Out, right, Cats);
- do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
- }
- else if (right < 0) {
- right = Vect_get_isle_area(&Out, abs(right));
- if (right > 0) {
- Vect_get_area_cats(&Out, right, Cats);
- do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
- }
- }
+ if (!do_line && right > 0) {
+ Vect_get_area_cats(&Out, right, Cats);
+ do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
}
}
if (!do_line)
More information about the grass-commit
mailing list