I have a CSV file with the following output
id, x min, y min, x max, y max, value
1 , 0 , 0 , 100 , 100 , 5
2 , 0, , 100 , 100 , 200 , 10
3 , 100 , 100 , 200 , 200 , 15
4 , 100 , 0 , 200 , 100 , 20
I can plot the co-ordinate points onto my basemap fine. What I'm trying to do is tell QGIS that row 1 of the CSV has the bottom left and top right corners of a square, to draw it, and to assign it a value of 5.
I'm not even sure this is the right way to achieve my goal – which is to display a grid with different values attached to each square, and then produce a heat-map based on those values.
Thanks.
Best Answer
I would go through WKT way. You could edit your data a bit and build polygons as WKT from the corners of your boxes and save the result into csv file which you can finally import with the CSV plugin. See documentation http://docs.qgis.org/2.0/en/docs/user_manual/introduction/general_tools.html#add-delimited-text-layer
However, it is more fun to do the conversion with SQL within Spatialite. Install spatialite-gui, create an empty database and copy and execute the following SQL statements one by one in the SQL box.
When you are ready you can connect your database with QGIS and import the table. Note that I used EPSG:4326 as the coordinate system. Edit it if needed.
If you decide to build WKT without Spatialite/SQLite you can do it with Excel or OpenOffice by using the text string functions. The result should be like this (square has four corners but WKT polygon must be closed and therefore the first point must be repeated as the last point)