[GRASS-SVN] r44712 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 24 10:13:08 EST 2010


Author: martinl
Date: 2010-12-24 07:13:08 -0800 (Fri, 24 Dec 2010)
New Revision: 44712

Modified:
   grass/trunk/lib/vector/Vlib/build.c
   grass/trunk/lib/vector/Vlib/build_ogr.c
   grass/trunk/lib/vector/Vlib/open.c
Log:
vlib: cosmetics for external formats (v.external.out)


Modified: grass/trunk/lib/vector/Vlib/build.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build.c	2010-12-24 14:57:33 UTC (rev 44711)
+++ grass/trunk/lib/vector/Vlib/build.c	2010-12-24 15:13:08 UTC (rev 44712)
@@ -1,16 +1,14 @@
 /*!
-   \file build.c
+   \file lib/vector/Vlib/build.c
 
    \brief Vector library - Building topology
 
    Higher level functions for reading/writing/manipulating vectors.
 
-   (C) 2001-2009 by the GRASS Development Team
+   (C) 2001-2010 by the GRASS Development Team
 
-   This program is free software under the 
-   GNU General Public License (>=v2). 
-   Read the file COPYING that comes with GRASS
-   for details.
+   This program is free software under the GNU General Public License
+   (>=v2).  Read the file COPYING that comes with GRASS for details.
 
    \author Original author CERL, probably Dave Gerdes or Mike Higgins.
    \author Update to GRASS 5.7 Radim Blazek and David D. Gray.
@@ -57,7 +55,6 @@
     return Vect_build_partial(Map, GV_BUILD_ALL);
 }
 
-
 /*!
    \brief Return current highest built level (part)
 
@@ -127,6 +124,10 @@
 
     plus = &(Map->plus);
     if (build > GV_BUILD_NONE) {
+	if (Vect_maptype(Map) != GV_FORMAT_NATIVE)
+	    G_message(_("Using external data format '%s'"),
+		      Vect_get_ogr_format_info(Map));
+	
 	G_message(_("Building topology for vector map <%s>..."),
 		  Vect_get_full_name(Map));
     }

Modified: grass/trunk/lib/vector/Vlib/build_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_ogr.c	2010-12-24 14:57:33 UTC (rev 44711)
+++ grass/trunk/lib/vector/Vlib/build_ogr.c	2010-12-24 15:13:08 UTC (rev 44712)
@@ -5,15 +5,21 @@
 
    Higher level functions for reading/writing/manipulating vectors.
 
-   (C) 2001-2009 by the GRASS Development Team
+   Line offset is
+    - centroids   : FID
+    - other types : index of the first record (which is FID) in offset array.
+ 
+   Category: FID, not all layer have FID, OGRNullFID is defined
+   (5/2004) as -1, so FID should be only >= 0
 
-   This program is free software under the 
-   GNU General Public License (>=v2). 
-   Read the file COPYING that comes with GRASS
-   for details.
+   (C) 2001-2010 by the GRASS Development Team
 
+   This program is free software under the GNU General Public License
+   (>=v2).  Read the file COPYING that comes with GRASS for details.
+
    \author Radim Blazek, Piero Cavalieri
- */
+   \author Various updates for GRASS 7 by Martin Landa <landa.martin gmail.com>
+*/
 
 #include <grass/config.h>
 #include <string.h>
@@ -23,22 +29,14 @@
 #include <grass/vector.h>
 #include <grass/glocale.h>
 
-/* 
- *   Line offset is
- *      - centroids   : FID
- *      - other types : index of the first record (which is FID) in offset array.
- *
- *   Category: FID, not all layer have FID, OGRNullFID is defined (5/2004) as -1, so FID should be only >= 0
- *
- */
-
 #ifdef HAVE_OGR
 #include <ogr_api.h>
 
-/* 
- *  This structure keeps info about geometry parts above current geometry, path to curent geometry in the 
- *  feature. First 'part' number however is feature Id 
- */
+/*! 
+  \brief This structure keeps info about geometry parts above
+  current geometry, path to curent geometry in the * feature. First
+  'part' number however is feature Id
+*/
 typedef struct
 {
     int *part;
@@ -46,27 +44,36 @@
     int n_parts;
 } GEOM_PARTS;
 
-/* Init parts */
+/*!
+  \brief Init parts
+*/
 static void init_parts(GEOM_PARTS * parts)
 {
     parts->part = NULL;
     parts->a_parts = parts->n_parts = 0;
 }
 
-/* Reset parts */
+/*!
+  \brief 
+  Reset parts
+*/
 static void reset_parts(GEOM_PARTS * parts)
 {
     parts->n_parts = 0;
 }
 
-/* Free parts */
+/*!
+  \brief Free parts
+*/
 static void free_parts(GEOM_PARTS * parts)
 {
     G_free(parts->part);
     parts->a_parts = parts->n_parts = 0;
 }
 
-/* Add new part number to parts */
+/*!
+  \brief Add new part number to parts
+*/
 static void add_part(GEOM_PARTS * parts, int part)
 {
     if (parts->a_parts == parts->n_parts) {
@@ -79,13 +86,17 @@
     parts->n_parts++;
 }
 
-/* Remove last part */
+/*!
+  \brief Remove last part
+*/
 static void del_part(GEOM_PARTS * parts)
 {
     parts->n_parts--;
 }
 
-/* Add parts to offset */
+/*!
+  \brief Add parts to offset
+*/
 static void add_parts_to_offset(struct Map_info *Map, GEOM_PARTS * parts)
 {
     int i, j;
@@ -106,7 +117,9 @@
     Map->fInfo.ogr.offset_num += parts->n_parts;
 }
 
-/* add line to support structures */
+/*!
+  \brief Add line to support structures
+*/
 static int add_line(struct Map_info *Map, int type, struct line_pnts *Points,
 		    int FID, GEOM_PARTS * parts)
 {
@@ -148,7 +161,9 @@
     return line;
 }
 
-/* Recursively add geometry to topology */
+/*!
+  \brief Recursively add geometry to topology
+*/
 static int add_geometry(struct Map_info *Map, OGRGeometryH hGeom, int FID,
 			GEOM_PARTS * parts)
 {

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2010-12-24 14:57:33 UTC (rev 44711)
+++ grass/trunk/lib/vector/Vlib/open.c	2010-12-24 15:13:08 UTC (rev 44712)
@@ -901,8 +901,9 @@
   \brief Gets vector map format
 
   Currently are implemeted:
-   - Native format (GV_FORMAT_NATIVE)
-   - OGR format    (GV_FORMAT_OGR)
+   - Native format                    (GV_FORMAT_NATIVE)
+   - OGR format linked via v.external (GV_FORMAT_OGR)
+   - OGR format                       (GV_FORMAT_DIRECT)
 
   \param Map pointer to Map_info structure
   



More information about the grass-commit mailing list