[Qgis-user] Easiest way to get get feature field values from one layer to be able to copy to another layer

chris hermansen clhermansen at gmail.com
Sat Jan 30 18:01:13 PST 2021

Cory and list

On Sat, Jan 30, 2021, 17:09 Cory Albrecht <maps at hanfastolfe.com> wrote:

> Hello,
> I am looking for a way to select an arbitrary number features in one layer
> and then copy the values of their id fields into fields of an arbitrary
> feature in a second layer.
> For example, I have one layer which is the polygons for countries with the
> field *feathure_uuid*, and a second layer that has the border lines
> between the countries with two fields *north_east_feature* and
> *south_west_feature*. I'd like to be able to select the two country
> features on the opposite sides of the border line and have
> *countries.feature_uuid* for each one placed into borders.
> *north_east_feature* and border.*south_west_feature*.

Not completely following you here but the normal thing is to do a "join"
between two tables on a common attribute.

Sometimes it's necessary to compute that attribute first in each table.

When you right click on a layer and click on properties you'll see the
option to define joins.

Does this help?

> Do I have to finally bite the bullet and learn python to do this, or is
> there some combination of existing tools I can use to do it instead?

This kind of thing can be precomputed with Python or awk or some other
scripting language by working on the CSV version of the attribute tables
and calculating the common attribute that way. But I'd try just using the
field calculator and then table join in QGIS first.

It would help if you would post some examples with real "numbers".

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210130/e9cb9a19/attachment.html>

More information about the Qgis-user mailing list