GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
init_head.c
Go to the documentation of this file.
1 
24 #include <string.h>
25 #include <grass/gis.h>
26 #include <grass/Vect.h>
27 
35 int Vect__init_head(struct Map_info *Map)
36 {
37  char buf[64];
38 
39  Map->head.organization = NULL;
40  Vect_set_organization(Map, "");
41  Map->head.date = NULL;
42  Vect_set_date(Map, "");
43  Map->head.your_name = NULL;
44  sprintf(buf, "%s", G_whoami());
45  Vect_set_person(Map, buf);
46  Map->head.map_name = NULL;
47  Vect_set_map_name(Map, "");
48  Map->head.source_date = NULL;
49  sprintf(buf, "%s", G_date());
50  Vect_set_map_date(Map, buf);
51  Map->head.line_3 = NULL;
52  Vect_set_comment(Map, "");
53 
54  Vect_set_scale(Map, 1);
55  Vect_set_zone(Map, 0);
56  Vect_set_thresh(Map, 0.0);
57 
58  Map->plus.Spidx_built = 0;
59  Map->plus.release_support = 0;
60  Map->plus.update_cidx = 0;
61 
62  return 0;
63 }
64 
73 int Vect_copy_head_data(struct Map_info *from, struct Map_info *to)
74 {
76  Vect_set_date(to, Vect_get_date(from));
81 
82  Vect_set_scale(to, Vect_get_scale(from));
83  Vect_set_zone(to, Vect_get_zone(from));
85 
86  return 0;
87 }
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int Vect_get_scale(struct Map_info *Map)
Get map scale from map header.
int Vect_set_organization(struct Map_info *Map, const char *str)
Set organization string in map header.
int Vect_set_scale(struct Map_info *Map, int scale)
Set map scale in map header.
int Vect_set_date(struct Map_info *Map, const char *str)
Set date of digitization string in map header.
const char * Vect_get_comment(struct Map_info *Map)
Get comment or other info string from map header.
int Vect__init_head(struct Map_info *Map)
Initialize head structure.
Definition: init_head.c:35
int Vect_set_zone(struct Map_info *Map, int zone)
Set projection zone in map header.
const char * Vect_get_date(struct Map_info *Map)
Get date of digitization string from map header.
int Vect_set_map_date(struct Map_info *Map, const char *str)
Set date string when the source map was originally produced in map header.
int Vect_set_map_name(struct Map_info *Map, const char *str)
Set map name string in map header.
const char * Vect_get_map_date(struct Map_info *Map)
Get date string when the source map was originally produced in map header.
double Vect_get_thresh(struct Map_info *Map)
Get threshold used for digitization from map header.
int Vect_get_zone(struct Map_info *Map)
Get projection zone from map header.
char * G_whoami(void)
Gets user&#39;s name.
Definition: gis/whoami.c:40
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62
return NULL
Definition: dbfopen.c:1394
tuple Map
Definition: render.py:1310
int Vect_copy_head_data(struct Map_info *from, struct Map_info *to)
Copy header data from one to another map.
Definition: init_head.c:73
char * G_date(void)
Current date and time.
Definition: date.c:30
const char * Vect_get_person(struct Map_info *Map)
Get user name string who digitized the map from map header.
int Vect_set_thresh(struct Map_info *Map, double thresh)
Set threshold used for digitization in map header.
int Vect_set_comment(struct Map_info *Map, const char *str)
Set comment or other info string in map header.
const char * Vect_get_map_name(struct Map_info *Map)
Get map name string in map header.
int Vect_set_person(struct Map_info *Map, const char *str)
Set user name string who digitized the map in map header.
const char * Vect_get_organization(struct Map_info *Map)
Get organization string from map header.