00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <string.h>
00019 #include <grass/gis.h>
00020 #include <grass/Vect.h>
00021
00022
00023
00024
00025
00026
00027
00028
00029 int
00030 Vect__init_head (struct Map_info *Map)
00031 {
00032 char buf[64];
00033
00034 Map->head.organization = NULL;
00035 Vect_set_organization ( Map, "" );
00036 Map->head.date = NULL;
00037 Vect_set_date ( Map, "" );
00038 Map->head.your_name = NULL;
00039 sprintf (buf, "%s", G_whoami());
00040 Vect_set_person ( Map, buf );
00041 Map->head.map_name = NULL;
00042 Vect_set_map_name ( Map, "" );
00043 Map->head.source_date = NULL;
00044 sprintf (buf, "%s", G_date());
00045 Vect_set_map_date ( Map, buf );
00046 Map->head.line_3 = NULL;
00047 Vect_set_comment ( Map, "" );
00048
00049 Vect_set_scale ( Map, 1 );
00050 Vect_set_zone ( Map, 0 );
00051 Vect_set_thresh ( Map, 0.0 );
00052
00053 Map->plus.Spidx_built = 0;
00054 Map->plus.release_support = 0;
00055 Map->plus.update_cidx = 0;
00056
00057 return 0;
00058 }
00059
00066 int
00067 Vect_copy_head_data (struct Map_info *from, struct Map_info *to)
00068 {
00069 Vect_set_organization ( to, Vect_get_organization(from) );
00070 Vect_set_date ( to, Vect_get_date(from) );
00071 Vect_set_person ( to, Vect_get_person(from) );
00072 Vect_set_map_name ( to, Vect_get_map_name(from) );
00073 Vect_set_map_date ( to, Vect_get_map_date(from) );
00074 Vect_set_comment ( to, Vect_get_comment(from) );
00075
00076 Vect_set_scale ( to, Vect_get_scale(from) );
00077 Vect_set_zone ( to, Vect_get_zone(from) );
00078 Vect_set_thresh ( to, Vect_get_thresh(from) );
00079
00080 return 0;
00081 }