فهرست منبع

vlib: cosmetics for external formats (v.external.out)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44712 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 سال پیش
والد
کامیت
f8ffe16af4
3فایلهای تغییر یافته به همراه53 افزوده شده و 36 حذف شده
  1. 8 7
      lib/vector/Vlib/build.c
  2. 42 27
      lib/vector/Vlib/build_ogr.c
  3. 3 2
      lib/vector/Vlib/open.c

+ 8 - 7
lib/vector/Vlib/build.c

@@ -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 @@ int Vect_build(struct Map_info *Map)
     return Vect_build_partial(Map, GV_BUILD_ALL);
 }
 
-
 /*!
    \brief Return current highest built level (part)
 
@@ -127,6 +124,10 @@ int Vect_build_partial(struct Map_info *Map, int build)
 
     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));
     }

+ 42 - 27
lib/vector/Vlib/build_ogr.c

@@ -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 @@ typedef struct
     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 @@ static void add_part(GEOM_PARTS * parts, int part)
     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 @@ static void add_parts_to_offset(struct Map_info *Map, GEOM_PARTS * parts)
     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 @@ static int add_line(struct Map_info *Map, int type, struct line_pnts *Points,
     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)
 {

+ 3 - 2
lib/vector/Vlib/open.c

@@ -901,8 +901,9 @@ const char *Vect_maptype_info(const struct Map_info *Map)
   \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