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

Markus Metz markus.metz.giswork at googlemail.com
Fri Jun 8 10:10:32 PDT 2012


On Fri, Jun 8, 2012 at 2:25 PM, Jaromír Kamler <kamler at centrum.cz> 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.

If both vectors are available as shapefiles, you could put the two
shapefiles into one directory (with no other shapefiles in it) and
then try something like

v.in.ogr dsn=/path/to/folder/with/shapefiles/ type=boundary,centroid

With type=boundary,centroid, lines will be converted to boundaries and
points to centroids. Attributes attached to sites (points) will now be
attached to areas, nothing else to do.

Markus M


More information about the grass-user mailing list