[GRASS5] Re: [GRASS-CVS] eric: grass/src/mapdev/v.out.shape extract.c,1.8,1.9

Hi Eric,

thanks for fixing the memory corruption bug: now commands like

v.out.shape areamap type=area

do no longer crash. But... :slight_smile:
If the map contains islands, they are still filled by the surrounding
area.

If ever possible, maybe somebody could look into that (or I
am missing something, probably islands in SHAPE are a problem?
Note that I checked the SHAPE file with Arcexplorer for Linux,
maybe the problem is there).

Thanks again,

Markus

On Fri, Oct 04, 2002 at 07:34:05AM +0200, grass@intevation.de wrote:

Author: eric

Update of /grassrepository/grass/src/mapdev/v.out.shape
In directory doto:/tmp/cvs-serv1516

Modified Files:
  extract.c
Log Message:
Fix memory corruption bug with areas w/ islands.

Index: extract.c

RCS file: /grassrepository/grass/src/mapdev/v.out.shape/extract.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- extract.c 13 Apr 2002 14:15:18 -0000 1.8
+++ extract.c 4 Oct 2002 05:34:03 -0000 1.9
@@ -172,7 +172,6 @@
     lfp = stdout;
   }

- Area = (P_AREA *)malloc( sizeof(P_AREA) );
   Points = Vect_new_line_struct();
   Points->alloc_points = 0;
   Points->n_points = 0;
@@ -213,9 +212,6 @@
     listY[i] = Points->y[i];
   }

- free(Points->x);
- free(Points->y);
-
   totalvertices = numvertices;

   /* Determine the rings of the isles */
@@ -246,14 +242,9 @@
       listX[k] = Points->x[k1];
       listY[k] = Points->y[k1++];
     }
-
- free(Points->x);
- free(Points->y);
   }

- /*free(Area);
   Vect_destroy_line_struct(Points);
- */

   /* Log vertex lists */
   /*

_______________________________________________
grass-commit mailing list
grass-commit@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-commit

On Friday 04 October 2002 09:58 am, Markus Neteler wrote:

Hi Eric,

thanks for fixing the memory corruption bug: now commands like

v.out.shape areamap type=area

do no longer crash. But... :slight_smile:
If the map contains islands, they are still filled by the surrounding
area.

If ever possible, maybe somebody could look into that (or I
am missing something, probably islands in SHAPE are a problem?
Note that I checked the SHAPE file with Arcexplorer for Linux,
maybe the problem is there).

As each island in GRASS is also area, it is exported
as area to shapefile with CAT_ID = 0. Such shapefile is then displayed
with filled island (not island but area in the island) if all areas
have the same number. If a different colour is assigned to each CAT_ID,
the area in the island has a different colour.
We need a new flag to disable export of not labeled areas.

Radim

On Fri, Oct 04, 2002 at 09:58:52AM +0200, Markus Neteler wrote:

Hi Eric,

thanks for fixing the memory corruption bug: now commands like

v.out.shape areamap type=area

do no longer crash. But... :slight_smile:
If the map contains islands, they are still filled by the surrounding
area.

If ever possible, maybe somebody could look into that (or I
am missing something, probably islands in SHAPE are a problem?
Note that I checked the SHAPE file with Arcexplorer for Linux,
maybe the problem is there).

Islands are presumably holes and need to have their direction reversed.
Shapefiles use a winding rule to determine interior/exterior boundaries.

--
begin 664 .signature
M<F5L;&E-("Y'(&-I<D4@/G1E;BYS<&I`,FUG93P)"`@("`@("`@("`@("`@(
M"`@("`@("`@("`@("`@("`A%<FEC($<N($UI;&QE<B`\96=M,D!J<',N;F5T
"/@H`
`
end