|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-56a9afeb9f
|
Vector library - GRASS ASCII vector format. More...
#include <stdlib.h>#include <stdio.h>#include <string.h>#include <grass/vector.h>#include <grass/dbmi.h>#include <grass/glocale.h>
Go to the source code of this file.
Macros | |
| #define | BUFFSIZE 128 |
Functions | |
| int | Vect_read_ascii (FILE *ascii, struct Map_info *Map) |
| Read data in GRASS ASCII vector format. | |
| int | Vect_read_ascii_head (FILE *dascii, struct Map_info *Map) |
| Read header of GRASS ASCII vector format. | |
| int | Vect_write_ascii (FILE *ascii, FILE *att, struct Map_info *Map, int ver, int format, int dp, char *fs, int region_flag, int type, int field, const struct cat_list *Clist, const char *where, const char **column_names, int header) |
| Write data to GRASS ASCII vector format. | |
| void | Vect_write_ascii_head (FILE *dascii, struct Map_info *Map) |
| Write data to GRASS ASCII vector format. | |
Vector library - GRASS ASCII vector format.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2015 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 ascii.c.
Read data in GRASS ASCII vector format.
| ascii | pointer to the input ASCII file | |
| [out] | Map | pointer to the output Map_info structure |
Definition at line 42 of file ascii.c.
References _, BUFFSIZE, line_cats::cat, FALSE, G_calloc, G_chop(), G_debug(), G_free(), G_getl2(), G_projection(), G_realloc, G_scan_easting(), G_scan_northing(), G_warning(), GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_POINT, line_cats::n_cats, TRUE, Vect_cat_set(), Vect_copy_xyz_to_pnts(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_get_name(), Vect_is_3d(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_reset_cats(), Vect_write_line(), and x.
Read header of GRASS ASCII vector format.
| dascii | pointer to the ASCII file |
| Map | pointer to Map_info structure |
Definition at line 268 of file ascii.c.
References _, G_getl2(), G_warning(), 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().
| int Vect_write_ascii | ( | FILE * | ascii, |
| FILE * | att, | ||
| struct Map_info * | Map, | ||
| int | ver, | ||
| int | format, | ||
| int | dp, | ||
| char * | fs, | ||
| int | region_flag, | ||
| int | type, | ||
| int | field, | ||
| const struct cat_list * | Clist, | ||
| const char * | where, | ||
| const char ** | column_names, | ||
| int | header | ||
| ) |
Write data to GRASS ASCII vector format.
Prints message if some features without category are skipped.
| [out] | ascii | pointer to the output ASCII file |
| [out] | att | att file (< version 5 only) |
| Map | pointer to Map_info structure | |
| ver | version number 4 or 5 | |
| format | format GV_ASCII_FORMAT_POINT or GV_ASCII_FORMAT_STD | |
| dp | number of significant digits | |
| fs | field separator | |
| region_flag | check region | |
| type | feature type filter | |
| field | field number | |
| Clist | list of categories to filter features or NULL | |
| where | SQL select where statement to filter features or NULL | |
| column_names | array of columns to be included to the output or NULL "*" as the first item in the array indicates all columns | |
| header | TRUE to print also header |
Definition at line 348 of file ascii.c.
References _, Cell_head::bottom, line_cats::cat, columns, count, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_close_cursor(), db_close_database(), db_close_database_shutdown_driver(), db_column_Ctype(), db_describe_table(), db_fetch(), db_free_table(), db_get_column_name(), db_get_column_value(), db_get_cursor_table(), db_get_table_column(), db_get_table_number_of_columns(), db_get_value_double(), db_get_value_int(), db_get_value_string(), db_init_handle(), db_init_string(), DB_NEXT, DB_OK, db_open_database(), db_open_select_cursor(), db_select_int(), db_select_value(), DB_SEQUENTIAL, db_set_handle(), db_set_string(), db_shutdown_driver(), db_start_driver(), db_test_value_isnull(), db_zero_string(), field_info::driver, Cell_head::east, G_debug(), G_fatal_error(), G_free(), G_get_window(), G_important_message(), G_malloc, G_rasprintf(), G_store(), G_trim_decimal(), G_warning(), G_zero(), GV_AREA, GV_ASCII_FORMAT_POINT, GV_ASCII_FORMAT_STD, GV_ASCII_FORMAT_WKT, GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_POINT, GV_POINTS, HOST_NEWLINE, line_pnts::n_points, Cell_head::north, NULL, Cell_head::south, strcpy, Cell_head::top, TRUE, Vect_area_alive(), Vect_cat_get(), Vect_destroy_cats_struct(), Vect_destroy_field_info(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_field_cat_get(), Vect_get_area_cat(), Vect_get_area_cats(), Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_area_points(), Vect_get_field(), Vect_get_isle_area(), Vect_get_isle_points(), Vect_get_line_areas(), Vect_get_num_areas(), Vect_is_3d(), Vect_level(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_read_next_line(), Vect_rewind(), Vect_sfa_line_astext(), Cell_head::west, line_pnts::x, x, line_pnts::y, and line_pnts::z.
Write data to GRASS ASCII vector format.
| [out] | dascii | pointer to the output ASCII file |
| Map | pointer to Map_info structure |
Definition at line 970 of file ascii.c.
References HOST_NEWLINE, Vect_get_comment(), Vect_get_date(), Vect_get_map_date(), Vect_get_map_name(), Vect_get_organization(), Vect_get_person(), Vect_get_scale(), Vect_get_thresh(), and Vect_get_zone().