On Wed, Nov 21, 2012 at 4:18 PM, Markus Metz <[email protected]> wrote: > On Wed, Nov 21, 2012 at 3:59 PM, Martin Landa <[email protected]> wrote: >> Hi, >> >> 2012/11/21 Maris Nartiss <[email protected]>: >>> Your code in r53760 seems good. I would suggest to move it to some >>> library, still no idea where it should go. Probably Vlib? As it would >>> reduce code duplication and use of home-brew suboptimal code. >> >> Vlib seems to be a good place, see also similar (more options >> included) stuff in v.edit [1]. > > I agree, particularly if more modules will get cats/where options, > maybe also to work with virtual vector maps. I would suggest two new > functions, one to parse cats/where/field options, essentially the > parse_filter_options() fn, another one to check categories against > these filters.
Done in r53997. The new functions are called Vect_cats_set_constraint() and Vect_cats_in_constraint(). I would prefer the term 'filter' but used the term 'constraint' for consistency because it is already used elsewhere in the vector lib for region and line type constraints. Markus M _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
