Skip to main content
Tweeted twitter.com/StackGIS/status/1515525551196409860
Became Hot Network Question
edited body
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to 1n-relations-in-label-expressions-general-syntax

enter image description hereenter image description here

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to 1n-relations-in-label-expressions-general-syntax

enter image description here

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to 1n-relations-in-label-expressions-general-syntax

enter image description here

added 108 characters in body
Source Link
J.R
  • 17.4k
  • 2
  • 23
  • 55

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

[SecondSecond edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to https://gis.stackexchange.com/questions/320954/1n-relations-in-label-expressions-general-syntax ]1n-relations-in-label-expressions-general-syntax

enter image description here

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

[Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to https://gis.stackexchange.com/questions/320954/1n-relations-in-label-expressions-general-syntax ]

enter image description here

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to 1n-relations-in-label-expressions-general-syntax

enter image description here

edited body
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

[Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to https://gis.stackexchange.com/questions/320954/1n-relations-in-label-expressions-general-syntax ]

enter image description hereenter image description here

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

[Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to https://gis.stackexchange.com/questions/320954/1n-relations-in-label-expressions-general-syntax ]

enter image description here

I am using QGIS, version 3.24.0. I have a shapefile called "Map_CorrectionDEF", uniquely identify by fields "GID" and "unitcode". It is a grid cell, in which the field "GID" is the cell and "unitcode" the country to which the cell belongs.

On the other hand, I have a CSV file, called crop_main (no geometry), uniquely identify by "unitcode" and "cropclass", where "unitcode" refers to the country and "cropclass" the type of crop.

I present an example of my CSV file:

enter image description here

I want to connect both fields. I would like to assign to each cell the type of crop which exist in the country which the cell belongs. More specific, for each cell, which belongs to a country ("unitcode" field), I would like to join every value of my csv file with has the same value of "unitcode". The goal is to obtain for all the cells of my shape file the information of all cropland which grows in the country. Hence, all the cells of the same country should have the same number of crops.

To do it (I am not sure if the correct way), I am doing the following relations:

enter image description here

However, when I do it, I am not able to visualize the relation I am creating. According to this, https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html?#creating-one-or-many-to-many-relations "depending on your settings, the form might open directly or you will have to choose to open it in the identification dialog under actions." In my case it's not open directly, but I am not able to go to the identification dialog.

I add a screenshot of what I see when I click one my cells in the map after doing the relation which @J.R proposed in his answer.

enter image description here

[Second edit: I attach an screenshot of how I try to match the 1:many with aggregate function according to https://gis.stackexchange.com/questions/320954/1n-relations-in-label-expressions-general-syntax ]

enter image description here

added 295 characters in body
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15
Loading
edited body
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15
Loading
added 35 characters in body
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15
Loading
added 188 characters in body
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15
Loading
edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Loading
Source Link
OgeiD
  • 618
  • 1
  • 5
  • 15
Loading