[GRASS-SVN] r55907 - grass/trunk/vector/v.overlay
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 18 23:40:56 PDT 2013
Author: mmetz
Date: 2013-04-18 23:40:56 -0700 (Thu, 18 Apr 2013)
New Revision: 55907
Modified:
grass/trunk/vector/v.overlay/main.c
Log:
v.overlay output is 2D
Modified: grass/trunk/vector/v.overlay/main.c
===================================================================
--- grass/trunk/vector/v.overlay/main.c 2013-04-19 06:31:13 UTC (rev 55906)
+++ grass/trunk/vector/v.overlay/main.c 2013-04-19 06:40:56 UTC (rev 55907)
@@ -33,7 +33,7 @@
int main(int argc, char *argv[])
{
- int i, input, line, nlines, operator;
+ int i, j, input, line, nlines, operator;
int type[2], field[2], ofield[3];
double snap_thresh;
struct GModule *module;
@@ -251,7 +251,22 @@
}
/* lines and boundaries must have at least 2 distinct vertices */
- Vect_line_prune(Points);
+ /* Vect_line_prune(Points); */
+
+ if (Points->n_points > 0) {
+ j = 1;
+ for (i = 1; i < Points->n_points; i++) {
+ Points->z[i] = 0; /* Tmp, Out are 2D */
+ if (Points->x[i] != Points->x[j - 1] ||
+ Points->y[i] != Points->y[j - 1]) {
+ Points->x[j] = Points->x[i];
+ Points->y[j] = Points->y[i];
+ j++;
+ }
+ }
+ Points->n_points = j;
+ }
+
if (Points->n_points < 2)
continue;
More information about the grass-commit
mailing list