|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
|
Vector library - header manipulation. More...
#include <stdlib.h>#include <string.h>#include <grass/vector.h>#include <grass/glocale.h>#include "local_proto.h"
Go to the source code of this file.
Functions | |
| int | Vect_print_header (struct Map_info *Map) |
| Print vector map header to stdout. | |
| 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 (GV_HEAD_ELEMENT) | |
| int | Vect__read_head (struct Map_info *Map) |
| Reads head information from text file (GV_HEAD_ELEMENT) - for internal use only. | |
| const char * | Vect_get_name (struct Map_info *Map) |
| Get name of vector map. | |
| const char * | Vect_get_mapset (struct Map_info *Map) |
| Get name of mapset where vector map lives. | |
| const char * | Vect_get_full_name (struct Map_info *Map) |
| Get fully qualified name of vector map. | |
| int | Vect_is_3d (struct Map_info *Map) |
| Check if vector map is 3D. | |
| 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 in map header. | |
| const char * | Vect_get_date (struct Map_info *Map) |
| Get date of digitization from map header. | |
| int | Vect_set_person (struct Map_info *Map, const char *str) |
| Set name of user 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 in map header. | |
| const char * | Vect_get_map_name (struct Map_info *Map) |
| Get map name from map header. | |
| int | Vect_set_map_date (struct Map_info *Map, const char *str) |
| Set date when the source map was originally produced in map header. | |
| const char * | Vect_get_map_date (struct Map_info *Map) |
| Get date when the source map was originally produced from 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_set_proj (struct Map_info *Map, int proj) |
| Set projection in 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 pointer to Map_info structure. | |
| 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. | |
Vector library - header manipulation.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2010 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.
Definition in file vector/Vlib/header.c.
Reads head information from text file (GV_HEAD_ELEMENT) - for internal use only.
| Map | pointer to Map_info structure |
Definition at line 120 of file vector/Vlib/header.c.
References _, G_debug(), G_fopen_old(), G_free(), G_getl2(), G_warning(), GPATH_MAX, GV_HEAD_ELEMENT, AMI_STREAM< T >::name(), NULL, Vect__get_path(), Vect__init_head(), 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_proj(), Vect_set_scale(), Vect_set_thresh(), and Vect_set_zone().
Referenced by Vect__open_old(), and Vect_read_header().
Writes head information to text file (GV_HEAD_ELEMENT)
| Map | pointer to Map_info structure |
Definition at line 79 of file vector/Vlib/header.c.
References _, G_fopen_new(), G_free(), G_warning(), GPATH_MAX, GV_HEAD_ELEMENT, NULL, Vect__get_path(), 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_proj(), Vect_get_scale(), Vect_get_thresh(), and Vect_get_zone().
Referenced by V1_close_nat(), V1_close_ogr(), V1_close_pg(), and Vect_write_header().
Get comment or other info string from map header.
| Map | pointer to Map_info structure |
Definition at line 460 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_write_ascii_head().
Get date of digitization from map header.
| Map | pointer to Map_info structure |
Definition at line 321 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_write_ascii_head().
Get fully qualified name of vector map.
Allocated string should be freed by G_free().
| Map | pointer to Map_info structure |
Definition at line 224 of file vector/Vlib/header.c.
References G_malloc, GV_FORMAT_OGR_DIRECT, and AMI_STREAM< T >::name().
Referenced by IL_vector_input_data_2d(), V1_open_old_nat(), V2_open_old_ogr(), V2_open_old_pg(), Vect__open_old(), Vect__read_head(), Vect__write_head(), Vect_build_partial(), Vect_build_sidx_from_topo(), Vect_cidx_open(), Vect_close(), Vect_copy_map_lines_field(), Vect_copy_tables(), Vect_get_finfo_dsn_name(), Vect_get_finfo_layer_name(), Vect_get_map_box1(), Vect_open_fidx(), Vect_read_line(), Vect_read_line_geos(), Vect_read_next_line(), Vect_sfa_get_num_features(), and Vect_topo_dump().
Get date when the source map was originally produced from map header.
| Map | pointer to Map_info structure |
Definition at line 405 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), Vect_print_header(), and Vect_write_ascii_head().
Get map name from map header.
| Map | pointer to Map_info structure |
Definition at line 377 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), Vect_print_header(), and Vect_write_ascii_head().
Get name of mapset where vector map lives.
| Map | pointer to Map_info structure |
Definition at line 207 of file vector/Vlib/header.c.
Get name of vector map.
| Map | pointer to Map_info structure |
Definition at line 195 of file vector/Vlib/header.c.
References AMI_STREAM< T >::name().
Referenced by Vect__open_old(), Vect_cidx_save(), Vect_close(), Vect_copy_tables(), Vect_delete_line(), Vect_read_ascii(), Vect_restore_line(), Vect_rewrite_line(), Vect_save_sidx(), Vect_write_dblinks(), and Vect_write_line().
Get organization string from map header.
| Map | pointer to Map_info structure |
Definition at line 290 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), Vect_print_header(), and Vect_write_ascii_head().
Get user name string who digitized the map from map header.
| Map | pointer to Map_info structure |
Definition at line 349 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_write_ascii_head().
Get projection from map header.
| Map | pointer to Map_info structure |
Definition at line 526 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), and Vect_get_proj_name().
Query cartographic projection name of pointer to Map_info structure.
Returns a pointer to a string which is a printable name for projection code proj (as returned by Vect_get_proj()).
| Map | pointer to Map_info structure |
Definition at line 542 of file vector/Vlib/header.c.
References _, G_database_projection_name(), G_debug(), G_projection_name(), G_store(), name, PROJECTION_LL, PROJECTION_OTHER, PROJECTION_UTM, PROJECTION_XY, strcpy, and Vect_get_proj().
Get map scale from map header.
| Map | pointer to Map_info structure |
Definition at line 432 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), Vect_print_header(), and Vect_write_ascii_head().
Get threshold used for digitization from map header.
| Map | pointer to Map_info structure |
Definition at line 591 of file vector/Vlib/header.c.
Referenced by Vect__write_head(), Vect_copy_head_data(), and Vect_write_ascii_head().
Get projection zone from map header.
| Map | pointer to Map_info structure (unused, returns the zone for the active region) |
Definition at line 488 of file vector/Vlib/header.c.
References G_zone().
Referenced by Vect__open_old(), Vect__write_head(), Vect_copy_head_data(), and Vect_write_ascii_head().
Check if vector map is 3D.
Check vector map header.
| Map | pointer to Map_info structure |
Definition at line 262 of file vector/Vlib/header.c.
Referenced by Gp_load_sites(), Gv_load_vect(), IL_vector_input_data_2d(), V2__update_area_pg(), Vect_close(), Vect_get_area_box(), Vect_get_isle_box(), Vect_get_line_box(), Vect_read_ascii(), Vect_read_line_to_wkb(), Vect_remove_duplicates(), Vect_write_ascii(), Vedit_move_lines(), and Vedit_move_vertex().
Print vector map header to stdout.
| Map | pointer to Map_info structure |
Definition at line 33 of file vector/Vlib/header.c.
References Vect_get_map_date(), Vect_get_map_name(), Vect_get_organization(), and Vect_get_scale().
Read vector map header from map head file.
| Map | pointrt to Map_info structure |
Definition at line 51 of file vector/Vlib/header.c.
References Vect__read_head().
Set comment or other info string in map header.
| Map | pointer to Map_info structure |
| str | comment or other info string |
Definition at line 445 of file vector/Vlib/header.c.
References G_free(), and G_store().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set date of digitization in map header.
| Map | pointer to Map_info structure |
| str | date given as string |
Definition at line 306 of file vector/Vlib/header.c.
References G_free(), and G_store().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set date when the source map was originally produced in map header.
| Map | pointer to Map_info structure |
| str | date given as a string |
Definition at line 390 of file vector/Vlib/header.c.
References G_free(), and G_store().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set map name in map header.
| Map | pointer to Map_info structure |
| str | map name to be set |
Definition at line 362 of file vector/Vlib/header.c.
References G_free(), and G_store().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set organization string in map header.
| Map | pointer to Map_info structure |
| str | organization name |
Definition at line 275 of file vector/Vlib/header.c.
References G_free(), and G_store().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set name of user who digitized the map in map header.
| Map | pointer to Map_info structure |
| str | user name |
Definition at line 334 of file vector/Vlib/header.c.
References G_free(), and G_store().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set projection in map header.
Supported projections:
| Map | pointer to Map_info structure |
| proj | projection code |
Definition at line 510 of file vector/Vlib/header.c.
Referenced by Vect__init_head(), Vect__open_old(), and Vect__read_head().
Set map scale in map header.
| Map | pointer to Map_info structure |
| scale | map scale |
Definition at line 418 of file vector/Vlib/header.c.
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set threshold used for digitization in map header.
| Map | pointer to Map_info structure |
| thresh | threshold used for digitization |
Definition at line 577 of file vector/Vlib/header.c.
References G_debug().
Referenced by Vect__init_head(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Set projection zone in map header.
| Map | pointer to Map_info structure |
| zone | projection zone |
Definition at line 473 of file vector/Vlib/header.c.
Referenced by Vect__init_head(), Vect__open_old(), Vect__read_head(), Vect_copy_head_data(), and Vect_read_ascii_head().
Write vector map header to map head file.
| Map | pointer to Map_info structure |
Definition at line 64 of file vector/Vlib/header.c.
References Vect__write_head().