Quellcode durchsuchen

vlib: Vect_topo_dump() add separator

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48959 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa vor 13 Jahren
Ursprung
Commit
1e63355890
2 geänderte Dateien mit 27 neuen und 20 gelöschten Zeilen
  1. 26 19
      lib/vector/Vlib/build.c
  2. 1 1
      lib/vector/Vlib/build_nat.c

+ 26 - 19
lib/vector/Vlib/build.c

@@ -20,6 +20,7 @@
 #include <grass/glocale.h>
 #include <grass/glocale.h>
 #include <grass/vector.h>
 #include <grass/vector.h>
 
 
+#define SEP "-----------------------------------\n"
 
 
 #ifndef HAVE_OGR
 #ifndef HAVE_OGR
 static int format()
 static int format()
@@ -70,15 +71,16 @@ int Vect_get_built(const struct Map_info *Map)
 
 
    Should only be used in special cases of vector processing.
    Should only be used in special cases of vector processing.
 
 
-   This functions optionally builds only some parts of topology. Highest level is specified by build
-   parameter which may be:
-   - GV_BUILD_NONE - nothing is build;
-   - GV_BUILD_BASE - basic topology, nodes, spatial index;
-   - GV_BUILD_AREAS - build areas and islands, but islands are not attached to areas;
-   - GV_BUILD_ATTACH_ISLES - attach islands to areas;
-   - GV_BUILD_CENTROIDS - assign centroids to areas;
-   - GV_BUILD_ALL - top level, the same as GV_BUILD_CENTROIDS.
-
+   This functions optionally builds only some parts of
+   topology. Highest level is specified by build parameter which may
+   be:
+    - GV_BUILD_NONE - nothing is build
+    - GV_BUILD_BASE - basic topology, nodes, lines, spatial index;
+    - GV_BUILD_AREAS - build areas and islands, but islands are not attached to areas;
+    - GV_BUILD_ATTACH_ISLES - attach islands to areas;
+    - GV_BUILD_CENTROIDS - assign centroids to areas;
+    - GV_BUILD_ALL - top level, the same as GV_BUILD_CENTROIDS.
+    
    If functions is called with build lower than current value of the
    If functions is called with build lower than current value of the
    Map, the level is downgraded to requested value.
    Map, the level is downgraded to requested value.
 
 
@@ -86,10 +88,6 @@ int Vect_get_built(const struct Map_info *Map)
    Vect_delete_line() respect the last value of build used in this
    Vect_delete_line() respect the last value of build used in this
    function.
    function.
 
 
-   Values lower than GV_BUILD_ALL are supported only by
-   GV_FORMAT_NATIVE, other formats ignore build and build always
-   GV_BUILD_ALL
-
    Note that the functions has effect only if requested level is
    Note that the functions has effect only if requested level is
    higher than current level, to rebuild part of topology, call first
    higher than current level, to rebuild part of topology, call first
    downgrade and then upgrade, for example:
    downgrade and then upgrade, for example:
@@ -298,12 +296,14 @@ int Vect_topo_dump(const struct Map_info *Map, FILE *out)
     plus = &(Map->plus);
     plus = &(Map->plus);
     
     
     fprintf(out, "---------- TOPOLOGY DUMP ----------\n");
     fprintf(out, "---------- TOPOLOGY DUMP ----------\n");
-
+    
     /* box */
     /* box */
     Vect_box_copy(&box, &(plus->box));
     Vect_box_copy(&box, &(plus->box));
     fprintf(out, "N,S,E,W,T,B: %f, %f, %f, %f, %f, %f\n", box.N, box.S,
     fprintf(out, "N,S,E,W,T,B: %f, %f, %f, %f, %f, %f\n", box.N, box.S,
 	    box.E, box.W, box.T, box.B);
 	    box.E, box.W, box.T, box.B);
 
 
+    fprintf(out, SEP);
+    
     /* nodes */
     /* nodes */
     fprintf(out, "Nodes (%d nodes, alive + dead):\n", plus->n_nodes);
     fprintf(out, "Nodes (%d nodes, alive + dead):\n", plus->n_nodes);
     for (i = 1; i <= plus->n_nodes; i++) {
     for (i = 1; i <= plus->n_nodes; i++) {
@@ -321,6 +321,8 @@ int Vect_topo_dump(const struct Map_info *Map, FILE *out)
 	}
 	}
     }
     }
 
 
+    fprintf(out, SEP);
+    
     /* lines */
     /* lines */
     fprintf(out, "Lines (%d lines, alive + dead):\n", plus->n_lines);
     fprintf(out, "Lines (%d lines, alive + dead):\n", plus->n_lines);
     for (i = 1; i <= plus->n_lines; i++) {
     for (i = 1; i <= plus->n_lines; i++) {
@@ -369,6 +371,8 @@ int Vect_topo_dump(const struct Map_info *Map, FILE *out)
 	}
 	}
     }
     }
 
 
+    fprintf(out, SEP);
+    
     /* areas */
     /* areas */
     fprintf(out, "Areas (%d areas, alive + dead):\n", plus->n_areas);
     fprintf(out, "Areas (%d areas, alive + dead):\n", plus->n_areas);
     for (i = 1; i <= plus->n_areas; i++) {
     for (i = 1; i <= plus->n_areas; i++) {
@@ -391,6 +395,8 @@ int Vect_topo_dump(const struct Map_info *Map, FILE *out)
 	}
 	}
     }
     }
 
 
+    fprintf(out, SEP);
+    
     /* isles */
     /* isles */
     fprintf(out, "Islands (%d islands, alive + dead):\n", plus->n_isles);
     fprintf(out, "Islands (%d islands, alive + dead):\n", plus->n_isles);
     for (i = 1; i <= plus->n_isles; i++) {
     for (i = 1; i <= plus->n_isles; i++) {
@@ -436,19 +442,20 @@ int Vect_build_sidx(struct Map_info *Map)
 }
 }
 
 
 /*!
 /*!
-   \brief Create spatial index from topology if necessary
+   \brief Create spatial index from topology if necessary (not longer
+   supported)
 
 
    \param Map pointer to vector map
    \param Map pointer to vector map
 
 
-   \return 0 OK
-   \return 1 error
+   \return 1
  */
  */
 int Vect_build_sidx_from_topo(struct Map_info *Map)
 int Vect_build_sidx_from_topo(struct Map_info *Map)
 {
 {
 
 
-    G_debug(3, "Vect_build_sidx_from_topo()");
+    G_debug(3, "Vect_build_sidx_from_topo(): name=%s",
+	    Vect_get_full_name(Map));
 
 
-    G_warning(_("Vect_build_sidx_from_topo() is no longer supported"));
+    G_warning(_("%s is no longer supported"), "Vect_build_sidx_from_topo()");
 
 
     return 1;
     return 1;
 }
 }

+ 1 - 1
lib/vector/Vlib/build_nat.c

@@ -24,7 +24,7 @@
 /*!
 /*!
    \brief Build area on given side of line (GV_LEFT or GV_RIGHT)
    \brief Build area on given side of line (GV_LEFT or GV_RIGHT)
 
 
-   \param Map_info vector map
+   \param Map pointer to Map_info structure
    \param iline line id
    \param iline line id
    \param side side (GV_LEFT or GV_RIGHT)
    \param side side (GV_LEFT or GV_RIGHT)