Changeset 34288
- Timestamp:
- Nov 14, 2008, 7:30:19 AM (16 years ago)
- Location:
- grass/branches/develbranch_6
- Files:
-
- 87 edited
-
gui/wxpython/vdigit/driver.cpp (modified) (1 diff)
-
gui/wxpython/vdigit/line.cpp (modified) (3 diffs)
-
include/Vect.h (modified) (5 diffs)
-
lib/sites/sites.c (modified) (1 diff)
-
lib/vector/Vlib/break_lines.c (modified) (8 diffs)
-
lib/vector/Vlib/break_polygons.c (modified) (7 diffs)
-
lib/vector/Vlib/bridges.c (modified) (8 diffs)
-
lib/vector/Vlib/build.c (modified) (9 diffs)
-
lib/vector/Vlib/build_nat.c (modified) (9 diffs)
-
lib/vector/Vlib/build_ogr.c (modified) (6 diffs)
-
lib/vector/Vlib/clean_nodes.c (modified) (4 diffs)
-
lib/vector/Vlib/dangles.c (modified) (10 diffs)
-
lib/vector/Vlib/map.c (modified) (3 diffs)
-
lib/vector/Vlib/open.c (modified) (1 diff)
-
lib/vector/Vlib/remove_areas.c (modified) (4 diffs)
-
lib/vector/Vlib/remove_duplicates.c (modified) (4 diffs)
-
lib/vector/Vlib/select.c (modified) (4 diffs)
-
lib/vector/Vlib/sindex.c (modified) (7 diffs)
-
lib/vector/Vlib/snap.c (modified) (12 diffs)
-
lib/vector/vedit/select.c (modified) (1 diff)
-
raster/r.carve/vect.c (modified) (1 diff)
-
raster/r.contour/main.c (modified) (1 diff)
-
raster/r.flow/io.c (modified) (1 diff)
-
raster/r.random/random.c (modified) (1 diff)
-
raster/r.to.vect/main.c (modified) (1 diff)
-
vector/lidar/v.outlier/main.c (modified) (1 diff)
-
vector/v.buffer/main.c (modified) (5 diffs)
-
vector/v.build.polylines/main.c (modified) (1 diff)
-
vector/v.build/main.c (modified) (2 diffs)
-
vector/v.category/main.c (modified) (1 diff)
-
vector/v.clean/main.c (modified) (10 diffs)
-
vector/v.clean/prune.c (modified) (2 diffs)
-
vector/v.convert/old2new.c (modified) (1 diff)
-
vector/v.digit/centre.c (modified) (1 diff)
-
vector/v.digit/main.c (modified) (1 diff)
-
vector/v.distance/main.c (modified) (1 diff)
-
vector/v.drape/main.c (modified) (1 diff)
-
vector/v.edit/a2b.c (modified) (1 diff)
-
vector/v.edit/main.c (modified) (2 diffs)
-
vector/v.edit/snap.c (modified) (1 diff)
-
vector/v.external/main.c (modified) (1 diff)
-
vector/v.extract/main.c (modified) (2 diffs)
-
vector/v.extrude/main.c (modified) (2 diffs)
-
vector/v.generalize/main.c (modified) (3 diffs)
-
vector/v.hull/main.c (modified) (1 diff)
-
vector/v.in.ascii/in.c (modified) (2 diffs)
-
vector/v.in.db/main.c (modified) (1 diff)
-
vector/v.in.dxf/main.c (modified) (1 diff)
-
vector/v.in.ogr/main.c (modified) (9 diffs)
-
vector/v.in.region/main.c (modified) (1 diff)
-
vector/v.in.sites/main.c (modified) (1 diff)
-
vector/v.kcv/main.c (modified) (1 diff)
-
vector/v.kernel/main.c (modified) (1 diff)
-
vector/v.lrs/v.lrs.create/main.c (modified) (2 diffs)
-
vector/v.lrs/v.lrs.label/main.c (modified) (1 diff)
-
vector/v.lrs/v.lrs.segment/main.c (modified) (1 diff)
-
vector/v.mkgrid/main.c (modified) (1 diff)
-
vector/v.net.alloc/main.c (modified) (1 diff)
-
vector/v.net.iso/main.c (modified) (1 diff)
-
vector/v.net.path/main.c (modified) (1 diff)
-
vector/v.net.salesman/main.c (modified) (1 diff)
-
vector/v.net.steiner/main.c (modified) (1 diff)
-
vector/v.net.visibility/main.c (modified) (1 diff)
-
vector/v.net/connect.c (modified) (1 diff)
-
vector/v.net/main.c (modified) (1 diff)
-
vector/v.overlay/area_area.c (modified) (4 diffs)
-
vector/v.overlay/line_area.c (modified) (1 diff)
-
vector/v.overlay/main.c (modified) (2 diffs)
-
vector/v.parallel/main.c (modified) (1 diff)
-
vector/v.patch/main.c (modified) (2 diffs)
-
vector/v.perturb/main.c (modified) (1 diff)
-
vector/v.proj/main.c (modified) (1 diff)
-
vector/v.qcount/main.c (modified) (1 diff)
-
vector/v.random/main.c (modified) (1 diff)
-
vector/v.reclass/main.c (modified) (1 diff)
-
vector/v.sample/main.c (modified) (1 diff)
-
vector/v.segment/main.c (modified) (1 diff)
-
vector/v.select/main.c (modified) (1 diff)
-
vector/v.split/main.c (modified) (1 diff)
-
vector/v.surf.rst/main.c (modified) (3 diffs)
-
vector/v.to.points/main.c (modified) (1 diff)
-
vector/v.transform/main.c (modified) (1 diff)
-
vector/v.type/main.c (modified) (1 diff)
-
vector/v.vol.rst/main.c (modified) (1 diff)
-
vector/v.voronoi/dt_main.c (modified) (3 diffs)
-
vector/v.voronoi/vo_main.c (modified) (2 diffs)
-
vector/v.what/main.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
grass/branches/develbranch_6/gui/wxpython/vdigit/driver.cpp
r33537 r34288 105 105 if (mapInfo->mode == GV_MODE_RW) { 106 106 /* rebuild topology */ 107 Vect_build_partial(mapInfo, GV_BUILD_NONE , NULL);108 Vect_build(mapInfo , NULL);107 Vect_build_partial(mapInfo, GV_BUILD_NONE); 108 Vect_build(mapInfo); 109 109 } 110 110 /* close map and store topo/cidx */ -
grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp
r33588 r34288 604 604 605 605 ret = Vect_break_lines_list(display->mapInfo, display->selected.values, NULL, 606 GV_LINES, NULL , NULL);606 GV_LINES, NULL); 607 607 608 608 if (ret > 0) { … … 640 640 641 641 Vect_snap_lines_list (display->mapInfo, display->selected.values, 642 thresh, NULL , NULL);642 thresh, NULL); 643 643 644 644 if (nlines < Vect_get_num_lines(display->mapInfo)) { … … 958 958 959 959 ret = Vect_break_lines_list(display->mapInfo, listBreak, listRef, 960 GV_LINES, NULL , NULL);960 GV_LINES, NULL); 961 961 962 962 for (int i = 0; i < listBreak->n_values; i++) { -
grass/branches/develbranch_6/include/Vect.h
r33533 r34288 195 195 int Vect_open_update_head(struct Map_info *, const char *, const char *); 196 196 int Vect_copy_head_data(struct Map_info *, struct Map_info *); 197 int Vect_build(struct Map_info * , FILE *);197 int Vect_build(struct Map_info *); 198 198 int Vect_get_built(struct Map_info *); 199 int Vect_build_partial(struct Map_info *, int , FILE *);199 int Vect_build_partial(struct Map_info *, int); 200 200 int Vect_set_constraint_region(struct Map_info *, double, double, double, 201 201 double, double, double); … … 297 297 298 298 /* Cleaning */ 299 void Vect_break_lines(struct Map_info *, int, struct Map_info * , FILE *);299 void Vect_break_lines(struct Map_info *, int, struct Map_info *); 300 300 int Vect_break_lines_list(struct Map_info *, struct ilist *, struct ilist *, 301 int, struct Map_info *, FILE *); 302 void Vect_break_polygons(struct Map_info *, int, struct Map_info *, FILE *); 303 void Vect_remove_duplicates(struct Map_info *, int, struct Map_info *, 304 FILE *); 301 int, struct Map_info *); 302 void Vect_break_polygons(struct Map_info *, int, struct Map_info *); 303 void Vect_remove_duplicates(struct Map_info *, int, struct Map_info *); 305 304 int Vect_line_check_duplicate(const struct line_pnts *, 306 305 const struct line_pnts *, int); 307 void Vect_snap_lines(struct Map_info *, int, double, struct Map_info *, 308 FILE *); 306 void Vect_snap_lines(struct Map_info *, int, double, struct Map_info *); 309 307 void Vect_snap_lines_list(struct Map_info *, struct ilist *, double, 310 struct Map_info *, FILE *); 311 void Vect_remove_dangles(struct Map_info *, int, double, struct Map_info *, 312 FILE *); 313 void Vect_chtype_dangles(struct Map_info *, double, struct Map_info *, 314 FILE *); 315 void Vect_select_dangles(struct Map_info *, int, double, FILE *, 316 struct ilist *); 317 void Vect_remove_bridges(struct Map_info *, struct Map_info *, FILE *); 318 void Vect_chtype_bridges(struct Map_info *, struct Map_info *, FILE *); 308 struct Map_info *); 309 void Vect_remove_dangles(struct Map_info *, int, double, struct Map_info *); 310 void Vect_chtype_dangles(struct Map_info *, double, struct Map_info *); 311 void Vect_select_dangles(struct Map_info *, int, double, struct ilist *); 312 void Vect_remove_bridges(struct Map_info *, struct Map_info *); 313 void Vect_chtype_bridges(struct Map_info *, struct Map_info *); 319 314 int Vect_remove_small_areas(struct Map_info *, double, struct Map_info *, 320 FILE *,double *);315 double *); 321 316 int Vect_clean_small_angles_at_nodes(struct Map_info *, int, 322 struct Map_info * , FILE *);317 struct Map_info *); 323 318 324 319 /* Overlay */ … … 361 356 int Vect_option_to_types(struct Option *); 362 357 int Vect_copy_map_lines(struct Map_info *, struct Map_info *); 363 int Vect_copy(const char *, const char *, const char * , FILE *);364 int Vect_rename(const char *, const char * , FILE *);358 int Vect_copy(const char *, const char *, const char *); 359 int Vect_rename(const char *, const char *); 365 360 int Vect_copy_table(struct Map_info *, struct Map_info *, int, int, 366 361 const char *, int); … … 393 388 int Vect_save_spatial_index(struct Map_info *); 394 389 int Vect_spatial_index_dump(struct Map_info *, FILE *); 395 int Vect_build_sidx_from_topo(struct Map_info * , FILE *);396 int Vect_build_spatial_index(struct Map_info * , FILE *);390 int Vect_build_sidx_from_topo(struct Map_info *); 391 int Vect_build_spatial_index(struct Map_info *); 397 392 398 393 int Vect__write_head(struct Map_info *); … … 448 443 449 444 /* Miscellaneous */ 450 int Vect_build_nat(struct Map_info *, int , FILE *);451 int Vect_build_ogr(struct Map_info *, int , FILE *);445 int Vect_build_nat(struct Map_info *, int); 446 int Vect_build_ogr(struct Map_info *, int); 452 447 int Vect_build_line_area(struct Map_info *, int, int); 453 448 int Vect_isle_find_area(struct Map_info *, int); -
grass/branches/develbranch_6/lib/sites/sites.c
r34143 r34288 493 493 494 494 if (Map->mode == GV_MODE_WRITE || Map->mode == GV_MODE_RW) 495 Vect_build(Map , stderr);495 Vect_build(Map); 496 496 497 497 Vect_close(Map); -
grass/branches/develbranch_6/lib/vector/Vlib/break_lines.c
r33779 r34288 29 29 \param type feature type 30 30 \param[out] Err vector map where points at intersections will be written or NULL 31 \param[out] msgout file pointer where messages will be written or NULL32 31 33 32 \return … … 35 34 36 35 void 37 Vect_break_lines(struct Map_info *Map, int type, struct Map_info *Err, 38 FILE * msgout) 36 Vect_break_lines(struct Map_info *Map, int type, struct Map_info *Err) 39 37 { 40 Vect_break_lines_list(Map, NULL, NULL, type, Err , msgout);38 Vect_break_lines_list(Map, NULL, NULL, type, Err); 41 39 42 40 return; … … 61 59 \param type feature type 62 60 \param[out] Err vector map where points at intersections will be written or NULL 63 \param[out] msgout file pointer where messages will be written or NULL64 61 65 62 \return number of intersections … … 68 65 int 69 66 Vect_break_lines_list(struct Map_info *Map, struct ilist *List_break, 70 struct ilist *List_ref, int type, struct Map_info *Err, 71 FILE * msgout) 67 struct ilist *List_ref, int type, struct Map_info *Err) 72 68 { 73 69 struct line_pnts *APoints, *BPoints, *Points; … … 85 81 int node, anode1, anode2, bnode1, bnode2; 86 82 double nodex, nodey; 87 int printed;88 83 89 84 APoints = Vect_new_line_struct(); … … 117 112 */ 118 113 nbreaks = 0; 119 printed = 0; 120 121 if (msgout) 122 fprintf(msgout, _("%s %5d"), _("Intersections:"), nbreaks); 114 115 G_verbose_message(_("Intersections: %5d"), nbreaks); 123 116 124 117 for (iline = 0; iline < nlines; iline++) { … … 362 355 G_free(zx); 363 356 } 364 365 if (msgout && printed > 1000) {366 fprintf(msgout, "\r%s %5d (line %d)", _("Intersections:"),367 nbreaks, aline);368 fflush(msgout);369 printed = 0;370 }371 printed++;372 357 if (naxlines > 0) 373 358 break; /* first line was broken and deleted -> take the next one */ … … 383 368 } /* for each line */ 384 369 385 if (msgout) 386 fprintf(msgout, "\r%s %5d \n", 387 _("Intersections:"), nbreaks); 370 G_verbose_message(_("Intersections: %5d"), nbreaks); 388 371 389 372 Vect_destroy_list(List); -
grass/branches/develbranch_6/lib/vector/Vlib/break_polygons.c
r33605 r34288 56 56 \param type type of line to be broken 57 57 \param Err vector map where points at intersections will be written or NULL 58 \param msgout file pointer where messages will be written or NULL59 58 60 59 \return 61 60 */ 62 61 void 63 Vect_break_polygons(struct Map_info *Map, int type, struct Map_info *Err, 64 FILE * msgout) 62 Vect_break_polygons(struct Map_info *Map, int type, struct Map_info *Err) 65 63 { 66 64 struct line_pnts *BPoints, *Points; … … 74 72 double dx, dy, a1 = 0, a2 = 0; 75 73 int closed, last_point, cross; 76 int printed;77 74 78 75 RTree = RTreeNewIndex(); … … 94 91 XPnts = NULL; 95 92 96 printed = 0;97 93 for (i = 1; i <= nlines; i++) { 98 94 G_debug(3, "i = %d", i); … … 211 207 } 212 208 } 213 if (msgout && printed > 5000) {214 fprintf(msgout, "\r%s %d", _("Registering points"), npoints - 1);215 fflush(msgout);216 printed = 0;217 }218 printed++;219 209 } 220 if (msgout) {221 fprintf(msgout, "\r%s %d", _("Registering points"), npoints - 1);222 fprintf(msgout, "\n");223 fprintf(msgout, "%s: %5d\n", _("All points (vertices)"), nallpoints);224 fprintf(msgout, "%s: %5d\n",225 _("Registered points (unique coordinates)"), npoints - 1);226 fprintf(msgout, "%s: %5d\n", _("Points marked for break"), nmarks);227 }228 210 229 211 /* G_sleep (10); */ 230 212 231 213 nbreaks = 0; 232 if (msgout)233 fprintf(msgout, "%s: %5d", _("Breaks"), nbreaks);234 printed = 0;235 214 236 215 /* Second loop through lines (existing when loop is started, no need to process lines written again) … … 306 285 nbreaks++; 307 286 } 308 309 if (msgout && printed > 1000) {310 fprintf(msgout, "\r%s: %5d", _("Breaks"), nbreaks);311 fflush(msgout);312 printed = 0;313 }314 printed++;315 287 } 316 288 if (!broken && n_orig_points > Points->n_points) { /* was pruned before -> rewrite */ … … 329 301 } 330 302 } 331 332 if (msgout)333 fprintf(msgout, "\r%s: %5d", _("Breaks"), nbreaks);334 303 335 304 /* Write points on breaks */ … … 345 314 } 346 315 347 if (msgout)348 fprintf(msgout, "\n");349 350 316 G_free(XPnts); 351 317 RTreeDestroyNode(RTree); -
grass/branches/develbranch_6/lib/vector/Vlib/bridges.c
r33605 r34288 24 24 25 25 static void 26 remove_bridges(struct Map_info *Map, int chtype, struct Map_info *Err, 27 FILE * msgout); 26 remove_bridges(struct Map_info *Map, int chtype, struct Map_info *Err); 28 27 29 28 /*! … … 38 37 \param Map input map where bridges are deleted 39 38 \param Err vector map where deleted bridges are written or NULL 40 \param msgout file pointer where messages will be written or NULL41 39 42 40 \return … … 44 42 45 43 void 46 Vect_remove_bridges(struct Map_info *Map, struct Map_info *Err , FILE * msgout)44 Vect_remove_bridges(struct Map_info *Map, struct Map_info *Err) 47 45 { 48 remove_bridges(Map, 0, Err , msgout);46 remove_bridges(Map, 0, Err); 49 47 } 50 48 … … 60 58 \param Map input map where bridges are changed 61 59 \param Err vector map where changed bridges are written or NULL 62 \param msgout file pointer where messages will be written or NULL63 60 64 61 \return … … 66 63 67 64 void 68 Vect_chtype_bridges(struct Map_info *Map, struct Map_info *Err , FILE * msgout)65 Vect_chtype_bridges(struct Map_info *Map, struct Map_info *Err) 69 66 { 70 remove_bridges(Map, 1, Err , msgout);67 remove_bridges(Map, 1, Err); 71 68 } 72 69 … … 85 82 */ 86 83 void 87 remove_bridges(struct Map_info *Map, int chtype, struct Map_info *Err, 88 FILE * msgout) 84 remove_bridges(struct Map_info *Map, int chtype, struct Map_info *Err) 89 85 { 90 86 int i, type, nlines, line; … … 116 112 117 113 G_debug(1, "nlines = %d", nlines); 118 119 if (msgout)120 fprintf(msgout, "%s: %5d %s: %5d",121 _("Removed bridges"), bridges_removed, lmsg, lines_removed);122 114 123 115 for (line = 1; line <= nlines; line++) { … … 197 189 bridges_removed++; 198 190 } 199 200 if (msgout) {201 fprintf(msgout, "\r%s: %5d %s: %5d",202 _("Removed bridges"), bridges_removed, lmsg,203 lines_removed);204 fflush(msgout);205 }206 }207 if (msgout) {208 fprintf(msgout, "\r%s: %5d %s: %5d",209 _("Removed bridges"), bridges_removed, lmsg, lines_removed);210 fprintf(msgout, "\n");211 191 } 212 192 } -
grass/branches/develbranch_6/lib/vector/Vlib/build.c
r33641 r34288 43 43 }; 44 44 45 FILE *Msgout = NULL;46 47 48 int prnmsg(char *msg, ...)49 {50 char buffer[1000];51 va_list ap;52 53 if (G_verbose() == G_verbose_min())54 return 1;55 56 if (Msgout != NULL) {57 va_start(ap, msg);58 vsprintf(buffer, msg, ap);59 va_end(ap);60 fprintf(Msgout, "%s", buffer);61 fflush(Msgout);62 }63 64 return 1;65 }66 67 45 /*! 68 46 \brief Build topology for vector map 69 47 70 48 \param Map vector map 71 \param msgout file for message output (stdout/stderr for example) or NULL72 49 73 50 \return 1 on success 74 51 \return 0 on error 75 52 */ 76 int Vect_build(struct Map_info *Map , FILE * msgout)77 { 78 return Vect_build_partial(Map, GV_BUILD_ALL , msgout);53 int Vect_build(struct Map_info *Map) 54 { 55 return Vect_build_partial(Map, GV_BUILD_ALL); 79 56 } 80 57 … … 125 102 \param Map vector map 126 103 \param build highest level of build 127 \param msgout file pointer for message output (stdout/stderr for example) or NULL128 104 129 105 \return 1 on success, 0 on error 130 106 */ 131 int Vect_build_partial(struct Map_info *Map, int build , FILE * msgout)107 int Vect_build_partial(struct Map_info *Map, int build) 132 108 { 133 109 struct Plus_head *plus; … … 135 111 136 112 G_debug(3, "Vect_build(): build = %d", build); 137 Msgout = msgout;138 113 139 114 /* If topology is already build (map on level2), set level to 1 so that lines will … … 145 120 146 121 plus = &(Map->plus); 147 prnmsg(_("Building topology for vector map <%s>...\n"),148 Vect_get_name(Map));122 G_verbose_message(_("Building topology for vector map <%s>..."), 123 Vect_get_name(Map)); 149 124 plus->with_z = Map->head.with_z; 150 125 plus->spidx_with_z = Map->head.with_z; … … 155 130 } 156 131 157 ret = ((*Build_array[Map->format]) (Map, build , msgout));132 ret = ((*Build_array[Map->format]) (Map, build)); 158 133 159 134 if (ret == 0) { … … 161 136 } 162 137 163 prnmsg(_("Topology was built\n"));138 G_verbose_message(_("Topology was built")); 164 139 165 140 Map->level = LEVEL_2; … … 171 146 } 172 147 173 /* prnmsg ("Topology was built.\n") ; */ 174 175 prnmsg(_("Number of nodes : %d\n"), plus->n_nodes); 176 prnmsg(_("Number of primitives: %d\n"), plus->n_lines); 177 prnmsg(_("Number of points : %d\n"), plus->n_plines); 178 prnmsg(_("Number of lines : %d\n"), plus->n_llines); 179 prnmsg(_("Number of boundaries: %d\n"), plus->n_blines); 180 prnmsg(_("Number of centroids : %d\n"), plus->n_clines); 148 G_verbose_message(_("Number of nodes: %d"), plus->n_nodes); 149 G_verbose_message(_("Number of primitives: %d"), plus->n_lines); 150 G_verbose_message(_("Number of points: %d"), plus->n_plines); 151 G_verbose_message(_("Number of lines: %d"), plus->n_llines); 152 G_verbose_message(_("Number of boundaries: %d"), plus->n_blines); 153 G_verbose_message(_("Number of centroids: %d"), plus->n_clines); 181 154 182 155 if (plus->n_flines > 0) 183 prnmsg(_("Number of faces : %d\n"), plus->n_flines);156 G_verbose_message(_("Number of faces: %d"), plus->n_flines); 184 157 185 158 if (plus->n_klines > 0) 186 prnmsg(_("Number of kernels : %d\n"), plus->n_klines);159 G_verbose_message(_("Number of kernels: %d"), plus->n_klines); 187 160 188 161 if (plus->built >= GV_BUILD_AREAS) { … … 224 197 } 225 198 226 prnmsg(_("Number of areas : %d\n"), plus->n_areas);227 prnmsg(_("Number of isles : %d\n"), plus->n_isles);199 G_verbose_message(_("Number of areas: %d"), plus->n_areas); 200 G_verbose_message(_("Number of isles: %d"), plus->n_isles); 228 201 229 202 if (err_boundaries) 230 prnmsg(_("Number of incorrect boundaries : %d\n"),231 err_boundaries);203 G_verbose_message(_("Number of incorrect boundaries: %d"), 204 err_boundaries); 232 205 233 206 if (err_centr_out) 234 prnmsg(_("Number of centroids outside area : %d\n"),235 err_centr_out);207 G_verbose_message(_("Number of centroids outside area: %d"), 208 err_centr_out); 236 209 237 210 if (err_centr_dupl) 238 prnmsg(_("Number of duplicate centroids : %d\n"),239 err_centr_dupl);211 G_verbose_message(_("Number of duplicate centroids: %d"), 212 err_centr_dupl); 240 213 241 214 if (err_nocentr) 242 prnmsg(_("Number of areas without centroid : %d\n"),243 err_nocentr);215 G_verbose_message(_("Number of areas without centroid: %d"), 216 err_nocentr); 244 217 245 218 } 246 219 else { 247 prnmsg(_("Number of areas : -\n"));248 prnmsg(_("Number of isles : -\n"));220 G_verbose_message(_("Number of areas: -")); 221 G_verbose_message(_("Number of isles: -")); 249 222 } 250 223 return 1; … … 455 428 { 456 429 if (!(Map->plus.Spidx_built)) { 457 Vect_build_sidx_from_topo(Map , NULL);430 Vect_build_sidx_from_topo(Map); 458 431 } 459 432 -
grass/branches/develbranch_6/lib/vector/Vlib/build_nat.c
r33779 r34288 23 23 #include <grass/gis.h> 24 24 #include <grass/Vect.h> 25 26 extern FILE *Msgout;27 extern int prnmsg(char *msg, ...);28 25 29 26 /*! … … 418 415 \param Map_info vector map 419 416 \param build build level 420 \param msgout message output (stdout/stderr for example) or NULL421 417 422 418 \return 1 on success 423 419 \return 0 on error 424 420 */ 425 int Vect_build_nat(struct Map_info *Map, int build , FILE * msgout)421 int Vect_build_nat(struct Map_info *Map, int build) 426 422 { 427 423 struct Plus_head *plus; … … 440 436 441 437 plus = &(Map->plus); 442 Msgout = msgout;443 438 444 439 if (build == plus->built) … … 508 503 /* register lines, create nodes */ 509 504 Vect_rewind(Map); 510 prnmsg(_("Registering primitives:"));505 G_verbose_message(_("Registering primitives:")); 511 506 i = 1; 512 507 j = 1; … … 548 543 dig_cidx_add_cat(plus, 0, 0, lineid, type); 549 544 } 550 551 /* print progress */552 if (i == 1000) {553 prnmsg("%7d\b\b\b\b\b\b\b", j);554 i = 0;555 }556 545 i++; 557 546 j++; 558 547 } 559 prnmsg("\r%d %s \n", plus->n_lines, 560 _("primitives registered")); 561 prnmsg("%d %s\n", npoints, _("vertices registered")); 548 G_verbose_message(_("%d primitives registered"), plus->n_lines); 549 G_verbose_message(_("%d vertices registered"), npoints); 562 550 563 551 plus->built = GV_BUILD_BASE; … … 570 558 /* Build areas */ 571 559 /* Go through all bundaries and try to build area for both sides */ 572 prnmsg(_("Building areas:"));560 G_verbose_message(_("Building areas:")); 573 561 for (i = 1; i <= plus->n_lines; i++) { 574 G_percent 2(i, plus->n_lines, 1, msgout);562 G_percent(i, plus->n_lines, 1); 575 563 576 564 /* build */ … … 593 581 } 594 582 } 595 prnmsg("\r%d %s \n%d %s\n", plus->n_areas, _("areas built"),596 plus->n_isles, _("isles built"));583 G_verbose_message(_("%d areas built"), plus->n_areas); 584 G_verbose_message(_("%d isles built"), plus->n_isles); 597 585 plus->built = GV_BUILD_AREAS; 598 586 } … … 603 591 /* Attach isles to areas */ 604 592 if (plus->built < GV_BUILD_ATTACH_ISLES) { 605 prnmsg(_("Attaching islands:"));593 G_verbose_message(_("Attaching islands:")); 606 594 for (i = 1; i <= plus->n_isles; i++) { 607 G_percent 2(i, plus->n_isles, 1, msgout);595 G_percent(i, plus->n_isles, 1); 608 596 Vect_attach_isle(Map, i); 609 597 } 610 if (i == 1)611 prnmsg("\n");612 598 plus->built = GV_BUILD_ATTACH_ISLES; 613 599 } … … 620 606 int nlines; 621 607 622 prnmsg(_("Attaching centroids:"));608 G_verbose_message(_("Attaching centroids:")); 623 609 624 610 nlines = Vect_get_num_lines(Map); 625 611 for (line = 1; line <= nlines; line++) { 626 G_percent 2(line, nlines, 1, msgout);612 G_percent(line, nlines, 1); 627 613 628 614 Line = plus->Line[line]; -
grass/branches/develbranch_6/lib/vector/Vlib/build_ogr.c
r32583 r34288 36 36 #ifdef HAVE_OGR 37 37 #include <ogr_api.h> 38 39 extern FILE *Msgout;40 extern int prnmsg(char *msg, ...);41 38 42 39 /* … … 322 319 \param Map_info vector map 323 320 \param build build level 324 \param msgout message output (stdout/stderr for example) or NULL325 321 326 322 \return 1 on success 327 323 \return 0 on error 328 324 */ 329 int Vect_build_ogr(struct Map_info *Map, int build , FILE * msgout)325 int Vect_build_ogr(struct Map_info *Map, int build) 330 326 { 331 327 int iFeature, count, FID; … … 337 333 G_fatal_error(_("Partial build for OGR is not supported")); 338 334 339 Msgout = msgout;340 341 335 /* TODO move this init to better place (Vect_open_ ?), because in theory build may be reused on level2 */ 342 336 Map->fInfo.ogr.offset = NULL; … … 353 347 354 348 /* Note: Do not use OGR_L_GetFeatureCount (it may scan all features)!!! */ 355 prnmsg(_("Feature: "));349 G_verbose_message(_("Feature: ")); 356 350 357 351 OGR_L_ResetReading(Map->fInfo.ogr.layer); … … 363 357 G_debug(4, "---- Feature %d ----", iFeature); 364 358 365 /* print progress */366 if (count == 1000) {367 prnmsg("%7d\b\b\b\b\b\b\b", iFeature);368 count = 0;369 }370 371 359 hGeom = OGR_F_GetGeometryRef(hFeature); 372 360 if (hGeom == NULL) { … … 392 380 free_parts(&parts); 393 381 394 prnmsg("%4d\n", iFeature);395 396 382 Map->plus.built = GV_BUILD_ALL; 397 383 return 1; -
grass/branches/develbranch_6/lib/vector/Vlib/clean_nodes.c
r32527 r34288 33 33 \param Map input map 34 34 \param Err vector map where error line segments are written 35 \param msgout file pointer where messages will be written or NULL36 35 37 36 \return number of line modifications … … 39 38 int 40 39 Vect_clean_small_angles_at_nodes(struct Map_info *Map, int otype, 41 struct Map_info *Err , FILE * msgout)40 struct Map_info *Err) 42 41 { 43 42 int node; … … 50 49 LCats = Vect_new_cats_struct(); 51 50 OCats = Vect_new_cats_struct(); 52 53 if (msgout)54 fprintf(msgout, "%s: %5d", _("Modifications"), nmodif);55 51 56 52 for (node = 1; node <= Vect_get_num_nodes(Map); node++) { … … 247 243 } 248 244 249 if (msgout) {250 fprintf(msgout, "\r%s: %5d", _("Modifications"), nmodif);251 fflush(msgout);252 }253 254 245 if (clean) 255 246 break; 256 257 247 } 258 259 248 } 260 if (msgout)261 fprintf(stderr, "\n");262 249 263 250 return (nmodif); -
grass/branches/develbranch_6/lib/vector/Vlib/dangles.c
r33605 r34288 28 28 29 29 static void dangles(struct Map_info *, int, int, double, 30 struct Map_info *, FILE *,struct ilist *);30 struct Map_info *, struct ilist *); 31 31 32 32 /*! … … 48 48 \param maxlength maxlength of dangles or -1 for all dangles 49 49 \param Err vector map where deleted dangles are written or NULL 50 \param msgout file pointer where messages will be written or NULL51 50 52 51 \return … … 54 53 void 55 54 Vect_remove_dangles(struct Map_info *Map, int type, double maxlength, 56 struct Map_info *Err , FILE * msgout)57 { 58 dangles(Map, type, REMOVE_DANGLE, maxlength, Err, msgout,NULL);55 struct Map_info *Err) 56 { 57 dangles(Map, type, REMOVE_DANGLE, maxlength, Err, NULL); 59 58 } 60 59 … … 75 74 \param maxlength maxlength of dangles or -1 for all dangles 76 75 \param Err vector map where deleted dangles are written or NULL 77 \param msgout file pointer where messages will be written or NULL78 76 79 77 \return … … 81 79 void 82 80 Vect_chtype_dangles(struct Map_info *Map, double maxlength, 83 struct Map_info *Err , FILE * msgout)84 { 85 dangles(Map, 0, CHTYPE_DANGLE, maxlength, Err, msgout,NULL);81 struct Map_info *Err) 82 { 83 dangles(Map, 0, CHTYPE_DANGLE, maxlength, Err, NULL); 86 84 } 87 85 … … 100 98 \param type type of dangles (GV_LINES, GV_LINE or GV_BOUNDARY) 101 99 \param maxlength maxlength of dangles or -1 for all dangles 102 \param msgout file pointer where messages will be written or NULL103 100 104 101 \return … … 106 103 void 107 104 Vect_select_dangles(struct Map_info *Map, int type, double maxlength, 108 FILE * msgout,struct ilist *List)109 { 110 dangles(Map, type, SELECT_DANGLE, maxlength, NULL, msgout,List);105 struct ilist *List) 106 { 107 dangles(Map, type, SELECT_DANGLE, maxlength, NULL, List); 111 108 } 112 109 … … 127 124 maxlength maxlength of dangles or -1 for all dangles 128 125 Err vector map where deleted dangles are written or NULL 129 msgout file pointer where messages will be written or NULL130 126 List_dangle list of feature (selected dangles) ids 131 127 */ 132 128 static void dangles(struct Map_info *Map, int type, int option, 133 double maxlength, struct Map_info *Err, FILE * msgout,129 double maxlength, struct Map_info *Err, 134 130 struct ilist *List_dangle) 135 131 { … … 169 165 List = Vect_new_list(); 170 166 171 if (msgout)172 fprintf(msgout, "%s %5d %s: %5d",173 _("Removed dangles:"), dangles_removed, lmsg, lines_removed);174 175 167 nnodes = Vect_get_num_nodes(Map); 176 168 G_debug(2, "nnodes = %d", nnodes); … … 267 259 } /* delete the chain */ 268 260 269 if (msgout) {270 if (msgout)271 fprintf(msgout, "\r%s %5d %s: %5d",272 _("Removed dangles:"), dangles_removed, lmsg,273 lines_removed);274 fflush(msgout);275 }276 277 261 dangles_removed++; 278 262 } /* lcount == 1 */ 279 263 } /* node <= nnodes */ 280 281 if (msgout) { 282 if (msgout) 283 fprintf(msgout, "\r%s %5d %s: %5d", 284 _("Removed dangles:"), dangles_removed, lmsg, 285 lines_removed); 286 fprintf(msgout, "\n"); 287 } 288 } 264 } -
grass/branches/develbranch_6/lib/vector/Vlib/map.c
r32941 r34288 149 149 \param[in] mapset mapset name 150 150 \param[in] out output vector map name 151 \param[in] msgout output file for messages or NULL152 151 153 152 \return -1 error … … 155 154 */ 156 155 int 157 Vect_copy(const char *in, const char *mapset, const char *out , FILE * msgout)156 Vect_copy(const char *in, const char *mapset, const char *out) 158 157 { 159 158 int i, n, ret, type; … … 295 294 \param[in] in input vector map name 296 295 \param[in] out output vector map name 297 \param[in] msgout output file for messages or NULL298 296 299 297 \return -1 error 300 298 \return 0 success 301 299 */ 302 int Vect_rename(const char *in, const char *out , FILE * msgout)300 int Vect_rename(const char *in, const char *out) 303 301 { 304 302 int i, n, ret, type; -
grass/branches/develbranch_6/lib/vector/Vlib/open.c
r33206 r34288 446 446 447 447 /* Build spatial index from topo */ 448 Vect_build_sidx_from_topo(Map , NULL);448 Vect_build_sidx_from_topo(Map); 449 449 } 450 450 -
grass/branches/develbranch_6/lib/vector/Vlib/remove_areas.c
r32527 r34288 32 32 \param thresh maximum area size for removed areas 33 33 \param Err vector map where removed lines and centroids are written 34 \param msgout file pointer where messages will be written or NULL35 34 \param removed_area pointer to where total size of removed area is stored or NULL 36 35 … … 39 38 int 40 39 Vect_remove_small_areas(struct Map_info *Map, double thresh, 41 struct Map_info *Err, FILE * msgout, 42 double *removed_area) 40 struct Map_info *Err, double *removed_area) 43 41 { 44 42 int area; … … 54 52 Points = Vect_new_line_struct(); 55 53 Cats = Vect_new_cats_struct(); 56 57 if (msgout)58 fprintf(msgout, "%s: %5d", _("Removed areas"), nremoved);59 54 60 55 for (area = 1; area <= Vect_get_num_areas(Map); area++) { … … 176 171 177 172 nremoved++; 178 if (msgout) {179 fprintf(msgout, "\r%s: %5d", _("Removed areas"), nremoved);180 fflush(stderr);181 }182 173 } 183 if (msgout)184 fprintf(stderr, "\n");185 174 186 175 if (removed_area) -
grass/branches/develbranch_6/lib/vector/Vlib/remove_duplicates.c
r33605 r34288 32 32 \param type type of line to be delete 33 33 \param Err vector map where duplicate lines will be written or NULL 34 \param msgout file pointer where messages will be written or NULL35 34 36 35 \return void 37 36 */ 38 37 void 39 Vect_remove_duplicates(struct Map_info *Map, int type, struct Map_info *Err, 40 FILE * msgout) 38 Vect_remove_duplicates(struct Map_info *Map, int type, struct Map_info *Err) 41 39 { 42 40 struct line_pnts *APoints, *BPoints; … … 65 63 66 64 ndupl = 0; 67 68 if (msgout)69 fprintf(msgout, "%s: %5d", _("Duplicates"), ndupl);70 65 71 66 for (i = 1; i <= nlines; i++) { … … 114 109 ndupl++; 115 110 116 if (msgout) {117 fprintf(msgout, "\r%s: %5d", _("Duplicates"), ndupl);118 fflush(msgout);119 }120 121 111 break; /* line was deleted -> take the next one */ 122 112 } … … 124 114 G_debug(3, "nlines = %d\n", nlines); 125 115 } 126 if (msgout)127 fprintf(msgout, "\n");128 129 return;130 116 } 131 117 -
grass/branches/develbranch_6/lib/vector/Vlib/select.c
r32527 r34288 51 51 if (!(plus->Spidx_built)) { 52 52 G_debug(3, "Building spatial index."); 53 Vect_build_sidx_from_topo(Map , NULL);53 Vect_build_sidx_from_topo(Map); 54 54 } 55 55 … … 101 101 if (!(Map->plus.Spidx_built)) { 102 102 G_debug(3, "Building spatial index."); 103 Vect_build_sidx_from_topo(Map , NULL);103 Vect_build_sidx_from_topo(Map); 104 104 } 105 105 … … 138 138 if (!(Map->plus.Spidx_built)) { 139 139 G_debug(3, "Building spatial index."); 140 Vect_build_sidx_from_topo(Map , NULL);140 Vect_build_sidx_from_topo(Map); 141 141 } 142 142 … … 170 170 if (!(plus->Spidx_built)) { 171 171 G_debug(3, "Building spatial index."); 172 Vect_build_sidx_from_topo(Map , NULL);172 Vect_build_sidx_from_topo(Map); 173 173 } 174 174 -
grass/branches/develbranch_6/lib/vector/Vlib/sindex.c
r32583 r34288 122 122 \return 1 error 123 123 */ 124 int Vect_build_spatial_index(struct Map_info *Map , FILE * msgout)124 int Vect_build_spatial_index(struct Map_info *Map) 125 125 { 126 126 if (Map->level < 2) { … … 129 129 } 130 130 if (!(Map->plus.Spidx_built)) { 131 return (Vect_build_sidx_from_topo(Map , msgout));131 return (Vect_build_sidx_from_topo(Map)); 132 132 } 133 133 return 0; … … 138 138 139 139 \param Map pointer to vector map 140 \param msgout print progress here141 140 142 141 \return 0 OK 143 142 \return 1 error 144 143 */ 145 int Vect_build_sidx_from_topo(struct Map_info *Map , FILE * msgout)144 int Vect_build_sidx_from_topo(struct Map_info *Map) 146 145 { 147 146 int i, total, done; … … 163 162 /* Nodes */ 164 163 for (i = 1; i <= plus->n_nodes; i++) { 165 G_percent 2(i, total, 1, msgout);164 G_percent(i, total, 1); 166 165 167 166 Node = plus->Node[i]; … … 175 174 done = plus->n_nodes; 176 175 for (i = 1; i <= plus->n_lines; i++) { 177 G_percent 2(done + i, total, 1, msgout);176 G_percent(done + i, total, 1); 178 177 179 178 Line = plus->Line[i]; … … 194 193 done += plus->n_lines; 195 194 for (i = 1; i <= plus->n_areas; i++) { 196 G_percent 2(done + i, total, 1, msgout);195 G_percent(done + i, total, 1); 197 196 198 197 Area = plus->Area[i]; … … 213 212 done += plus->n_areas; 214 213 for (i = 1; i <= plus->n_isles; i++) { 215 G_percent 2(done + i, total, 1, msgout);214 G_percent(done + i, total, 1); 216 215 217 216 Isle = plus->Isle[i]; -
grass/branches/develbranch_6/lib/vector/Vlib/snap.c
r33605 r34288 62 62 * \param[in] thresh threshold in which snap vertices 63 63 * \param[out] Err vector map where lines representing snap are written or NULL 64 * \param[out] msgout file pointer where messages will be written or NULL65 64 * 66 65 * \return void … … 80 79 void 81 80 Vect_snap_lines_list(struct Map_info *Map, struct ilist *List_lines, 82 double thresh, struct Map_info *Err , FILE * msgout)81 double thresh, struct Map_info *Err) 83 82 { 84 83 struct line_pnts *Points, *NPoints; … … 86 85 int line, ltype, line_idx; 87 86 double thresh2; 88 int printed;89 87 90 88 struct Node *RTree; … … 100 98 int *Index = NULL; /* indexes of anchors for vertices */ 101 99 int aindex = 0; /* allocated Index */ 102 int width = 26; /* fprintf width */103 100 104 101 if (List_lines->n_values < 1) … … 118 115 nvertices = 0; 119 116 XPnts = NULL; 120 printed = 0;121 122 if (msgout)123 fprintf(msgout, "%s...", _("Registering points"));124 117 125 118 for (line_idx = 0; line_idx < List_lines->n_values; line_idx++) { … … 166 159 } 167 160 } 168 if (msgout && printed > 1000) {169 fprintf(msgout, "\r%s... %d", _("Registering points"), point - 1);170 fflush(msgout);171 printed = 0;172 }173 printed++;174 161 } 175 162 npoints = point - 1; 176 if (msgout) {177 fprintf(msgout,178 "\r \r");179 fprintf(msgout, "%-*s: %4d\n", width, _("All vertices"), nvertices);180 fprintf(msgout, "%-*s: %4d\n", width, _("Registered points"),181 npoints);182 }183 163 184 164 /* Go through all registered points and if not yet marked mark it as anchor and assign this anchor … … 226 206 } 227 207 } 228 if (msgout) {229 fprintf(msgout, "%-*s: %4d\n", width, _("Nodes marked as anchor"),230 nanchors);231 fprintf(msgout, "%-*s: %4d\n", width, _("Nodes marked to be snapped"),232 ntosnap);233 }234 208 235 209 /* Go through all lines and: … … 237 211 * 2) for all segments: snap it to all anchors in threshold (except anchors of vertices of course) */ 238 212 239 printed = 0;240 213 nsnapped = ncreated = 0; 241 if (msgout)242 fprintf(msgout, "%-*s: %4d", width, _("Snaps"), nsnapped + ncreated);243 214 244 215 for (line_idx = 0; line_idx < List_lines->n_values; line_idx++) { … … 407 378 } 408 379 } 409 410 if (msgout && printed > 1000) {411 fprintf(msgout, "\r%s: %5d (line = %d)", _("Snaps"),412 nsnapped + ncreated, line);413 fflush(msgout);414 printed = 0;415 }416 printed++;417 380 } /* for each line */ 418 419 if (msgout) {420 fprintf(msgout, "\r%-*s: %4d\n", width, _("Snapped vertices"),421 nsnapped);422 fprintf(msgout, "%-*s: %4d\n", width, _("New vertices"), ncreated);423 }424 381 425 382 Vect_destroy_line_struct(Points); … … 454 411 * \param[in] thresh threshold in which snap vertices 455 412 * \param[out] Err vector map where lines representing snap are written or NULL 456 * \param[out] msgout file pointer where messages will be written or NULL457 413 * 458 414 * \return void … … 460 416 void 461 417 Vect_snap_lines(struct Map_info *Map, int type, double thresh, 462 struct Map_info *Err , FILE * msgout)418 struct Map_info *Err) 463 419 { 464 420 int line, nlines, ltype; … … 484 440 } 485 441 486 Vect_snap_lines_list(Map, List, thresh, Err , msgout);442 Vect_snap_lines_list(Map, List, thresh, Err); 487 443 488 444 Vect_destroy_list(List); -
grass/branches/develbranch_6/lib/vector/vedit/select.c
r33124 r34288 91 91 92 92 /* select dangles shorter than 'thresh_tmp' */ 93 Vect_select_dangles(Map, type, thresh_tmp, NULL,List_dangle);93 Vect_select_dangles(Map, type, thresh_tmp, List_dangle); 94 94 95 95 if (thresh <= 0.0) { /* shorter than */ -
grass/branches/develbranch_6/raster/r.carve/vect.c
r32527 r34288 43 43 { 44 44 if (build_support) 45 Vect_build(map , stderr);45 Vect_build(map); 46 46 47 47 Vect_set_release_support(map); -
grass/branches/develbranch_6/raster/r.contour/main.c
r32583 r34288 225 225 db_close_database_shutdown_driver(Driver); 226 226 227 Vect_build(&Map , stderr);227 Vect_build(&Map); 228 228 Vect_close(&Map); 229 229 -
grass/branches/develbranch_6/raster/r.flow/io.c
r32583 r34288 182 182 G_close_cell(lgfd); */ 183 183 if (parm.flout) { 184 Vect_build(&fl , stderr);184 Vect_build(&fl); 185 185 Vect_close(&fl); 186 186 } -
grass/branches/develbranch_6/raster/r.random/random.c
r32583 r34288 252 252 db_commit_transaction(driver); 253 253 db_close_database_shutdown_driver(driver); 254 Vect_build(&Out , stderr);254 Vect_build(&Out); 255 255 Vect_close(&Out); 256 256 } -
grass/branches/develbranch_6/raster/r.to.vect/main.c
r33605 r34288 233 233 234 234 if (!no_topol->answer) 235 Vect_build(&Map , stderr);235 Vect_build(&Map); 236 236 237 237 -
grass/branches/develbranch_6/vector/lidar/v.outlier/main.c
r33779 r34288 352 352 Vect_close(&Outlier); 353 353 if (qgis_opt->answer) { 354 Vect_build(&Qgis , stderr);354 Vect_build(&Qgis); 355 355 Vect_close(&Qgis); 356 356 } -
grass/branches/develbranch_6/vector/v.buffer/main.c
r32696 r34288 222 222 223 223 G_message(_("Rebuilding topology...")); 224 Vect_build_partial(Out, GV_BUILD_NONE , NULL);225 Vect_build(Out , stderr);224 Vect_build_partial(Out, GV_BUILD_NONE); 225 Vect_build(Out); 226 226 Vect_close(Out); 227 227 } … … 606 606 /* Break lines */ 607 607 G_message(_("Building parts of topology...")); 608 Vect_build_partial(&Out, GV_BUILD_BASE , stderr);608 Vect_build_partial(&Out, GV_BUILD_BASE); 609 609 610 610 /* Warning: snapping must be done, otherwise colinear boundaries are not broken and … … 618 618 * calculate different threshold for each map, depending on map's bounding box */ 619 619 G_message(_("Snapping boundaries...")); 620 Vect_snap_lines(&Out, GV_BOUNDARY, 1e-7, NULL , stderr);620 Vect_snap_lines(&Out, GV_BOUNDARY, 1e-7, NULL); 621 621 622 622 G_message(_("Breaking boundaries...")); 623 Vect_break_lines(&Out, GV_BOUNDARY, NULL , stderr);623 Vect_break_lines(&Out, GV_BOUNDARY, NULL); 624 624 625 625 G_message(_("Removing duplicates...")); 626 Vect_remove_duplicates(&Out, GV_BOUNDARY, NULL , stderr);626 Vect_remove_duplicates(&Out, GV_BOUNDARY, NULL); 627 627 628 628 /* Dangles and bridges don't seem to be necessary if snapping is small enough. */ … … 636 636 637 637 G_message(_("Attaching islands...")); 638 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES , stderr);638 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES); 639 639 640 640 /* Calculate new centroids for all areas */ … … 750 750 751 751 G_message(_("Attaching centroids...")); 752 Vect_build_partial(&Out, GV_BUILD_CENTROIDS , stderr);752 Vect_build_partial(&Out, GV_BUILD_CENTROIDS); 753 753 754 754 stop(&In, &Out); -
grass/branches/develbranch_6/vector/v.build.polylines/main.c
r33351 r34288 220 220 Vect_close(&map); 221 221 222 if (G_verbose() > G_verbose_min()) 223 Vect_build(&Out, stderr); 224 else 225 Vect_build(&Out, NULL); 226 222 Vect_build(&Out); 227 223 Vect_close(&Out); 228 224 -
grass/branches/develbranch_6/vector/v.build/main.c
r32696 r34288 88 88 Vect_open_old(&Map, map_opt->answer, G_mapset()); 89 89 90 Vect_build(&Map , stderr);90 Vect_build(&Map); 91 91 } 92 92 /* dump topology */ … … 156 156 } 157 157 158 Vect_build(&Err , stderr);158 Vect_build(&Err); 159 159 Vect_close(&Err); 160 160 } -
grass/branches/develbranch_6/vector/v.category/main.c
r32583 r34288 488 488 option == O_SUM) { 489 489 Vect_copy_tables(&In, &Out, 0); 490 if (G_verbose() > G_verbose_min()) { 491 Vect_build(&Out, stderr); 492 } 493 else { 494 Vect_build(&Out, NULL); 495 } 490 Vect_build(&Out); 496 491 Vect_close(&Out); 497 492 } -
grass/branches/develbranch_6/vector/v.clean/main.c
r32583 r34288 37 37 int count; 38 38 double size; 39 FILE *output; /* NULL | stderr */40 39 41 40 G_gisinit(argv[0]); … … 284 283 Vect_close(&In); 285 284 286 if (G_verbose() > G_verbose_min())287 output = stderr;288 else289 output = NULL;290 291 285 /* Start with GV_BUILD_NONE and for each tool use unly the necessary level! */ 292 286 … … 295 289 tools[i] == TOOL_RMAREA) { 296 290 if (Vect_get_built(&Out) >= GV_BUILD_CENTROIDS) { 297 Vect_build_partial(&Out, GV_BUILD_CENTROIDS , NULL);291 Vect_build_partial(&Out, GV_BUILD_CENTROIDS); 298 292 } 299 293 else { 300 294 G_important_message(_("Rebuilding parts of topology...")); 301 Vect_build_partial(&Out, GV_BUILD_CENTROIDS , output);295 Vect_build_partial(&Out, GV_BUILD_CENTROIDS); 302 296 G_message(SEP); 303 297 } … … 305 299 else { 306 300 if (Vect_get_built(&Out) >= GV_BUILD_BASE) { 307 Vect_build_partial(&Out, GV_BUILD_BASE , NULL);301 Vect_build_partial(&Out, GV_BUILD_BASE); 308 302 } 309 303 else { 310 304 G_important_message(_("Rebuilding parts of topology...")); 311 Vect_build_partial(&Out, GV_BUILD_BASE , output);305 Vect_build_partial(&Out, GV_BUILD_BASE); 312 306 G_message(SEP); 313 307 } … … 317 311 case TOOL_BREAK: 318 312 G_message(_("Tool: Break lines at intersections")); 319 Vect_break_lines(&Out, otype, pErr , output);313 Vect_break_lines(&Out, otype, pErr); 320 314 break; 321 315 case TOOL_RMDUPL: 322 316 G_message(_("Tool: Remove duplicates")); 323 Vect_remove_duplicates(&Out, otype, pErr , output);317 Vect_remove_duplicates(&Out, otype, pErr); 324 318 break; 325 319 case TOOL_RMDANGLE: 326 320 G_message(_("Tool: Remove dangles")); 327 Vect_remove_dangles(&Out, otype, threshs[i], pErr , output);321 Vect_remove_dangles(&Out, otype, threshs[i], pErr); 328 322 break; 329 323 case TOOL_CHDANGLE: 330 324 G_message(_("Tool: Change type of boundary dangles")); 331 Vect_chtype_dangles(&Out, threshs[i], pErr , stderr);325 Vect_chtype_dangles(&Out, threshs[i], pErr); 332 326 break; 333 327 case TOOL_RMBRIDGE: 334 328 G_message(_("Tool: Remove bridges")); 335 Vect_remove_bridges(&Out, pErr , output);329 Vect_remove_bridges(&Out, pErr); 336 330 break; 337 331 case TOOL_CHBRIDGE: 338 332 G_message(_("Tool: Change type of boundary bridges")); 339 Vect_chtype_bridges(&Out, pErr , output);333 Vect_chtype_bridges(&Out, pErr); 340 334 break; 341 335 case TOOL_RMDAC: … … 345 339 case TOOL_SNAP: 346 340 G_message(_("Tool: Snap line to vertex in threshold")); 347 Vect_snap_lines(&Out, otype, threshs[i], pErr , output);341 Vect_snap_lines(&Out, otype, threshs[i], pErr); 348 342 break; 349 343 case TOOL_BPOL: 350 344 G_message(_("Tool: Break polygons")); 351 Vect_break_polygons(&Out, otype, pErr , stderr);345 Vect_break_polygons(&Out, otype, pErr); 352 346 break; 353 347 case TOOL_PRUNE: … … 358 352 G_message(_("Tool: Remove small areas")); 359 353 count = 360 Vect_remove_small_areas(&Out, threshs[i], pErr, output, 361 &size); 354 Vect_remove_small_areas(&Out, threshs[i], pErr, &size); 362 355 G_message(_("%d areas of total size %g removed"), count, size); 363 356 break; … … 365 358 G_message(_("Tool: Remove small angles at nodes")); 366 359 count = 367 Vect_clean_small_angles_at_nodes(&Out, otype, pErr , output);360 Vect_clean_small_angles_at_nodes(&Out, otype, pErr); 368 361 G_message(_("%d modifications done"), count); 369 362 break; … … 380 373 if (!no_build_flag->answer) { 381 374 G_important_message(_("Rebuilding topology for output vector map...")); 382 Vect_build_partial(&Out, GV_BUILD_NONE , NULL);383 Vect_build(&Out , output);375 Vect_build_partial(&Out, GV_BUILD_NONE); 376 Vect_build(&Out); 384 377 } 385 378 else { 386 Vect_build_partial(&Out, GV_BUILD_NONE , NULL); /* -> topo not saved */379 Vect_build_partial(&Out, GV_BUILD_NONE); /* -> topo not saved */ 387 380 } 388 381 Vect_close(&Out); … … 391 384 G_message(SEP); 392 385 G_important_message(_("Building topology for error vector map...")); 393 Vect_build(pErr , output);386 Vect_build(pErr); 394 387 Vect_close(pErr); 395 388 } -
grass/branches/develbranch_6/vector/v.clean/prune.c
r32583 r34288 57 57 58 58 if (Err) 59 Vect_build_partial(Err, GV_BUILD_BASE, NULL); 60 61 if (G_verbose() > G_verbose_min()) 62 fprintf(stderr, _("Removed vertices: %5d"), nremoved); 59 Vect_build_partial(Err, GV_BUILD_BASE); 63 60 64 61 for (line = 1; line <= nlines; line++) { … … 211 208 G_debug(4, "%d vertices removed", norig - TPoints->n_points); 212 209 } 213 214 if (G_verbose() > G_verbose_min())215 fprintf(stderr, "\r%s: %5d", _("Removed vertices"), nremoved);216 217 fflush(stderr);218 210 } 219 211 -
grass/branches/develbranch_6/vector/v.convert/old2new.c
r32583 r34288 142 142 attributes(in, &Mapout); 143 143 144 Vect_build(&Mapout , stderr);144 Vect_build(&Mapout); 145 145 Vect_close(&Mapout); 146 146 -
grass/branches/develbranch_6/vector/v.digit/centre.c
r32527 r34288 169 169 { 170 170 G_debug(1, "end()"); 171 Vect_build_partial(&Map, GV_BUILD_NONE , NULL);172 Vect_build(&Map , stdout);171 Vect_build_partial(&Map, GV_BUILD_NONE); 172 Vect_build(&Map); 173 173 Vect_close(&Map); 174 174 -
grass/branches/develbranch_6/vector/v.digit/main.c
r32696 r34288 150 150 G_message(_("New empty map created.")); 151 151 Vect_open_new(&Map, map_opt->answer, 0); 152 Vect_build(&Map , NULL);152 Vect_build(&Map); 153 153 Vect_close(&Map); 154 154 Vect_open_update(&Map, map_opt->answer, G_mapset()); -
grass/branches/develbranch_6/vector/v.distance/main.c
r33605 r34288 1141 1141 Vect_close(&From); 1142 1142 if (Outp != NULL) { 1143 if (G_verbose() > G_verbose_min()) 1144 Vect_build(Outp, stderr); 1145 else 1146 Vect_build(Outp, NULL); 1143 Vect_build(Outp); 1147 1144 Vect_close(Outp); 1148 1145 } -
grass/branches/develbranch_6/vector/v.drape/main.c
r34150 r34288 399 399 /* build topology for output vector */ 400 400 if (out_num > 0) { 401 if (G_verbose() > G_verbose_min()) { 402 Vect_build(&Out, stderr); 403 } 404 else { 405 Vect_build(&Out, NULL); 406 } 401 Vect_build(&Out); 407 402 408 403 /* Now let's move attribute data from all old map layers to new map */ -
grass/branches/develbranch_6/vector/v.edit/a2b.c
r33605 r34288 300 300 nlines_modified = 0; 301 301 302 Vect_build_partial(Map, GV_BUILD_BASE , NULL);302 Vect_build_partial(Map, GV_BUILD_BASE); 303 303 nlines = Vect_get_num_lines(Map); 304 304 -
grass/branches/develbranch_6/vector/v.edit/main.c
r33779 r34288 309 309 } 310 310 else { 311 ret = Vect_break_lines_list(&Map, List, NULL, 312 GV_LINES, NULL, NULL); 311 ret = Vect_break_lines_list(&Map, List, NULL, GV_LINES, NULL); 313 312 } 314 313 G_message(_("%d lines broken"), ret); … … 433 432 if (!(action_mode == MODE_SELECT || params.topo->answer == 1 || 434 433 !MODE_NONE)) { 435 Vect_build_partial(&Map, GV_BUILD_NONE, NULL); 436 if (G_verbose() > G_verbose_min()) 437 Vect_build(&Map, stderr); 438 else 439 Vect_build(&Map, NULL); 434 Vect_build_partial(&Map, GV_BUILD_NONE); 435 Vect_build(&Map); 440 436 } 441 437 -
grass/branches/develbranch_6/vector/v.edit/snap.c
r32527 r34288 32 32 int snap_lines(struct Map_info *Map, struct ilist *List, double thresh) 33 33 { 34 if (G_verbose() > G_verbose_min()) 35 G_important_message(SEP); 34 36 35 FILE *output;37 Vect_snap_lines_list(Map, List, thresh, NULL); 36 38 37 if (G_verbose() > G_verbose_min()) {39 if (G_verbose() > G_verbose_min()) 38 40 G_important_message(SEP); 39 output = stderr;40 }41 else42 output = NULL;43 44 Vect_snap_lines_list(Map, List, thresh, NULL, output);45 46 if (G_verbose() > G_verbose_min()) {47 G_important_message(SEP);48 }49 41 50 42 return 1; -
grass/branches/develbranch_6/vector/v.external/main.c
r32696 r34288 159 159 160 160 Vect_open_old(&Map, out_opt->answer, G_mapset()); 161 Vect_build(&Map , stderr);161 Vect_build(&Map); 162 162 Vect_close(&Map); 163 163 -
grass/branches/develbranch_6/vector/v.extract/main.c
r33639 r34288 375 375 field, type_only, r_flag->answer ? 1 : 0); 376 376 377 if (G_verbose() > G_verbose_min()) 378 Vect_build(&Out, stderr); 379 else 380 Vect_build(&Out, NULL); 381 377 Vect_build(&Out); 382 378 383 379 /* Copy tables */ … … 506 502 } 507 503 } 508 Vect_build_partial(&Out, GV_BUILD_NONE, NULL); 509 if (G_verbose() > G_verbose_min()) 510 Vect_build(&Out, stderr); 511 else 512 Vect_build(&Out, NULL); 504 Vect_build_partial(&Out, GV_BUILD_NONE); 505 Vect_build(&Out); 513 506 } 514 507 -
grass/branches/develbranch_6/vector/v.extrude/main.c
r33120 r34288 63 63 dbValue *value; 64 64 int more; 65 char *comment; 65 66 66 67 module = G_define_module(); … … 332 333 } 333 334 334 if (G_verbose() > G_verbose_min()) 335 Vect_build(&Out, stderr); 336 else 337 Vect_build(&Out, NULL); 335 Vect_build(&Out); 338 336 339 337 /* header */ 340 char *comment;341 342 338 G_asprintf(&comment, "Generated by %s from vector map <%s>", 343 339 G_program_name(), G_fully_qualified_name(old->answer, mapset)); -
grass/branches/develbranch_6/vector/v.generalize/main.c
r32696 r34288 437 437 * they may occur only if they were generalized */ 438 438 if (mask_type & GV_BOUNDARY) { 439 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES , NULL);439 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES); 440 440 n_lines = Vect_get_num_lines(&Out); 441 441 for (i = 1; i <= n_lines; i++) { … … 457 457 */ 458 458 if ((mask_type & GV_BOUNDARY) && method != DISPLACEMENT) { 459 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES , NULL);459 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES); 460 460 n_areas = Vect_get_num_areas(&Out); 461 461 for (i = 1; i <= n_areas; i++) { … … 477 477 /* remove small areas */ 478 478 if (rs_flag->answer && simplification && (mask_type & GV_AREA)) { 479 Vect_build_partial(&Out, GV_BUILD_CENTROIDS, NULL); 480 Vect_remove_small_areas(&Out, thresh, NULL, NULL, &slide); 481 } 482 483 if (G_verbose() > G_verbose_min()) 484 Vect_build(&Out, stderr); 485 else 486 Vect_build(&Out, NULL); 479 Vect_build_partial(&Out, GV_BUILD_CENTROIDS); 480 Vect_remove_small_areas(&Out, thresh, NULL, &slide); 481 } 482 483 Vect_build(&Out); 487 484 488 485 /* finally copy tables */ -
grass/branches/develbranch_6/vector/v.hull/main.c
r32696 r34288 374 374 375 375 /* clean up and bye bye */ 376 Vect_build(&Map , stderr);376 Vect_build(&Map); 377 377 Vect_close(&Map); 378 378 -
grass/branches/develbranch_6/vector/v.in.ascii/in.c
r32934 r34288 222 222 223 223 if (e_flag->answer) { 224 Vect_build(&Map , stderr);224 Vect_build(&Map); 225 225 Vect_close(&Map); 226 226 exit(EXIT_SUCCESS); … … 536 536 } 537 537 else { 538 Vect_build(&Map , stderr);538 Vect_build(&Map); 539 539 Vect_close(&Map); 540 540 } -
grass/branches/develbranch_6/vector/v.in.db/main.c
r32696 r34288 224 224 } 225 225 226 if (G_verbose() > G_verbose_min()) 227 Vect_build(&Map, stderr); 228 else 229 Vect_build(&Map, NULL); 230 226 Vect_build(&Map); 231 227 Vect_close(&Map); 232 228 -
grass/branches/develbranch_6/vector/v.in.dxf/main.c
r32946 r34288 186 186 if (Vect_open_old(Map, output, G_mapset())) { 187 187 if (!flag_topo) 188 if (!Vect_build(Map , stderr))188 if (!Vect_build(Map)) 189 189 G_warning(_("Building topology failed")); 190 190 Vect_close(Map); -
grass/branches/develbranch_6/vector/v.in.ogr/main.c
r32696 r34288 93 93 int layer_id; 94 94 int overwrite; 95 FILE *output;96 95 97 96 G_gisinit(argv[0]); … … 245 244 246 245 OGRRegisterAll(); 247 248 if (G_verbose() > G_verbose_min())249 output = stderr;250 else251 output = NULL;252 246 253 247 /* list supported formats */ … … 889 883 890 884 /* TODO: is it necessary to build here? probably not, consumes time */ 891 Vect_build(&Map , output);885 Vect_build(&Map); 892 886 893 887 if (!no_clean_flag->answer && … … 909 903 Vect_close(&Map); 910 904 Vect_open_update(&Map, out_opt->answer, G_mapset()); 911 Vect_build_partial(&Map, GV_BUILD_BASE , output); /* Downgrade topo */905 Vect_build_partial(&Map, GV_BUILD_BASE); /* Downgrade topo */ 912 906 913 907 if (snap >= 0) { 914 908 G_message("%s", separator); 915 909 G_message(_("Snap boundaries (threshold = %.3e):"), snap); 916 Vect_snap_lines(&Map, GV_BOUNDARY, snap, NULL , output);910 Vect_snap_lines(&Map, GV_BOUNDARY, snap, NULL); 917 911 } 918 912 … … 928 922 G_message("%s", separator); 929 923 G_message(_("Break polygons:")); 930 Vect_break_polygons(&Map, GV_BOUNDARY, NULL , output);924 Vect_break_polygons(&Map, GV_BOUNDARY, NULL); 931 925 932 926 /* It is important to remove also duplicate centroids in case of duplicate imput polygons */ 933 927 G_message("%s", separator); 934 928 G_message(_("Remove duplicates:")); 935 Vect_remove_duplicates(&Map, GV_BOUNDARY | GV_CENTROID, NULL , output);929 Vect_remove_duplicates(&Map, GV_BOUNDARY | GV_CENTROID, NULL); 936 930 937 931 /* Vect_clean_small_angles_at_nodes() can change the geometry so that new intersections … … 941 935 G_message("%s", separator); 942 936 G_message(_("Break boundaries:")); 943 Vect_break_lines(&Map, GV_BOUNDARY, NULL , output);937 Vect_break_lines(&Map, GV_BOUNDARY, NULL); 944 938 945 939 G_message("%s", separator); 946 940 G_message(_("Remove duplicates:")); 947 Vect_remove_duplicates(&Map, GV_BOUNDARY, NULL , output);941 Vect_remove_duplicates(&Map, GV_BOUNDARY, NULL); 948 942 949 943 G_message("%s", separator); 950 944 G_message(_("Clean boundaries at nodes:")); 951 945 nmodif = 952 Vect_clean_small_angles_at_nodes(&Map, GV_BOUNDARY, NULL, 953 output); 946 Vect_clean_small_angles_at_nodes(&Map, GV_BOUNDARY, NULL); 954 947 } while (nmodif > 0); 955 948 … … 957 950 if (type & GV_BOUNDARY) { /* that means lines were converted boundaries */ 958 951 G_message(_("Change boundary dangles to lines:")); 959 Vect_chtype_dangles(&Map, -1.0, NULL , output);952 Vect_chtype_dangles(&Map, -1.0, NULL); 960 953 } 961 954 else { 962 955 G_message(_("Change dangles to lines:")); 963 Vect_remove_dangles(&Map, GV_BOUNDARY, -1.0, NULL , output);956 Vect_remove_dangles(&Map, GV_BOUNDARY, -1.0, NULL); 964 957 } 965 958 … … 967 960 if (type & GV_BOUNDARY) { 968 961 G_message(_("Change boundary bridges to lines:")); 969 Vect_chtype_bridges(&Map, NULL , output);962 Vect_chtype_bridges(&Map, NULL); 970 963 } 971 964 else { 972 965 G_message(_("Remove bridges:")); 973 Vect_remove_bridges(&Map, NULL , output);966 Vect_remove_bridges(&Map, NULL); 974 967 } 975 968 976 969 /* Boundaries are hopefully clean, build areas */ 977 970 G_message("%s", separator); 978 Vect_build_partial(&Map, GV_BUILD_ATTACH_ISLES , output);971 Vect_build_partial(&Map, GV_BUILD_ATTACH_ISLES); 979 972 980 973 /* Calculate new centroids for all areas, centroids have the same id as area */ … … 1060 1053 G_free(Centr); 1061 1054 G_message("%s", separator); 1062 Vect_build_partial(&Map, GV_BUILD_NONE , NULL);1055 Vect_build_partial(&Map, GV_BUILD_NONE); 1063 1056 1064 1057 G_message("%s", separator); 1065 Vect_build(&Map , output);1058 Vect_build(&Map); 1066 1059 1067 1060 G_message("%s", separator); -
grass/branches/develbranch_6/vector/v.in.region/main.c
r32527 r34288 95 95 } 96 96 97 Vect_build(&Out , stderr);97 Vect_build(&Out); 98 98 Vect_close(&Out); 99 99 -
grass/branches/develbranch_6/vector/v.in.sites/main.c
r33779 r34288 248 248 db_shutdown_driver(driver); 249 249 250 Vect_build(&Map , stderr);250 Vect_build(&Map); 251 251 Vect_close(&Map); 252 252 -
grass/branches/develbranch_6/vector/v.kcv/main.c
r32583 r34288 259 259 db_close_database_shutdown_driver(Driver); 260 260 261 Vect_build(&Out , stderr);261 Vect_build(&Out); 262 262 Vect_close(&Out); 263 263 -
grass/branches/develbranch_6/vector/v.kernel/main.c
r32696 r34288 411 411 Vect_close(&Net); 412 412 413 Vect_build(&Out , stderr);413 Vect_build(&Out); 414 414 Vect_close(&Out); 415 415 } -
grass/branches/develbranch_6/vector/v.lrs/v.lrs.create/main.c
r32583 r34288 861 861 862 862 G_message(_("Building topology for output (out_lines) map...")); 863 Vect_build(&Out , stderr);863 Vect_build(&Out); 864 864 Vect_close(&Out); 865 865 … … 867 867 if (err_opt->answer) { 868 868 G_message(_("Building topology for error (err) map...")); 869 Vect_build(&EMap , stderr);869 Vect_build(&EMap); 870 870 Vect_close(&EMap); 871 871 } -
grass/branches/develbranch_6/vector/v.lrs/v.lrs.label/main.c
r32527 r34288 514 514 515 515 db_close_database(rsdriver); 516 Vect_build(&Out , stderr);516 Vect_build(&Out); 517 517 518 518 /* Free, close ... */ -
grass/branches/develbranch_6/vector/v.lrs/v.lrs.segment/main.c
r32583 r34288 335 335 336 336 db_close_database(rsdriver); 337 Vect_build(&Out , stderr);337 Vect_build(&Out); 338 338 339 339 /* Free, close ... */ -
grass/branches/develbranch_6/vector/v.mkgrid/main.c
r32527 r34288 292 292 db_close_database_shutdown_driver(Driver); 293 293 294 if (G_verbose() > G_verbose_min()) 295 Vect_build(&Map, stderr); 296 else 297 Vect_build(&Map, NULL); 294 Vect_build(&Map); 298 295 Vect_close(&Map); 299 296 -
grass/branches/develbranch_6/vector/v.net.alloc/main.c
r33779 r34288 367 367 } 368 368 369 Vect_build(&Out , stderr);369 Vect_build(&Out); 370 370 371 371 /* Free, ... */ -
grass/branches/develbranch_6/vector/v.net.iso/main.c
r33779 r34288 527 527 } 528 528 529 Vect_build(&Out , stderr);529 Vect_build(&Out); 530 530 531 531 /* Free, ... */ -
grass/branches/develbranch_6/vector/v.net.path/main.c
r32527 r34288 149 149 Vect_close(&In); 150 150 151 Vect_build(&Out , stderr);151 Vect_build(&Out); 152 152 Vect_close(&Out); 153 153 -
grass/branches/develbranch_6/vector/v.net.salesman/main.c
r32696 r34288 378 378 fprintf(stdout, "\n\n"); 379 379 380 Vect_build(&Out , stderr);380 Vect_build(&Out); 381 381 382 382 /* Free, ... */ -
grass/branches/develbranch_6/vector/v.net.steiner/main.c
r33779 r34288 636 636 fprintf(stdout, "\n\n"); 637 637 638 Vect_build(&Out , stderr);638 Vect_build(&Out); 639 639 640 640 /* Free, ... */ -
grass/branches/develbranch_6/vector/v.net.visibility/main.c
r32527 r34288 130 130 G_free(lines); 131 131 132 if (G_verbose() > G_verbose_min()) 133 Vect_build(&out, stderr); 134 else 135 Vect_build(&out, NULL); 136 132 Vect_build(&out); 137 133 Vect_close(&out); 138 134 Vect_close(&in); -
grass/branches/develbranch_6/vector/v.net/connect.c
r32527 r34288 55 55 /* rewrite all primitives to output file */ 56 56 Vect_copy_map_lines(In, Out); 57 Vect_build_partial(Out, GV_BUILD_BASE , NULL);57 Vect_build_partial(Out, GV_BUILD_BASE); 58 58 59 59 /* go thorough all points in point map and write a new arcs if missing */ -
grass/branches/develbranch_6/vector/v.net/main.c
r33779 r34288 195 195 196 196 /* support */ 197 Vect_build_partial(&Out, GV_BUILD_NONE, NULL); 198 if (G_verbose() > G_verbose_min()) 199 Vect_build(&Out, stderr); 200 else 201 Vect_build(&Out, NULL); 197 Vect_build_partial(&Out, GV_BUILD_NONE); 198 Vect_build(&Out); 202 199 203 200 Vect_close(&In); -
grass/branches/develbranch_6/vector/v.overlay/area_area.c
r32527 r34288 30 30 int nmodif; 31 31 32 FILE *output;33 34 if (G_verbose() > G_verbose_min())35 output = stderr;36 else37 output = NULL;38 39 32 Points = Vect_new_line_struct(); 40 33 Cats = Vect_new_cats_struct(); … … 45 38 do { 46 39 G_message(_("Breaking lines...")); 47 Vect_break_lines(Out, GV_LINE | GV_BOUNDARY, NULL , output);40 Vect_break_lines(Out, GV_LINE | GV_BOUNDARY, NULL); 48 41 49 42 /* Probably not necessary for LINE x AREA */ 50 43 G_message(_("Removing duplicates...")); 51 Vect_remove_duplicates(Out, GV_BOUNDARY, NULL , output);44 Vect_remove_duplicates(Out, GV_BOUNDARY, NULL); 52 45 53 46 G_message(_("Cleaning boundaries at nodes...")); 54 47 nmodif = 55 Vect_clean_small_angles_at_nodes(Out, GV_BOUNDARY, NULL , output);48 Vect_clean_small_angles_at_nodes(Out, GV_BOUNDARY, NULL); 56 49 } while (nmodif > 0); 57 50 … … 61 54 /* Attach islands */ 62 55 G_message(_("Attaching islands...")); 63 Vect_build_partial(Out, GV_BUILD_ATTACH_ISLES , output);56 Vect_build_partial(Out, GV_BUILD_ATTACH_ISLES); 64 57 65 58 … … 270 263 /* Build topology and remove boundaries with area without centroid on both sides */ 271 264 G_message(_("Attaching centroids...")); 272 Vect_build_partial(Out, GV_BUILD_ALL , output);265 Vect_build_partial(Out, GV_BUILD_ALL); 273 266 274 267 /* Create a list of lines to be deleted */ -
grass/branches/develbranch_6/vector/v.overlay/line_area.c
r32527 r34288 68 68 69 69 G_message(_("Breaking lines...")); 70 if (G_verbose() > G_verbose_min()) 71 Vect_break_lines(Out, GV_LINE | GV_BOUNDARY, NULL, stderr); 72 else 73 Vect_break_lines(Out, GV_LINE | GV_BOUNDARY, NULL, NULL); 70 Vect_break_lines(Out, GV_LINE | GV_BOUNDARY, NULL); 74 71 75 72 /* Basic topology needed only */ 76 Vect_build_partial(Out, GV_BUILD_BASE , NULL);73 Vect_build_partial(Out, GV_BUILD_BASE); 77 74 78 75 nlines = Vect_get_num_lines(Out); -
grass/branches/develbranch_6/vector/v.overlay/main.c
r32583 r34288 468 468 G_message(_("Building partial topology...")); 469 469 /* do not print output, because befor cleaning it is nonsense */ 470 Vect_build_partial(&Out, GV_BUILD_BASE , NULL);470 Vect_build_partial(&Out, GV_BUILD_BASE); 471 471 472 472 /* AREA x AREA */ … … 479 479 480 480 G_message(_("Rebuilding topology...")); 481 Vect_build_partial(&Out, GV_BUILD_NONE, NULL); 482 if (G_verbose() > G_verbose_min()) 483 Vect_build(&Out, stderr); 484 else 485 Vect_build(&Out, NULL); 481 Vect_build_partial(&Out, GV_BUILD_NONE); 482 Vect_build(&Out); 486 483 /* Build topology to show the final result and prepare for Vect_close() */ 487 484 -
grass/branches/develbranch_6/vector/v.parallel/main.c
r32527 r34288 90 90 91 91 Vect_close(&In); 92 Vect_build(&Out , stderr);92 Vect_build(&Out); 93 93 Vect_close(&Out); 94 94 -
grass/branches/develbranch_6/vector/v.patch/main.c
r32696 r34288 355 355 Vect_set_person(&OutMap, G_whoami()); 356 356 357 if (G_verbose() > G_verbose_min()) 358 Vect_build(&OutMap, stderr); 359 else 360 Vect_build(&OutMap, NULL); 361 357 Vect_build(&OutMap); 362 358 Vect_close(&OutMap); 363 359 … … 368 364 G_important_message(_("Building topology for vector map <%s>..."), 369 365 bbox_name); 370 if (G_verbose() > G_verbose_min()) 371 Vect_build(&BBoxMap, stderr); 372 else 373 Vect_build(&BBoxMap, NULL); 374 366 Vect_build(&BBoxMap); 375 367 Vect_close(&BBoxMap); 376 368 } -
grass/branches/develbranch_6/vector/v.perturb/main.c
r32583 r34288 246 246 Vect_close(&In); 247 247 248 Vect_build(&Out , stderr);248 Vect_build(&Out); 249 249 Vect_close(&Out); 250 250 -
grass/branches/develbranch_6/vector/v.proj/main.c
r33543 r34288 279 279 Vect_close(&Map); 280 280 281 if (G_verbose() > G_verbose_min()) 282 Vect_build(&Out_Map, stderr); 283 else 284 Vect_build(&Out_Map, NULL); 285 281 Vect_build(&Out_Map); 286 282 Vect_close(&Out_Map); 287 283 -
grass/branches/develbranch_6/vector/v.qcount/main.c
r32527 r34288 166 166 } 167 167 168 Vect_build(&Out , stderr);168 Vect_build(&Out); 169 169 Vect_close(&Out); 170 170 -
grass/branches/develbranch_6/vector/v.random/main.c
r32696 r34288 297 297 298 298 if (!flag.notopo->answer) { 299 if (G_verbose() > G_verbose_min()) 300 Vect_build(&Out, stderr); 301 else 302 Vect_build(&Out, NULL); 299 Vect_build(&Out); 303 300 } 304 301 Vect_close(&Out); -
grass/branches/develbranch_6/vector/v.reclass/main.c
r34238 r34288 417 417 Vect_close(&In); 418 418 419 Vect_build(&Out , stderr);419 Vect_build(&Out); 420 420 Vect_close(&Out); 421 421 -
grass/branches/develbranch_6/vector/v.sample/main.c
r33093 r34288 298 298 Vect_close(&In); 299 299 300 Vect_build(&Out , stderr);300 Vect_build(&Out); 301 301 Vect_close(&Out); 302 302 -
grass/branches/develbranch_6/vector/v.segment/main.c
r32583 r34288 232 232 lines_written, lines_read - lines_written); 233 233 234 if (G_verbose() > G_verbose_min()) { 235 Vect_build(&Out, stderr); 236 } 237 else { 238 Vect_build(&Out, NULL); 239 } 240 234 Vect_build(&Out); 241 235 /* Free, close ... */ 242 236 Vect_close(&In); -
grass/branches/develbranch_6/vector/v.select/main.c
r34262 r34288 516 516 Vect_close(&(In[0])); 517 517 518 Vect_build(&Out , stderr);518 Vect_build(&Out); 519 519 Vect_close(&Out); 520 520 -
grass/branches/develbranch_6/vector/v.split/main.c
r32903 r34288 184 184 185 185 Vect_close(&In); 186 Vect_build(&Out , stderr);186 Vect_build(&Out); 187 187 Vect_close(&Out); 188 188 -
grass/branches/develbranch_6/vector/v.surf.rst/main.c
r33779 r34288 685 685 */ 686 686 print_tree(root, x_orig, y_orig, &TreeMap); 687 Vect_build(&TreeMap , NULL);687 Vect_build(&TreeMap); 688 688 Vect_close(&TreeMap); 689 689 } … … 774 774 */ 775 775 print_tree(root, x_orig, y_orig, &OverMap); 776 Vect_build(&OverMap , NULL);776 Vect_build(&OverMap); 777 777 Vect_close(&OverMap); 778 778 } … … 794 794 /* db_close_database_shutdown_driver ( driver2 ); */ 795 795 db_close_database(driver2); 796 Vect_build(&Map2 , stderr);796 Vect_build(&Map2); 797 797 Vect_close(&Map2); 798 798 } -
grass/branches/develbranch_6/vector/v.to.points/main.c
r32527 r34288 373 373 } 374 374 375 Vect_build(&Out , stderr);375 Vect_build(&Out); 376 376 377 377 /* Free, close ... */ -
grass/branches/develbranch_6/vector/v.transform/main.c
r32583 r34288 331 331 Vect_copy_tables(&Old, &New, 0); 332 332 Vect_close(&Old); 333 334 if (G_verbose() > G_verbose_min()) 335 Vect_build(&New, stderr); 336 else 337 Vect_build(&New, NULL); 333 Vect_build(&New); 338 334 339 335 if (!quiet_flag->answer) { -
grass/branches/develbranch_6/vector/v.type/main.c
r32527 r34288 232 232 233 233 Vect_copy_tables(&In, &Out, 0); 234 Vect_build(&Out , stderr);234 Vect_build(&Out); 235 235 Vect_close(&Out); 236 236 Vect_close(&In); -
grass/branches/develbranch_6/vector/v.vol.rst/main.c
r32696 r34288 847 847 if (cvdev != NULL || devi != NULL) { 848 848 db_close_database_shutdown_driver(driver); 849 Vect_build(&Map , stderr);849 Vect_build(&Map); 850 850 Vect_close(&Map); 851 851 } -
grass/branches/develbranch_6/vector/v.voronoi/dt_main.c
r32527 r34288 105 105 Vect_hist_command(&Out); 106 106 107 Vect_build_partial(&Out, GV_BUILD_BASE , NULL);107 Vect_build_partial(&Out, GV_BUILD_BASE); 108 108 109 109 /* initialize working region */ … … 126 126 Vect_close(&In); 127 127 128 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES , NULL);128 Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES); 129 129 130 130 nareas = Vect_get_num_areas(&Out); … … 157 157 } 158 158 159 Vect_build_partial(&Out, GV_BUILD_NONE , NULL);160 Vect_build(&Out , stderr);159 Vect_build_partial(&Out, GV_BUILD_NONE); 160 Vect_build(&Out); 161 161 Vect_close(&Out); 162 162 -
grass/branches/develbranch_6/vector/v.voronoi/vo_main.c
r32527 r34288 185 185 186 186 /* Close free ends by cyrrent region */ 187 Vect_build_partial(&Out, GV_BUILD_BASE , NULL);187 Vect_build_partial(&Out, GV_BUILD_BASE); 188 188 189 189 ncoor = 0; … … 354 354 Vect_close(&In); 355 355 356 Vect_build_partial(&Out, GV_BUILD_NONE , NULL);357 Vect_build(&Out , stderr);356 Vect_build_partial(&Out, GV_BUILD_NONE); 357 Vect_build(&Out); 358 358 Vect_close(&Out); 359 359 -
grass/branches/develbranch_6/vector/v.what/main.c
r32527 r34288 157 157 158 158 G_verbose_message(_("Building spatial index...")); 159 Vect_build_spatial_index(&Map[i] , NULL);159 Vect_build_spatial_index(&Map[i]); 160 160 } 161 161 }
Note:
See TracChangeset
for help on using the changeset viewer.
