1

I am new to GIS and I want to do Suitability Analysis for Landfill Site Selection in QGIS. I had a Land-Use map in jpeg format, from which I started by making shapefiles of each kind of input layer such as commercial areas, settlements, agriculture, roads, water bodies etc. Now, I am having problems in rasterizing these shapefiles. I have not yet created any fields in the attribute table as I do not know exactly what is the role of fields in rasterizing. I tried to rasterize by using Raster menu> Conversion> Rasterize. but it produced just a black rectangular layer with nothing on it. Here are the Screenshots of one of the shapefiles and the raster that got created by following above method- Here is the shape file

And this is the raster that was created

  • 1
    Welcome to GIS.stackexchange! You'll get better answers if you edit your post to be more specific. What exactly are the problems you are having? What have you tried so far? And what fields do you want to create? Also, general issues like not having data are unlikely to be something that people here can help with. Check out some tips for asking questions here: gis.stackexchange.com/help/how-to-ask – amball Apr 25 '17 at 7:21
  • Do you need to export the map in raster format? In this case try: Project -> New Print Composer. Read this tutorial: qgistutorials.com/en/docs/making_a_map.html – Mykola Kozyr Apr 25 '17 at 10:03
  • No, I actually want to convert a shapefile to single band raster layer so as to be able to use it for overlay. Anyways, thanks for your help. it was something new I learnt. – Dushyant Singh Rahine Apr 25 '17 at 11:40
2

You need at least one field with a number in the shapefile you want to rasterize. In the process of rasterizing, a value is written in every cell that represents your shape. This value has to come from your attribute table. If you just want a simple 0 / 1 raster as a result, then just add a row with the value 1 in the attribute table of the file you want to rasterize.

You do this by opening the attribute table and clicking the field calculator. Then select New field, enter a name for the field like rast_val. Select integer as field type and enter the number 1 in the expression window below. Click ok.

Now, when you use the Rasterize Tool, choose the attribute field rast_val. Select the other settings as you wish and click ok. Now it should work as expected.

  • I tried this and it worked exactly the way I wanted for most of the layers. However, the result was again just a black rectangle for one layer.Now if I create buffers around my actual area and want that the weight of each buffer zone be different, then is it possible by filling in suitable field values for each buffer zone? And if yes, then how to fill in different valued in field for different buffer zones. – Dushyant Singh Rahine Apr 25 '17 at 16:40
1

I was having the same problem with the result being an all black file. In Properties for the layer, i noticed under Style then Band Rendering that the min value was NaN and max was 0. I edited both values, min to 0 and max to 1. Also, i changed color gradient to white to black. now i can see my layer properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.