17 #include <grass/Vect.h>
34 if (Map->mode == GV_MODE_WRITE || Map->mode == GV_MODE_RW)
37 if (Map->fInfo.ogr.feature_cache)
38 OGR_F_Destroy(Map->fInfo.ogr.feature_cache);
40 OGR_DS_Destroy(Map->fInfo.ogr.ds);
42 for (i = 0; i < Map->fInfo.ogr.lines_alloc; i++) {
46 free(Map->fInfo.ogr.lines);
47 free(Map->fInfo.ogr.lines_types);
49 free(Map->fInfo.ogr.dsn);
50 free(Map->fInfo.ogr.layer_name);
63 char fname[1000], elem[1000];
67 struct Port_info port;
74 if (strcmp(Map->mapset,
G_mapset()) == 0 && Map->support_updated &&
75 Map->plus.built == GV_BUILD_ALL) {
76 sprintf(elem,
"%s/%s", GRASS_VECT_DIRECTORY, Map->name);
78 G_debug(4,
"Open fidx: %s", fname);
80 fp.file = fopen(fname,
"w");
81 if (fp.file ==
NULL) {
82 G_warning(
"Can't open fidx file for write: %s\n", fname);
110 Map->fInfo.ogr.offset_num, &fp))
117 free(Map->fInfo.ogr.offset);
char * G_mapset(void)
current mapset name
int V1_close_ogr(struct Map_info *Map)
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int dig_set_cur_port(struct Port_info *port)
void dig_init_portable(struct Port_info *port, int byte_order)
int dig__fwrite_port_I(int *buf, int cnt, GVFILE *fp)
char * G__file_name(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files.
int dig__fwrite_port_L(long *buf, int cnt, GVFILE *fp)
int V2_close_ogr(struct Map_info *Map)
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
int G_debug(int level, const char *msg,...)
Print debugging message.
void dig_file_init(GVFILE *file)
Initialize GVFILE.
int dig__fwrite_port_C(char *buf, int cnt, GVFILE *fp)
int dig__byte_order_out()
int Vect_destroy_line_struct(struct line_pnts *p)
Frees all memory associated with a struct line_pnts, including the struct itself. ...