|
GRASS Programmer's Manual
6.4.1(2011)
|
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.
Defines | |
| #define | SEP "------------------------------------------------------------------------------------------\n" |
Functions | |
| int | Vect_cidx_get_num_fields (struct Map_info *Map) |
| Get number of layer in category index. | |
| int | Vect_cidx_get_field_number (struct Map_info *Map, int index) |
| Get layer number for given index. | |
| int | Vect_cidx_get_field_index (struct Map_info *Map, int field) |
| Get layer index for given layer number. | |
| int | Vect_cidx_get_num_unique_cats_by_index (struct Map_info *Map, int index) |
| Get number of unique categories for given layer index. | |
| int | Vect_cidx_get_num_cats_by_index (struct Map_info *Map, int index) |
| Get number of categories for given layer index. | |
| int | Vect_cidx_get_num_types_by_index (struct Map_info *Map, int field_index) |
| Get number of types for given layer 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| int | Vect_cidx_dump (struct Map_info *Map, FILE *out) |
| Write category index in text form to file. | |
| int | Vect_cidx_save (struct Map_info *Map) |
| Save category index. | |
| int | Vect_cidx_open (struct Map_info *Map, int head_only) |
| Read category index from file if exists. | |
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 377 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 388 of file Vlib/cindex.c.
References SEP, 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 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.
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.
Referenced by Vect_cidx_dump().
| int Vect_cidx_get_field_index | ( | struct Map_info * | Map, |
| int | field | ||
| ) |
Get layer index for given layer number.
| [in] | Map | vector map |
| [in] | field | layer number |
Definition at line 75 of file Vlib/cindex.c.
Referenced by Vect_cidx_find_all(), and Vect_cidx_get_type_count().
| int Vect_cidx_get_field_number | ( | struct Map_info * | Map, |
| int | index | ||
| ) |
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.
Referenced by Vect_cidx_dump().
| int Vect_cidx_get_num_cats_by_index | ( | struct Map_info * | Map, |
| int | index | ||
| ) |
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.
Referenced by 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 Vect_cidx_dump().
| int Vect_cidx_get_num_types_by_index | ( | struct Map_info * | Map, |
| int | field_index | ||
| ) |
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.
Referenced by Vect_cidx_dump().
| int Vect_cidx_get_num_unique_cats_by_index | ( | struct Map_info * | Map, |
| int | index | ||
| ) |
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.
Referenced by Vect_cidx_dump().
| 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.
| [in] | Map | vector map |
| [in] | field | layer number |
| [in] | type | feature type |
Definition at line 184 of file Vlib/cindex.c.
References 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.
Referenced by Vect_cidx_dump().
| int Vect_cidx_open | ( | struct Map_info * | Map, |
| int | head_only | ||
| ) |
Read category index from file if exists.
| [in] | Map | vector map |
| [in] | head_only | Read only header |
Definition at line 487 of file Vlib/cindex.c.
References dig_cidx_init(), dig_file_init(), and dig_read_cidx().
Referenced by Vect__open_old().
| int Vect_cidx_save | ( | struct Map_info * | Map | ) |
Save category index.
| [in] | Map | vector map |
Definition at line 443 of file Vlib/cindex.c.
References dig__byte_order_out(), dig_file_init(), dig_init_portable(), and dig_write_cidx().
Referenced by Vect_close().