#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 dependency graph for Vlib/cindex.c:

Go to the source code of this file.
Defines | |
| #define | SEP "------------------------------------------------------------------------------------------\n" |
Functions | |
| int | Vect_cidx_get_num_fields (struct Map_info *Map) |
| get nuber of field in category index | |
| int | Vect_cidx_get_field_number (struct Map_info *Map, int index) |
| get field number for given index | |
| int | Vect_cidx_get_field_index (struct Map_info *Map, int field) |
| get field index for given field number | |
| int | Vect_cidx_get_num_unique_cats_by_index (struct Map_info *Map, int index) |
| get nuber of unique categories for given field index | |
| int | Vect_cidx_get_num_cats_by_index (struct Map_info *Map, int index) |
| get nuber of categories for given field index | |
| int | Vect_cidx_get_num_types_by_index (struct Map_info *Map, int field_index) |
| get nuber of types for given 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 | |
| int | Vect_cidx_get_type_count (struct Map_info *Map, int field, int type) |
| get count of features of certain type by field 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 nuber 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 | |
| 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) |
| write category index to file | |
| int | Vect_cidx_open (struct Map_info *Map, int head_only) |
| #define SEP "------------------------------------------------------------------------------------------\n" |
| int Vect_cidx_dump | ( | struct Map_info * | Map, | |
| FILE * | out | |||
| ) |
write category index in text form to file
| Map_info | structure | |
| out | output file |
Definition at line 318 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().
| 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
-1 not found
| Map | ||
| field_index | ||
| cat | category | |
| type_mask | requested type | |
| start_index | start search at this index (0 - whole category index) | |
| type | returned type | |
| id | returned line/area id |
Definition at line 252 of file Vlib/cindex.c.
| int Vect_cidx_get_cat_by_index | ( | struct Map_info * | Map, | |
| int | field_index, | |||
| int | cat_index, | |||
| int * | cat, | |||
| int * | type, | |||
| int * | id | |||
| ) |
get nuber of categories for given field and category index
0 on error
| Map | ||
| field_index | ||
| cat_index | ||
| cat | ||
| type | ||
| id |
Definition at line 211 of file Vlib/cindex.c.
Referenced by Vect_cidx_dump().
| int Vect_cidx_get_field_index | ( | struct Map_info * | Map, | |
| int | field | |||
| ) |
get field index for given field number
| Map_info | structure | |
| field | field number |
Definition at line 73 of file Vlib/cindex.c.
Referenced by Vect_cidx_get_type_count().
| int Vect_cidx_get_field_number | ( | struct Map_info * | Map, | |
| int | index | |||
| ) |
get field number for given index
| Map_info | structure | |
| index | field index: from 0 to Vect_cidx_get_num_fields()-1 |
Definition at line 55 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 nuber of categories for given field index
| Map_info | structure | |
| index |
Definition at line 116 of file Vlib/cindex.c.
Referenced by Vect_cidx_dump().
| int Vect_cidx_get_num_fields | ( | struct Map_info * | Map | ) |
get nuber of field in category index
| Map_info | structure |
Definition at line 40 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 nuber of types for given field index
| Map_info | structure | |
| index |
Definition at line 133 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 nuber of unique categories for given field index
| Map_info | structure | |
| field |
Definition at line 99 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 field and type
| Map_info | structure | |
| field | ||
| type |
Definition at line 173 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
0 on error
| Map_info | structure | |
| index |
Definition at line 152 of file Vlib/cindex.c.
Referenced by Vect_cidx_dump().
| int Vect_cidx_open | ( | struct Map_info * | Map, | |
| int | head_only | |||
| ) |
Definition at line 413 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 | ) |
write category index to file
1 on error
| Map_info | structure |
Definition at line 370 of file Vlib/cindex.c.
References dig__byte_order_out(), dig_file_init(), dig_init_portable(), and dig_write_cidx().
Referenced by Vect_close().
1.5.1