GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Vector library - Category index. More...
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Go to the source code of this file.
Macros | |
#define | SEP "------------------------------------------------------------------------------------------\n" |
Functions | |
int | Vect_cidx_get_num_fields (struct Map_info *Map) |
Get number of layer in category index. More... | |
int | Vect_cidx_get_field_number (struct Map_info *Map, int index) |
Get layer number for given index. More... | |
int | Vect_cidx_get_field_index (struct Map_info *Map, int field) |
Get layer index for given layer number. More... | |
int | Vect_cidx_get_num_unique_cats_by_index (struct Map_info *Map, int index) |
Get number of unique categories for given layer index. More... | |
int | Vect_cidx_get_num_cats_by_index (struct Map_info *Map, int index) |
Get number of categories for given layer index. More... | |
int | Vect_cidx_get_num_types_by_index (struct Map_info *Map, int field_index) |
Get number of types for given layer index. More... | |
int | Vect_cidx_get_type_count_by_index (struct Map_info *Map, int field_index, int type_index, int *type, int *count) |
Get type count field index and type index. More... | |
int | Vect_cidx_get_type_count (struct Map_info *Map, int field, int type) |
Get count of features of certain type by layer and type. More... | |
int | Vect_cidx_get_cat_by_index (struct Map_info *Map, int field_index, int cat_index, int *cat, int *type, int *id) |
Get number of categories for given field and category index. More... | |
int | Vect_cidx_find_next (struct Map_info *Map, int field_index, int cat, int type_mask, int start_index, int *type, int *id) |
Find next line/area id for given category, start_index and type_mask. More... | |
void | Vect_cidx_find_all (struct Map_info *Map, int layer, int type_mask, int cat, struct ilist *lines) |
Gind all line/area id's for given category. More... | |
int | Vect_cidx_dump (struct Map_info *Map, FILE *out) |
Write category index in text form to file. More... | |
int | Vect_cidx_save (struct Map_info *Map) |
Save category index. More... | |
int | Vect_cidx_open (struct Map_info *Map, int head_only) |
Read category index from file if exists. More... | |
Vector library - Category index.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2007 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 Vlib/cindex.c.
#define SEP "------------------------------------------------------------------------------------------\n" |
Definition at line 378 of file Vlib/cindex.c.
Referenced by Vect_cidx_dump().
int Vect_cidx_dump | ( | struct Map_info * | Map, |
FILE * | out | ||
) |
Write category index in text form to file.
[in] | Map | vector map |
[out] | out | output file |
Definition at line 389 of file Vlib/cindex.c.
References cat, count, G_debug(), tools::id, SEP, dialogs::type, Vect_cidx_get_cat_by_index(), Vect_cidx_get_field_number(), Vect_cidx_get_num_cats_by_index(), Vect_cidx_get_num_fields(), Vect_cidx_get_num_types_by_index(), Vect_cidx_get_num_unique_cats_by_index(), and Vect_cidx_get_type_count_by_index().
void Vect_cidx_find_all | ( | struct Map_info * | Map, |
int | layer, | ||
int | type_mask, | ||
int | cat, | ||
struct ilist * | lines | ||
) |
Gind all line/area id's for given category.
[in] | Map | vector map |
[in] | layer | layer number |
[in] | type_mask | type of objects to search for |
[in] | cat | category number |
[out] | lines | array of ids of found lines/points |
Definition at line 342 of file Vlib/cindex.c.
References dialogs::type, Vect_cidx_find_next(), Vect_cidx_get_field_index(), Vect_list_append(), and Vect_reset_list().
int Vect_cidx_find_next | ( | struct Map_info * | Map, |
int | field_index, | ||
int | cat, | ||
int | type_mask, | ||
int | start_index, | ||
int * | type, | ||
int * | id | ||
) |
Find next line/area id for given category, start_index and type_mask.
[in] | Map | vector map |
[in] | field_index | layer index |
[in] | cat | category number |
[in] | type_mask | requested type |
[in] | start_index | start search at this index (0 - whole category index) |
[out] | type | returned type |
[out] | id | returned line/area id |
Definition at line 269 of file Vlib/cindex.c.
References G_debug(), and G_fatal_error().
Referenced by Vect_cidx_find_all().
int Vect_cidx_get_cat_by_index | ( | struct Map_info * | Map, |
int | field_index, | ||
int | cat_index, | ||
int * | cat, | ||
int * | type, | ||
int * | id | ||
) |
Get number of categories for given field and category index.
[in] | Map | vector map |
[in] | field_index | layer index |
[in] | cat_index | category index |
[out] | cat | category number |
[out] | type | feature type |
[out] | id | feature id |
Definition at line 225 of file Vlib/cindex.c.
References G_fatal_error().
Referenced by wxdigit.IVDigit::InitCats(), and Vect_cidx_dump().
Get layer index for given layer number.
[in] | Map | vector map |
[in] | field | layer number |
Definition at line 75 of file Vlib/cindex.c.
References G_debug().
Referenced by Vect_cidx_find_all(), and Vect_cidx_get_type_count().
Get layer number for given index.
[in] | Map | vector map |
[in] | index | layer index: from 0 to Vect_cidx_get_num_fields() - 1 |
Definition at line 56 of file Vlib/cindex.c.
References G_fatal_error().
Referenced by wxdigit.IVDigit::InitCats(), and Vect_cidx_dump().
Get number of categories for given layer index.
[in] | Map | vector map |
[in] | index | layer index |
Definition at line 121 of file Vlib/cindex.c.
References G_fatal_error().
Referenced by wxdigit.IVDigit::InitCats(), and Vect_cidx_dump().
int Vect_cidx_get_num_fields | ( | struct Map_info * | Map | ) |
Get number of layer in category index.
[in] | Map | vector map |
Definition at line 41 of file Vlib/cindex.c.
Referenced by wxdigit.IVDigit::InitCats(), and Vect_cidx_dump().
Get number of types for given layer index.
[in] | Map | vector map |
[in] | field_index | layer index |
Definition at line 139 of file Vlib/cindex.c.
References G_fatal_error().
Referenced by Vect_cidx_dump().
Get number of unique categories for given layer index.
[in] | Map | vector map |
[in] | index | layer number |
Definition at line 102 of file Vlib/cindex.c.
References G_fatal_error().
Referenced by Vect_cidx_dump().
Get count of features of certain type by layer and type.
[in] | Map | vector map |
[in] | field | layer number |
[in] | type | feature type |
Definition at line 184 of file Vlib/cindex.c.
References count, G_debug(), and Vect_cidx_get_field_index().
int Vect_cidx_get_type_count_by_index | ( | struct Map_info * | Map, |
int | field_index, | ||
int | type_index, | ||
int * | type, | ||
int * | count | ||
) |
Get type count field index and type index.
[in] | Map | vector map |
[in] | field_index | layer index |
[in] | type_index | type index |
[out] | type | feature type |
[out] | count | number of items |
Definition at line 161 of file Vlib/cindex.c.
References G_fatal_error().
Referenced by Vect_cidx_dump().
Read category index from file if exists.
[in] | Map | vector map |
[in] | head_only | Read only header |
Definition at line 488 of file Vlib/cindex.c.
References buf, dig_cidx_init(), dig_file_init(), dig_read_cidx(), fclose(), G__file_name(), G_debug(), G_fopen_old(), G_warning(), NULL, sprintf(), and stat.
Referenced by Vect__open_old().
int Vect_cidx_save | ( | struct Map_info * | Map | ) |
Save category index.
[in] | Map | vector map |
Definition at line 444 of file Vlib/cindex.c.
References buf, dig__byte_order_out(), dig_file_init(), dig_init_portable(), dig_write_cidx(), fclose(), G__file_name(), G_debug(), G_warning(), NULL, and sprintf().
Referenced by Vect_close().