Wednesday, 2 May 2018

heat map - Creating map with states by attribute value using QGIS?


I'm using QGIS, but I am quite familiar with R and python, so I could use any of these.


I want a map of mexico but want to color the states according to a certain variable that goes from 0 to 100. So it would be like a heatmap of Mexico.


How can I do this?


I just have the names of the states and the corresponding value. I would therefore need an already made "empty" map with the states already defined or something.



Answer



If your data consists of points and you would like to create a heatmap, QGIS has a handy heatmap plugin. There is a great tutorial on creating heatmaps from point data here.


Often it is useful to display categorical data in your maps. In this case, I would recommend using the integrated QGIS ColorBrewer located in the style manager. There is a great tutorial here. Or, you can use the online Color Brewer for cartographic color advice.


Since your data consists of a value for each Mexican state, try the following steps:




  1. Download a .shp of Mexican states--I found one titled "Mexico States" or Global Administrative Areas

  2. Right-click the new layer and select "Toggle Editing"

  3. Right click on the layer and select "Open Attribute Table"

  4. On the bottom of the attribute table, select "New Column" and choose the necessary parameters

  5. Type in whatever value you want in the new column next to each state name

  6. Deselect the "Toggle Editing" tab

  7. Right click on the layer again choose Properties > Style

  8. Within the Style tab, choose "Categorized" and column "YourNewField"

  9. Choose the color ramp (Here you can integrate ColorBrewer)


  10. Select the "Classify" tab and the color ramp will display

  11. Select "OK"


Your new map reflects custom values associated with each state. This is only one of many ways to accomplish your goals. Good luck!


enter image description here


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...