Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to use QGIS to display solar data from NREL. The file is supposed to provide solar radiation data of Colorado.

However, I have some trouble to select this data in QGIS: In QGIS, I select "Add Vector Layer" and select the shp file. QGIS displays the raster for the information (10 km by 10 km data). All squares have the same color. But I can't see the actual data.

I was always under the impression that the shapefile would also contain the geographical data. Is that correct? Do I need to load any other projection file in QGIS to display the solar radiation per latitude and longitude?

How can I display the NREL data correctly with QGIS?

Thank you for your answer!

share|improve this question

4 Answers 4

Shape files never include visualization of the data. There is always only the geometry and then attributes that corresponds each geometry record. In QGIS you can access the attributes if you right click the layer on left column and select Open attribute table. You should refer to the metadata to know what each column means.

In QGIS you are able to visualize the data based on attributes. Double click the layer and select Style. In your case you probably want to use Graduated style. Select the column you want to show and number of classes. Color ramp Yellow to Red color suits perfect to this problem. Then just click Classify and OK.

Hopefully this helped you some.

share|improve this answer
    
(+1) Welcome to our site, Lauri! –  whuber Feb 12 '12 at 22:55

One of the most important things any GIS user needs to remember is: know your data. You need to have some idea of what it will look like before you start playing with it.

Luckily the dataset you linked to provides a JPEG of the annual solar radiation, so that's a start. Then, loading the shapefile into QGIS shows me that it's in an unprojected WGS84 coordinate system, and that there are several columns of data with values in them. From this, I surmise that DNI01 - DNI12 are monthly data, and DNIANN is the annual average.

Now this data is in a regular grid format which lends itself better to a raster image rather than vector, so GIS tenet number 2 is: know your tools. QGIS is built upon GDAL which is a set of tools and libraries for messing about with geospatial data. In this suite of tools is the useful gdal_rasterize.

I'm going to provide a command line example for converting your vector data into a raster, if you're not comfortable with command line magic, QGIS wraps it up in a nice dialog box.

Anyway, I've run this command:

gdal_rasterize -a DNI01 -tr 0.1 0.1 -ot Float32 -co TILED=YES -a_nodata -9999 -l us9805_dni us9805_dni.shp DNI01.tif

And loaded the image up, and it looks how I expect: Rasterized version of us9805_dni.shp

The two most important things to note are the -a parameter which tells gdal_rasterize which attribute to colour by, and the -tr parameter which tells it the desired resolution. Any smaller and you'll end up with an unnecessarily large file, any larger and you'll lose information.

So, this is month 1's radiation chart, so you can go ahead and create rasters for all the other months you're interested in. From here, you can tell QGIS to colour it with a colourmap - either a built-in one, or one of your own design - by right-clicking the layer and selecting properties...

share|improve this answer

Indeed, this is the basic :

See this video tutorial to understand how to style the map regarding to attributes : http://www.youtube.com/watch?v=gPnp7o_Qcwg

share|improve this answer

If QGIS was just installed and your data is raster then is probable that in the raster properties the option "contrast enhancement" is set to "no stretching" and this causes to see the rasters all grey. Just select "stretch to min/max" and you are good to go. You can save this option, so when you will load new rasters the stretching will be automatically done. When you load a raster for the first time the stats will be computed and saved in a .xml file. This can take a while in large rasters, but subsequent loads of the same image will be lighting fast.

share|improve this answer
    
I just had a look and the data is vector - I reckon its probably lots of little squares. A very inefficient format! I'd probably want to convert it to a true raster format (like geoTIFF) before doing any work on it. –  Spacedman Feb 12 '12 at 12:22
    
sorry, didn't read the question properly. I assumed that he was hitting the no stretching raster problem. –  Giovanni Manghi Feb 12 '12 at 12:25
1  
This data really needs converting to a raster. The sample I downloaded was a 13Mb .shp and a 12Mb .dbf - converting to a raster (with 13 bands) was a tenth that total size. Consequently working with it in Qgis was much much slicker. I used R to do the conversion... –  Spacedman Feb 12 '12 at 13:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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