No subject


Wed Nov 14 13:37:45 EST 2007


Vect_header_get_i(,GV_NUM_LINES) is almost the same, you have to find either 
name of the function or the constant. I thought that to write and maintain 
one function is less work than to maintain >20 functions (also 
documentation). At this time we need:
V2_num_nodes()
V2_num_lines()
V2_num_areas()
V2_num_islands()
Vect_get/set_organization()
Vect_get/set_date()
Vect_get/set_your_name()
Vect_get/set_map_name()
Vect_get/set_source_date()
Vect_get/set_orig_scale()
Vect_get/set_other_info()
Vect_get/set_plani_zone()
Vect_get_with_z()

OK, that is not so bad, I'll write that functions.

> Though, I'm not sure what wrong with just having a bunch of functions
> to get/set things and then hide the details of the Map_info struct
> via a typedef.  Then:
>
> /* Vect.h */
> /* Error codes */
> #define VERR_NONE    0x0000
> #define VERR_EMEM    0x0001
> #define VERR_EINVAL  0x0002
> #define VERR_ERANGE  0x0004
> /* ... */
>
> typedef struct Map_info * Map_info_ptr;
>
> int Vect_log_errors (FILE *, int, const char *);
> int Vect_open_old (Map_info_ptr *, const char *, const char *);
> int Vect_close (Map_info_ptr *);
> int Vect_get_num_lines(Map_info_ptr);
> const char * Vect_get_organization(Map_info_ptr);
> int Vect_set_organization(Map_info_ptr, const char *);
> ...

Sorry, I don't understand much purpose of Vect_log_errors(), should be new
function? Which errors should log?


Another question: in grass50 are some functions (public - called by modules)
named Vect_* some V1_* and some for level 2 V2_*. But for example 
Vect_get_area/isle_points() doesn't start V2_ and works only on level 2.
Should be this keept in 5.1, or should all non internal functions start 
Vect_*? I prefer the later. In that case we have to rename:

V2_num_lines/nodes/areas/islands() -> Vect_get_num_lines/nodes/areas/islands()
V2_get_area/line_bbox() -> Vect_get_area/line_bbox()
V1_read_line() -> Vect_read_line_by_offset()
V2_read_line() -> Vect_read_line_by_fid() (by feature id)
                  (which is maybe even more transparent)


Radim











More information about the grass-dev mailing list