[GRASS-SVN] r34125 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Oct 31 09:01:06 EDT 2008
Author: martinl
Date: 2008-10-31 09:01:06 -0400 (Fri, 31 Oct 2008)
New Revision: 34125
Modified:
grass/trunk/lib/vector/Vlib/array.c
Log:
marisn: Add some comments about varray initialisation
(merge from devbr6, r34123)
Modified: grass/trunk/lib/vector/Vlib/array.c
===================================================================
--- grass/trunk/lib/vector/Vlib/array.c 2008-10-31 12:48:25 UTC (rev 34124)
+++ grass/trunk/lib/vector/Vlib/array.c 2008-10-31 13:01:06 UTC (rev 34125)
@@ -69,6 +69,7 @@
GV_AREA or: GV_POINT | GV_LINE | GV_BOUNDARY | GV_CENTROID
Array is not reset to zero before, but old values (if any > 0) are overwritten.
+ Array must be initialised by Vect_new_varray(size) call.
\param Map vector map
\param field layer number
@@ -115,6 +116,7 @@
GV_CENTROID
Array is not reset to zero before, but old values (if any > 0) are overwritten.
+ Array must be initialised by Vect_new_varray(size) call.
\param Map vector map
\param field layer number
@@ -233,7 +235,7 @@
either: GV_AREA or: GV_POINT | GV_LINE | GV_BOUNDARY | GV_CENTROID
Array is not reset to zero before, but old values (if any > 0) are
- overwritten.
+ overwritten. Array must be initialised by Vect_new_varray(size) call.
\param Map vector map
\param field layer number
@@ -297,6 +299,9 @@
if (type & GV_AREA) { /* Areas */
n = Vect_get_num_areas(Map);
+ /* IMHO varray should be allocated only when it's required AND only as large as required
+ as WHERE will create a small subset of all vector features and thus on large datasets
+ it's waste of memory to allocate it for all features. */
if (n > varray->size) { /* not enough space */
G_warning(_("Not enough space in vector array"));
return 0;
More information about the grass-commit
mailing list