[GRASS5] vector cats files

Eric G. Miller egm2 at jps.net
Fri Jul 12 16:39:24 EDT 2002


On Mon, Jul 08, 2002 at 05:27:45PM -0600, Roger Miller wrote:
 
> I also tried to reduce the size of the output cats files by using the GRASS5 
> cats file format in which each line can describe a range of category numbers. 
> The program runs, produces a good-looking cats file and a complete vector 
> file.  The vector file displays correctly using d.vect, but any module that 
> accesses the cats file seems to either seg fault (d.what.vect) or ignore the 
> categories (v.digit).
> 
> If use the old format with no ranges then everthing works fine, but I have a 
> category file that is considerably bigger than I need.
> 
> Has the GRASS5 vector library not been updated to use the GRASS5 cats file 
> format?  If it has been updated, then could their be a bug in the library 
> that shows up on large files?  Or do I need to look elsewhere for the problem?

AFAIK, vector cats don't support ranges.  Range support is primarily for
floating point rasters where exact quantities are possibly
unrepresentable (fractions like .1).  The main problem I saw was in
G_set_cat() as it does a linear search/comparison for each insert.  This
isn't desirable for data imports due to the geometric time increase...
Better to just build a list or array of categories, sort, then uniquify
and write out the results....

> A couple further questions.  
> 
> m.in.e00 produces  one cats file for each attribute that it imports.  The 
> user is supposed to activate a file by copying one of the cats files over to 
> a file with the default name for the map, then running v.support.  If I 
> perform that step (which takes about 10 minutes) then change to a new cats 
> file and repeat the step I get a very long dump of duplicate labels.  Is 
> there some way to avoid that?  The only way I've found so far is to delete 
> and reimport the vector file.  The step of running v.support on a second set 
> of cats seems unnecessary to me.  Is there some way to avoid doing that?

The easy way is to use symlinks to change the "active" category label.
I don't recall whether v.support is necessary (I thought it wasn't)...
We are just talking about the dig_cats file, and not the dig_att?

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list