[GRASS-user] Vector map attributes
craig.leat at gmail.com
Mon Mar 30 10:10:49 EDT 2009
Thanks for the comments.
>>I have a vector map with points representing latrines and each point
>>has an attribute describing the place name. I ran v.edit to snap
>>points with a threshold of 5m
>Because you think that these points are actually duplicates, or because
>you want the information about all latrines within a certain radius to be
Some points are exact duplicates (points were downloaded from the GPSr
more than once), others were captured in the field at different times
and although representing the same structure do not have identical
co-ordinates. I snap the points to try and achieve one point per
> ... maybe you get meaningful results if there is either
> one point with several categories or several points with one category each,
> but not both. I'm not sure what v.edit did, but it is possible that you now
> have several points with identical coordinates and all points have several,
> identical categories.
When I snap points A and B, a new feature C is created and it inherits
the attributes of B and C, even if they are identical. Since I'm
counting rows of attributes (not features) these extra categories
cause problems and need to be removed. v.clean and v.edit don't help
because they remove features not cats.
> Or v.clean tool=rmdupl (although the man page says "pay attention to
> categories!" - don't know what that means).
Cats are not deleted when a feature is removed (at least for the
rmdupl tool). Could be clarified in the manual, I think.
1. Use v.category opt=print and parse out one cat per feature
2. Add a new table (MyCats) to the point vector and populate it with
the list of cats.
3. Instead of:
echo "SELECT *,count(Area) FROM MT_San_clean GROUP BY Area" | db.select
do this instead (thanks Moritz):
echo "SELECT *,count(Area) FROM MT_San_clean WHERE ""cat in (select *
from MyCats)"" GROUP BY Area" | db.select
Gcina down from 2177 to 1340. Wow, fieldwork was really bad!
I'll try to update the FAQ...
More information about the grass-user