3

I want to combine some columns between 2 data attribute tables.

The question, which I asked a while ago: Copying features from one attribute table to another using QGIS leads to quote long way.

Recently I "discovered" another tool, which might be far quicker. The tool is the "Merge attributes of selected features" located in the advanced toolbar.

I found some answer, which could be helpful: Copy attributes from one feature to empty row of another feature in QGIS 3, but it doesn't work in my case really.

I want to copy the XY coordinates from one attribute table to another.

enter image description here

and I was following the instructions from the thread above.

Unfortunately in my case, nothing happens. When I click OK my data attribute table remains still empty.

enter image description here

What am I doing wrong?

14
  • Have you made sure, both columns have the same field type? Couldn't you use join attributes by field?
    – Erik
    Commented Sep 23, 2020 at 10:15
  • yes I am sure. Firstly I created the data attribute table, and next I did the centroid option from Vector section in order to gain the coordinates for my polygons. The centroid option generated the separate layer for me with the same data attribute layer. Next I could use the coordinates calculation for points, which I want now to transfer into another data attribute table
    – Geographos
    Commented Sep 23, 2020 at 10:39
  • How do these attribute tables differ, other than one has the coordinates, and the other doesn't?
    – Erik
    Commented Sep 23, 2020 at 10:45
  • 1
    Then I strongly suggest you make your life easier by using x(centroid($geometry)) respectively y(centroid($geometry)) on the polygon layer and forget about creating centroids and rejoining the attributes.
    – Erik
    Commented Sep 23, 2020 at 10:50
  • 1
    Yes indeed mate! The expression: y(centroid(transform($geometry, layer_property(@layer_name, 'crs'), 'EPSG:4326'))) gives a latitude result! Many thanks for today's help!
    – Geographos
    Commented Sep 23, 2020 at 10:58

0

Browse other questions tagged or ask your own question.