[GRASS-user] Attribute transfer from one table to another based onposition of vector items

Jaromír Kamler kamler at centrum.cz
Fri Jun 8 05:59:03 PDT 2012


Thanks, this works fine.
 
J.K.
______________________________________________________________
> Od: "Moritz Lennert" 
> Komu: "Jaromír Kamler" 
> Datum: 08.06.2012 14:45
> Předmět: Re: [GRASS-user] Attribute transfer from one table to another based onposition of vector items
>
On 08/06/12 14:25, Jaromír Kamler wrote:
> Hi,
>
> I have two vectors imported from SHP. One contains lines (areas), which
> represents sites and in other are texts with cost of sites. I imported
> them to GRASS. Texts with costs of ground are now points with cost in
> attribute table and I turned circuid lines to the areas with centroids.I
> need copy costs from attribute table of costs to the attribute table of
> sites vector. I have no key for connection of this tables. Only one
> "key" is their position, because points with cost attribute are above
> corresponding areas. One point with cost of ground is above one area.
> How get cost of corresponding point to the corresponding attribute of
> ground? I do not see any simple possibility.

Use something like this:

v.db.addcolumn map=sites column="sites_cost int" (or double precision 
depending on how your cost is defined)

v.distance from=sites to=costs from_type=centroid upload=to_attr 
column=sites_cost to_column=cost_column_in_points_map

Moritz


More information about the grass-user mailing list