v.category problem - was Re: [GRASS-dev] Keywords, help pages...

Trevor Wiens twiens at interbaun.com
Tue Aug 29 09:55:42 EDT 2006


On Tue, 29 Aug 2006 12:27:42 +0200
"Radim Blazek" <radim.blazek at gmail.com> wrote:

> On 8/28/06, Markus Neteler <neteler at itc.it> wrote:
> > Trevor Wiens wrote on 08/28/2006 03:20 PM:
> > > Posting an answer to the user list....
> > >
> > > On Mon, 28 Aug 2006 22:14:56 +1200
> > > Hamish <hamish_nospam at yahoo.com> wrote:
> > >
> > >
> > >> In GRASS-land boundaries + centroids make polygons, so convert lines to
> > >> boundaries with v.type and add centroids with "v.category option=add".
> > >>
> > >
> > > Here is a classic case of something being difficult to find where
> > > properly defined keywords might help. I'd wondered about how to add
> > > centroids to areas before, but never bothered to figure it out when
> > > nothing obvious showed up scanning the command listing and descriptions.
> > >
> > > Even trickier, with v.category the option=add with the type=centroid
> > > doesn't add centroids, the type must be set to areas. I can't imagine
> > > how the naming could be more counter-intuitive.
> 
> v.category adds category to geometry objects. The option 'type'
> specifies the type of geometry objects to which the cattegory is added.
> The 'type' option is something like input filter, only the geometry
> specified in 'type' is processed. This works the same way for all modules.

Radim,

By this logic, then to add centroids one should specify boundary not
area, because no areas exist before you add a centroid. In which case
this still doesn't make any sense.

> If you use type=centroid, that means that you want to add cats to centroids
> not that you want to add centroids.

This was not clear to me on a quick read through the help page.

> Areas are special case because it is impossible to attach a cat to area
> without centroid, the module places the centroids in areas automaticaly.
>
> The only thing I can imagene it would be possible to do is to remove
> type area and move the functionality to a new module v.centroid.
> That would certainly make use more difficult.
> 

I don't know how properly separating functionality into logical units
makes things more difficult to use. Adding centroids and categorizing
vector objects are two completely different things. It might be nice
to be able to do them both at once, but it would be more logical to
have the base functionality separated into two functions and then
super function which would allow doing both at once. My complaint was
that the documentation was unclear. 

Now that I read your explanation, it is clear to me that there is mixed
functionality and inconsistent use of type in this module. If Markus
wants to split it off that would be much cleaner as well as more
understandable to most people. However I am happy to update the help
page so that it is clear what is going on, even though the terminology
is questionable and its use inconsistent...

T
-- 
Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)




More information about the grass-dev mailing list