0

I want to create a map of India showing 30 districts that have the highest COVID-19 cases as of 31 December 2020 using QGIS. I marked the 30 districts and added the CSV file to this layer. I want to create a proportional symbol according to cumulative confirmed cases, but not with discrete values, but for specific ranges because the number of cumulative cases ranges from 55000 to 6 lakhs. I searched for the "Assistant' option in the 'size' section in the 'Properties' of the point. But in the input menu I am not able to give the source. It doesn't show anything for selection.So if I apply my changes, it is displaying graduated symbols not proportional symbol.

How can I solve this? Why does the input menu display nothing? I want to gave the column name of the confirmed cases in the csv file in that section. But it shows nothing. enter image description here

enter image description here attribute table of csv file enter image description here

layer panel screenshot enter image description here

screenshot of csv file with header missingenter image description here

Letitbe
  • 81
  • 5
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short [tour] for more about how the site works – Ian Turton Apr 20 '21 at 14:24
  • 1
    does https://gis.stackexchange.com/questions/353318/how-to-create-proportional-circles-in-qgis-3-4 help? – Ian Turton Apr 20 '21 at 14:26
  • yes I tried and I am stuck with the Input source in the option menu, I am not able to gave the input source in that menu,This is where I am stuck with.I clearly explained it,Then what is the problem? – Letitbe Apr 20 '21 at 14:30
  • Which input source in which option menu? may be a screen shot would help – Ian Turton Apr 20 '21 at 14:31
  • Please also provde example data. – Erik Apr 20 '21 at 14:33
  • I provided the screeshot of csv file and the qgis project for your refernce. – Letitbe Apr 20 '21 at 14:44
  • The QA link provided by you didn't works for me because of the version problem,I have QGIS 3.18.1 with me.May be that's the reason – Letitbe Apr 20 '21 at 14:50

2 Answers2

1

Check that the field is numeric. If it's a string, you can't use it.

You have 2 layers, a point layer an a table layer. The Table layer (20cities) has no geometry. The points layer probably has no attributes. You can either:

  1. Join the 2 layers, if necessary (harder)
  2. Just use the 20cities layer, as it has lat and long columns (that have not been imported as feature geometries). Set the geometry properly, by importing the table again, but make sure you set the 'long' column as the X field of the point feature geometry, and 'lat' as the Y field, as shown below (mine are Latitude and Longitude, which QGIS recognises automatically - you can change 'lat' and 'long' in your CSV file to Latitude and Longitude to see this automatically, or just manually select them).

enter image description here

wingnut
  • 2,090
  • 5
  • 10
  • No sir, did you mean the datatype of that column I checked it is float 64 that is in numeric.So I think it is not the issue. – Letitbe Apr 20 '21 at 17:18
  • And have you try to do it with the "graduated" styler. It is possible to use point size as the graduation and any field. Check the attribute table to see if it the same data you have in excel. – Corentin Lemaitre Apr 20 '21 at 22:53
  • Can you open the CSV data as a table in QGIS, instead of Excel? Screen shot will help. Show us the QGIS layer panel as well. Maybe you have no geometry. – wingnut Apr 21 '21 at 01:51
  • When I apply the above changes,putting the 'input source' space as empty,I will get the points in 'graduated style'.It is working.for graduated style no issues.@Corentin Lemaitre – Letitbe Apr 21 '21 at 05:20
  • I will add the screenshot of attribute table of csv file and layer panel in question section @wingnut – Letitbe Apr 21 '21 at 06:35
  • As I thought, it has no geometry. When you import a delimited text layer, make sure you capture the geometry from the lat and long columns. I'll add an answer to show the process. – wingnut Apr 21 '21 at 06:53
  • No it is still not working,I joint the 2 layers (point layer and my csv layer)then I try to change the properties of that layer to make proportional symbol.The condition is same as earlier.Input source clumn shows nothing. – Letitbe Apr 21 '21 at 08:38
  • As per your second suggestion I once again tried to add my csv file customising the X and Y axes,but csv fie opening in that section didn't show my first row that is the row containing what is the data,header column is missing.So I am not able to specify the geometry there.I will provide the screenshot of opened csv file. in question section. – Letitbe Apr 21 '21 at 08:46
  • Looks like your CSV file has no header row. Manually edit the CSV file in Excel or a text editor. Add headings for each column. Use Latitude and Longitude for the names of the spatial columns. – wingnut Apr 21 '21 at 09:01
  • But I am confused because my csv file has header row in it,you can see it in the 1st picture in the question section.The header row have sl no,state,districts,confirmed lat,long titles in it.But you are saying that it has no header row.Does the thing I am talking about is not header row?I don't know it,please explain to me. – Letitbe Apr 21 '21 at 10:12
  • It is a header row, yes. But it wasn't being used. In the Text File Import Dialog, expand the Records and Fields Options section. I can't see what you have there. In mine, you can see "First record has field names" has been checked. Also, "Number of header rows to discard" is set to 0. What do you have in yours? – wingnut Apr 21 '21 at 13:03
  • ok,it worked ,Now I am able to gave input source in option menu.It was the mistake in header row.The 1st row was discarded init.I corrected it. – Letitbe Apr 21 '21 at 14:36
0

To use size of the point based on a field you can only choose a field that contain number. When you do import your data from CSV QGIS choose the data type for every column. If the column contains anything that is not a number then all the colum would be considered as text.

You have a solution that will work without doing again the import csv process. You can click on the epsilon sign to open expression toolbox, it will help you make the formula to transform your data to integer type.

The expression toolbox have in the rigth side the function you can use and the decription. In the section field and values you will find the list of the field in your dataset, double click on the field you want to use to add it in the left panel.

Then you can adapt the formula in the left panel to get this kind ofresult try ( to_int ("MY_FIELD"),0)

Corentin Lemaitre
  • 3,003
  • 5
  • 17