header.c File Reference

Vector library - header manipulation. More...

#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>

Include dependency graph for header.c:

Go to the source code of this file.

Functions

int Vect_print_header (struct Map_info *Map)
 Print vector map header.
int Vect_read_header (struct Map_info *Map)
 Read vector map header from map head file.
int Vect_write_header (struct Map_info *Map)
 Write vector map header to map head file.
int Vect__write_head (struct Map_info *Map)
 Writes head information to text file.
int Vect__read_head (struct Map_info *Map)
 Reads head information from text file (GRASS_VECT_HEAD_ELEMENT).
const char * Vect_get_name (struct Map_info *Map)
 Get map name.
const char * Vect_get_mapset (struct Map_info *Map)
 Get mapset name.
const char * Vect_get_full_name (struct Map_info *Map)
 Get full map name.
int Vect_is_3d (struct Map_info *Map)
 Check if vector map is 3D (with z).
int Vect_set_organization (struct Map_info *Map, const char *str)
 Set organization string in map header.
const char * Vect_get_organization (struct Map_info *Map)
 Get organization string from 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_date (struct Map_info *Map)
 Get date of digitization string from 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_person (struct Map_info *Map)
 Get user name string who digitized the map from 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_name (struct Map_info *Map)
 Get map name string in 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.
const char * Vect_get_map_date (struct Map_info *Map)
 Get date string when the source map was originally produced in map header.
int Vect_set_scale (struct Map_info *Map, int scale)
 Set map scale in map header.
int Vect_get_scale (struct Map_info *Map)
 Get map scale from 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_comment (struct Map_info *Map)
 Get comment or other info string from map header.
int Vect_set_zone (struct Map_info *Map, int zone)
 Set projection zone in map header.
int Vect_get_zone (struct Map_info *Map)
 Get projection zone from map header.
int Vect_get_proj (struct Map_info *Map)
 Get projection from map header.
const char * Vect_get_proj_name (struct Map_info *Map)
 Query cartographic projection name of vector map.
int Vect_set_thresh (struct Map_info *Map, double thresh)
 Set threshold used for digitization in map header.
double Vect_get_thresh (struct Map_info *Map)
 Get threshold used for digitization from map header.


Detailed Description

Vector library - header manipulation.

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
Original author CERL, probably Dave Gerdes or Mike Higgins. Update to GRASS 5.7 Radim Blazek and David D. Gray.
Date:
2001-2008

Definition in file header.c.


Function Documentation

int Vect__read_head ( struct Map_info *  Map  ) 

Reads head information from text file (GRASS_VECT_HEAD_ELEMENT).

Parameters:
Map vector map
Returns:
GRASS_OK - success

GRASS_ERR - error

Definition at line 122 of file header.c.

References Vect_get_full_name(), Vect_set_comment(), Vect_set_date(), Vect_set_map_date(), Vect_set_map_name(), Vect_set_organization(), Vect_set_person(), Vect_set_scale(), Vect_set_thresh(), and Vect_set_zone().

Referenced by Vect__open_old(), and Vect_read_header().

int Vect__write_head ( struct Map_info *  Map  ) 

Writes head information to text file.

Parameters:
Map vector map
Returns:
GRASS_OK - success

GRASS_ERR - error

Definition at line 86 of file header.c.

References Vect_get_comment(), Vect_get_date(), Vect_get_full_name(), Vect_get_map_date(), Vect_get_map_name(), Vect_get_organization(), Vect_get_person(), Vect_get_scale(), Vect_get_thresh(), and Vect_get_zone().

Referenced by V1_close_nat(), V1_close_ogr(), V1_open_new_nat(), and Vect_write_header().

const char* Vect_get_comment ( struct Map_info *  Map  ) 

Get comment or other info string from map header.

Parameters:
Map vector map
Returns:
comment or other info string

Definition at line 437 of file header.c.

Referenced by Vect__write_head(), and Vect_copy_head_data().

const char* Vect_get_date ( struct Map_info *  Map  ) 

Get date of digitization string from map header.

SUGGESTION: this should be coupled to DateTime functions to support time series

Parameters:
Map vector map
Returns:
date of digitization string

Definition at line 303 of file header.c.

Referenced by Vect__write_head(), and Vect_copy_head_data().

const char* Vect_get_full_name ( struct Map_info *  Map  ) 

const char* Vect_get_map_date ( struct Map_info *  Map  ) 

Get date string when the source map was originally produced in map header.

Parameters:
Map vector map
Returns:
date when the source map was originally produced string

Definition at line 384 of file header.c.

Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_print_header().

const char* Vect_get_map_name ( struct Map_info *  Map  ) 

Get map name string in map header.

Parameters:
Map vector map
Returns:
map name string

Definition at line 357 of file header.c.

Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_print_header().

const char* Vect_get_mapset ( struct Map_info *  Map  ) 

Get mapset name.

Parameters:
Map vector map
Returns:
poiter to mapset name

Definition at line 213 of file header.c.

const char* Vect_get_name ( struct Map_info *  Map  ) 

Get map name.

Parameters:
Map vector map
Returns:
poiter to map name

