Skip to main content
edited tags
Link
she_weeds
  • 13k
  • 1
  • 32
  • 64
deleted 86 characters in body; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Fill Filling field with values from another tables's field (QGIS 3.28.9)of another table using QGIS

I am using QGIS 3.28.9.

I need to complete a field from a building's layer with the field's values from a plot's layer, based on the location of the buildings. At first I thought of doing it through the "Join attributes by location" tool, but I have some restrictions that difficult this. I'm working directly in the layers on the database, so any solution which requires to create a new layer is not possible for me. Also, I'm not allowed to create new fields in the attribute table, I can only modify the values of the existing columns which I have been doing manually.

Said this, I've tried doing some things, but without succeeding:

1. Use the "Join attributes by location" tool to create a new layer with the values I need, then try to pass the values to the original layer through an id field (this is where i have problems). I tried doing this by editing the column with an expression, following the next idea:

if( "object_id(layer1)" = "object_id(layer2)" , "field_value(layer2)" , "field_value(layer1)"

(If the object id is the same in both tables, the register takes the value from table 2, if not, it maintains the original value (NULL)). However, I couldn't find the way to cite the second layer in the script.

2. I tried doing a relation through Layer Properties / Attribute Form, to complete the field's values directly with the intersecting plots values, following the answer from this post QGIS 3.28 : Relational value form (spatial intersection)

While I could do it, I found some problems with it: The result is a selection list with two options: open and close brackets (), and the value from the plots layer (see image below). Apparently I have to select the value in each register manually. Also, I couldn't find a way to make this values the definitive values of the field. If I delete the relation the values disappear. Finally, and most important, I can't find a way to do this only for the selected elements form the layer, which is a problem, because I don't want to do it to the whole layer (It would change the values in another areas I'm not working with and ti would be a disaster).

enter image description here

3. I didn't triedtry it, but maybe it's possible to do this using PostGIS. However, mimy knowledge about this is very limited

I'm still working on my english, so please ask for any clarification if needed. Any help would be appreciated

Fill field with values from another tables's field (QGIS 3.28.9)

I need to complete a field from a building's layer with the field's values from a plot's layer, based on the location of the buildings. At first I thought of doing it through the "Join attributes by location" tool, but I have some restrictions that difficult this. I'm working directly in the layers on the database, so any solution which requires to create a new layer is not possible for me. Also, I'm not allowed to create new fields in the attribute table, I can only modify the values of the existing columns which I have been doing manually.

Said this, I've tried doing some things, but without succeeding:

1. Use the "Join attributes by location" tool to create a new layer with the values I need, then try to pass the values to the original layer through an id field (this is where i have problems). I tried doing this by editing the column with an expression, following the next idea:

if( "object_id(layer1)" = "object_id(layer2)" , "field_value(layer2)" , "field_value(layer1)"

(If the object id is the same in both tables, the register takes the value from table 2, if not, it maintains the original value (NULL)). However, I couldn't find the way to cite the second layer in the script.

2. I tried doing a relation through Layer Properties / Attribute Form, to complete the field's values directly with the intersecting plots values, following the answer from this post QGIS 3.28 : Relational value form (spatial intersection)

While I could do it, I found some problems with it: The result is a selection list with two options: open and close brackets (), and the value from the plots layer (see image below). Apparently I have to select the value in each register manually. Also, I couldn't find a way to make this values the definitive values of the field. If I delete the relation the values disappear. Finally, and most important, I can't find a way to do this only for the selected elements form the layer, which is a problem, because I don't want to do it to the whole layer (It would change the values in another areas I'm not working with and ti would be a disaster).

enter image description here

3. I didn't tried it, but maybe it's possible to do this using PostGIS. However, mi knowledge about this is very limited

I'm still working on my english, so please ask for any clarification if needed. Any help would be appreciated

Filling field with values from field of another table using QGIS

I am using QGIS 3.28.9.

I need to complete a field from a building's layer with the field's values from a plot's layer, based on the location of the buildings. At first I thought of doing it through the "Join attributes by location" tool, but I have some restrictions that difficult this. I'm working directly in the layers on the database, so any solution which requires to create a new layer is not possible for me. Also, I'm not allowed to create new fields in the attribute table, I can only modify the values of the existing columns which I have been doing manually.

Said this, I've tried doing some things, but without succeeding:

1. Use the "Join attributes by location" tool to create a new layer with the values I need, then try to pass the values to the original layer through an id field (this is where i have problems). I tried doing this by editing the column with an expression, following the next idea:

if( "object_id(layer1)" = "object_id(layer2)" , "field_value(layer2)" , "field_value(layer1)"

(If the object id is the same in both tables, the register takes the value from table 2, if not, it maintains the original value (NULL)). However, I couldn't find the way to cite the second layer in the script.

2. I tried doing a relation through Layer Properties / Attribute Form, to complete the field's values directly with the intersecting plots values, following the answer from this post QGIS 3.28 : Relational value form (spatial intersection)

While I could do it, I found some problems with it: The result is a selection list with two options: open and close brackets (), and the value from the plots layer (see image below). Apparently I have to select the value in each register manually. Also, I couldn't find a way to make this values the definitive values of the field. If I delete the relation the values disappear. Finally, and most important, I can't find a way to do this only for the selected elements form the layer, which is a problem, because I don't want to do it to the whole layer (It would change the values in another areas I'm not working with and ti would be a disaster).

enter image description here

3. I didn't try it, but maybe it's possible to do this using PostGIS. However, my knowledge about this is very limited.

edited title
Link

Fill field with registersvalues from another tables's field (QGIS 3.28.9)

Source Link
Loading