init_head.c

Go to the documentation of this file.
00001 /*
00002 ****************************************************************************
00003 *
00004 * MODULE:       Vector library 
00005 *               
00006 * AUTHOR(S):    Original author CERL, probably Dave Gerdes or Mike Higgins.
00007 *               Update to GRASS 5.7 Radim Blazek and David D. Gray.
00008 *
00009 * PURPOSE:      Higher level functions for reading/writing/manipulating vectors.
00010 *
00011 * COPYRIGHT:    (C) 2001 by the GRASS Development Team
00012 *
00013 *               This program is free software under the GNU General Public
00014 *               License (>=v2). Read the file COPYING that comes with GRASS
00015 *               for details.
00016 *
00017 *****************************************************************************/
00018 #include <string.h>
00019 #include "Vect.h"
00020 
00021 /*
00022    **
00023    **  Initialize Head structure.  To make sure that we are not writing
00024    **    out garbage to a file.
00025    **
00026  */
00027 
00028 int 
00029 Vect__init_head (struct Map_info *Map)
00030 {
00031     Map->head.organization = NULL; 
00032     Vect_set_organization ( Map, "" );
00033     Map->head.date = NULL;
00034     Vect_set_date ( Map, "" );
00035     Map->head.your_name = NULL;
00036     Vect_set_person ( Map, "" );
00037     Map->head.map_name = NULL;
00038     Vect_set_map_name ( Map, "" );
00039     Map->head.source_date = NULL;
00040     Vect_set_map_date ( Map, "" );
00041     Map->head.line_3 = NULL;
00042     Vect_set_comment ( Map, "" );
00043     
00044     Vect_set_scale ( Map, 1 );
00045     Vect_set_zone ( Map, 0 );
00046     Vect_set_thresh ( Map, 0.0 );
00047 
00048     Map->plus.Spidx_built = 0;
00049     Map->plus.release_support = 0;
00050     Map->plus.update_cidx = 0;
00051 
00052     return 0;
00053 }
00054 
00061 int 
00062 Vect_copy_head_data (struct Map_info *from, struct Map_info *to)
00063 {
00064     Vect_set_organization ( to, Vect_get_organization(from) );
00065     Vect_set_date ( to, Vect_get_date(from) );
00066     Vect_set_person ( to, Vect_get_person(from) );
00067     Vect_set_map_name ( to, Vect_get_map_name(from) );
00068     Vect_set_map_date ( to, Vect_get_map_date(from) );
00069     Vect_set_comment ( to, Vect_get_comment(from) );
00070     
00071     Vect_set_scale ( to, Vect_get_scale(from) );
00072     Vect_set_zone ( to, Vect_get_zone(from) );
00073     Vect_set_thresh ( to, Vect_get_thresh(from) );
00074   
00075     return 0;
00076 }

Generated on Wed Aug 23 17:49:01 2006 for GRASS by  doxygen 1.4.7