Definition at line 201 of file header.c.

Referenced by Vect_build_partial().

const char* Vect_get_organization ( struct Map_info *  Map  ) 

Get organization string from map header.

Parameters:
Map vector map
Returns:
organization string

Definition at line 270 of file header.c.

Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_print_header().

const char* Vect_get_person ( struct Map_info *  Map  ) 

Get user name string who digitized the map from map header.

Parameters:
Map vector map
Returns:
user name string

Definition at line 330 of file header.c.

Referenced by Vect__write_head(), and Vect_copy_head_data().

int Vect_get_proj ( struct Map_info *  Map  ) 

Get projection from map header.

Parameters:
Map vector map
Returns:
PROJECTION_XY 0 - x,y (Raw imagery),

PROJECTION_UTM 1 - UTM Universal Transverse Mercator,

PROJECTION_SP 2 - State Plane (in feet),

PROJECTION_LL 3 - Latitude-Longitude

Definition at line 479 of file header.c.

Referenced by Vect_get_proj_name().

const char* Vect_get_proj_name ( struct Map_info *  Map  ) 

Query cartographic projection name of vector map.

Returns a pointer to a string which is a printable name for projection code proj (as returned by Vect_get_proj()). Returns NULL if proj is not a valid projection.

Parameters:
Map vector map
Returns:
poiter to projection name

Definition at line 497 of file header.c.

References Vect_get_proj().

int Vect_get_scale ( struct Map_info *  Map  ) 

Get map scale from map header.

Parameters:
Map vector map
Returns:
map scale

Definition at line 410 of file header.c.

Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_print_header().

double Vect_get_thresh ( struct Map_info *  Map  ) 

Get threshold used for digitization from map header.

Parameters:
Map vector map
Returns:
threshold used for digitization

Definition at line 536 of file header.c.

Referenced by Vect__write_head(), and Vect_copy_head_data().

int Vect_get_zone ( struct Map_info *  Map  ) 

Get projection zone from map header.

Parameters:
Map vector map
Returns:
projection zone

Definition at line 464 of file header.c.

Referenced by Vect__write_head(), and Vect_copy_head_data().

int Vect_is_3d ( struct Map_info *  Map  ) 

Check if vector map is 3D (with z).

Parameters:
Map vector map
Returns:
1 map is 3D

0 map is not 3D

Definition at line 242 of file header.c.

Referenced by Vect_break_lines_list(), Vect_remove_duplicates(), Vedit_move_lines(), and Vedit_move_vertex().

int Vect_print_header ( struct Map_info *  Map  ) 

Print vector map header.

Parameters:
Map vector map
Returns:
0 on success

Definition at line 37 of file header.c.

References Vect_get_map_date(), Vect_get_map_name(), Vect_get_organization(), and Vect_get_scale().

int Vect_read_header ( struct Map_info *  Map  ) 

Read vector map header from map head file.

Parameters:
Map vector map
Returns:
0 on success

Definition at line 56 of file header.c.

References Vect__read_head().

int Vect_set_comment ( struct Map_info *  Map,
const char *  str 
)

Set comment or other info string in map header.

Parameters:
Map vector map
str comment or other info string
Returns:
0 on success

Definition at line 423 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_date ( struct Map_info *  Map,
const char *  str 
)

Set date of digitization string in map header.

SUGGESTION: this should be coupled to DateTime functions to support time series

Parameters:
Map vector map
str data string
Returns:
0 on success

Definition at line 286 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

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.

Parameters:
Map vector map
str date when the source map was originally produced string
Returns:
0 on success

Definition at line 370 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_map_name ( struct Map_info *  Map,
const char *  str 
)

Set map name string in map header.

Parameters:
Map vector map
str map name string
Returns:
0 on success

Definition at line 343 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_organization ( struct Map_info *  Map,
const char *  str 
)

Set organization string in map header.

Parameters:
Map vector map
str organization name
Returns:
0

Definition at line 255 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_person ( struct Map_info *  Map,
const char *  str 
)

Set user name string who digitized the map in map header.

Parameters:
Map vector map
str user name string
Returns:
0 on success

Definition at line 316 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_scale ( struct Map_info *  Map,
int  scale 
)

Set map scale in map header.

Parameters:
Map vector map
map scale
Returns:
0 on success

Definition at line 397 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_thresh ( struct Map_info *  Map,
double  thresh 
)

Set threshold used for digitization in map header.

Parameters:
Map vector map
thresh threshold used for digitization
Returns:
0 on success

Definition at line 522 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_set_zone ( struct Map_info *  Map,
int  zone 
)

Set projection zone in map header.

Parameters:
Map vector map
zone projection zone
Returns:
0 on success

Definition at line 450 of file header.c.

Referenced by Vect__init_head(), Vect__read_head(), and Vect_copy_head_data().

int Vect_write_header ( struct Map_info *  Map  ) 

Write vector map header to map head file.

Parameters:
Map vector map
Returns:
0 on success

Definition at line 70 of file header.c.

References Vect__write_head().


Generated on Thu Jul 16 13:21:24 2009 for GRASS Programmer's Manual by  doxygen 1.5.6