build.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <grass/glocale.h>
#include <grass/gis.h>
#include <grass/Vect.h>

Include dependency graph for build.c:

Go to the source code of this file.

Functions

int prnmsg (char *msg,...)
int Vect_build (struct Map_info *Map, FILE *msgout)
 build topology for vector map
int Vect_get_built (struct Map_info *Map)
 return current highest built level (part)
int Vect_build_partial (struct Map_info *Map, int build, FILE *msgout)
 build partial topology for vector map. Should only be used in special cases of vector processing.
int Vect_save_topo (struct Map_info *Map)
 save topology file for vector map
int Vect_topo_dump (struct Map_info *Map, FILE *out)
int Vect_save_spatial_index (struct Map_info *Map)
 save spatial index file
int Vect_spatial_index_dump (struct Map_info *Map, FILE *out)

Variables

FILE * Msgout = NULL


Function Documentation

int prnmsg ( char *  msg,
  ... 
)

Definition at line 43 of file build.c.

References Msgout.

Referenced by Vect_build_nat(), and Vect_build_partial().

int Vect_build ( struct Map_info *  Map,
FILE *  msgout 
)

build topology for vector map

Returns:
1 on success, 0 on error
Parameters:
Map_info structure, file for message output (stdout/stderr for example) or NULL

Definition at line 65 of file build.c.

References Vect_build_partial().

int Vect_build_partial ( struct Map_info *  Map,
int  top,
FILE *  msgout 
)

build partial topology for vector map. Should only be used in special cases of vector processing.

This functions optionaly 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 - attache 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 Map, the level is downgraded to requested value.

All calls to Vect_write_line, Vect_rewrite_line, Vect_delete_line respect the last value of build used in this 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 higher than current level, to rebuild part of topology, call first downgrade and then upgrade, for example: Vect_build() Vect_build_partial(,GV_BUILD_BASE,) Vect_build_partial(,GV_BUILD_AREAS,)

Returns:
1 on success, 0 on error
Parameters:
Map vector map
build highest level of build
msgout file pointer for message output (stdout/stderr for example) or NULL

Definition at line 118 of file build.c.

References dig_cidx_free(), dig_cidx_init(), dig_cidx_sort(), Msgout, prnmsg(), Vect_area_alive(), Vect_get_area_centroid(), Vect_get_num_areas(), and Vect_get_num_lines().

Referenced by Vect_build().

int Vect_get_built ( struct Map_info *  Map  ) 

return current highest built level (part)

Returns:
current highest built level
Parameters:
Map vector map

Definition at line 78 of file build.c.

int Vect_save_spatial_index ( struct Map_info *  Map  ) 

save spatial index file

Returns:
1 on success, 0 on error
Parameters:
Map_info structure

Definition at line 373 of file build.c.

References dig__byte_order_out(), dig_file_init(), dig_init_portable(), and dig_write_spidx().

int Vect_save_topo ( struct Map_info *  Map  ) 

save topology file for vector map

Returns:
1 on success, 0 on error
Parameters:
Map_info structure

Definition at line 234 of file build.c.

References dig__byte_order_out(), dig_file_init(), dig_init_portable(), and dig_write_plus_file().

Referenced by Vect_close().

int Vect_spatial_index_dump ( struct Map_info *  Map,
FILE *  out 
)

Definition at line 414 of file build.c.

References dig_dump_spidx(), and Vect_build_sidx_from_topo().

int Vect_topo_dump ( struct Map_info *  Map,
FILE *  out 
)

Definition at line 275 of file build.c.

References Vect_box_copy().


Variable Documentation

FILE* Msgout = NULL

Definition at line 40 of file build.c.

Referenced by prnmsg(), Vect_build_nat(), and Vect_build_partial().


Generated on Sun Apr 6 17:32:45 2008 for GRASS by  doxygen 1.5.5