GRASS Programmer's Manual 6.4.1(2011)
|
00001 00024 #include <string.h> 00025 #include <grass/gis.h> 00026 #include <grass/Vect.h> 00027 00035 int Vect__init_head(struct Map_info *Map) 00036 { 00037 char buf[64]; 00038 00039 Map->head.organization = NULL; 00040 Vect_set_organization(Map, ""); 00041 Map->head.date = NULL; 00042 Vect_set_date(Map, ""); 00043 Map->head.your_name = NULL; 00044 sprintf(buf, "%s", G_whoami()); 00045 Vect_set_person(Map, buf); 00046 Map->head.map_name = NULL; 00047 Vect_set_map_name(Map, ""); 00048 Map->head.source_date = NULL; 00049 sprintf(buf, "%s", G_date()); 00050 Vect_set_map_date(Map, buf); 00051 Map->head.line_3 = NULL; 00052 Vect_set_comment(Map, ""); 00053 00054 Vect_set_scale(Map, 1); 00055 Vect_set_zone(Map, 0); 00056 Vect_set_thresh(Map, 0.0); 00057 00058 Map->plus.Spidx_built = 0; 00059 Map->plus.release_support = 0; 00060 Map->plus.update_cidx = 0; 00061 00062 return 0; 00063 } 00064 00073 int Vect_copy_head_data(struct Map_info *from, struct Map_info *to) 00074 { 00075 Vect_set_organization(to, Vect_get_organization(from)); 00076 Vect_set_date(to, Vect_get_date(from)); 00077 Vect_set_person(to, Vect_get_person(from)); 00078 Vect_set_map_name(to, Vect_get_map_name(from)); 00079 Vect_set_map_date(to, Vect_get_map_date(from)); 00080 Vect_set_comment(to, Vect_get_comment(from)); 00081 00082 Vect_set_scale(to, Vect_get_scale(from)); 00083 Vect_set_zone(to, Vect_get_zone(from)); 00084 Vect_set_thresh(to, Vect_get_thresh(from)); 00085 00086 return 0; 00087 }