官术网_书友最值得收藏!

Accessing raster data

The first data type that we will use is raster data. It might be the most familiar to you, as it resembles traditional images. First of all, let's open QGIS. In the browser panel, we can immediately see our downloaded data if we navigate to our working directory. We can easily distinguish vector data from raster data by their icons. Raster layers have a dedicated icon of a 3x3 pixels image, while vector layers have an icon of a concave polygon:

Don't have a browser panel? You can toggle panels from the View menu's Panels option. If it is displayed, you can dock it anywhere by dragging it out from its current place and placing it in another part of the GUI.

We can drag and drop most of the data from the browser panel or, alternatively, use the Add Raster Layer button from the Add layer toolbar and browse the layer. The browser panel is more convenient for easily recognizable layers as it only lists the files we can open and hides auxiliary files with every kind of metadata. Let's drag one of the SRTM rasters to the canvas (or open one with Add Raster Layer). This is a traditional, single-band raster. It is displayed as a greyscale image with the minimum and maximum values displayed in the Layers Panel:

You can save your project any time with the Save and Save As buttons. The resulting file only contains general data about your current work (for example, paths to your opened layers, styles, and so on) from which you can restore it later. For more information, open a project file in a text or code editor.

As you can see in the preceding screenshot, there is a regular grid with cells painted differently, just like an image. However, based on the maximum value of the data, its colors aren't hard coded into the file, like in an image. Furthermore, it has only a single band, not three or four bands for RGB(A). Let's examine the raster more carefully by zooming in until we can see individual cells. We can also query them for their values with the Identify Features tool by clicking on a cell (raster):

As you can see, we get a number for every cell, which can be quite out of the range of 0-255 representing color codes. These numbers seem arbitrary, and indeed, they are arbitrary. They usually represent some kind of real-world phenomenon, like in our case, the elevation from the mean sea level in meters.

主站蜘蛛池模板: 大悟县| 大姚县| 乳源| 高安市| 大英县| 苍梧县| 德州市| 广昌县| 乌苏市| 垦利县| 密云县| 且末县| 长乐市| 拜城县| 瑞昌市| 库车县| 红桥区| 霍林郭勒市| 科技| 永春县| 象州县| 保德县| 嘉鱼县| 聂荣县| 泽普县| 临猗县| 太谷县| 友谊县| 修武县| 东源县| 德江县| 东城区| 高清| 万宁市| 南汇区| 云和县| 横山县| 新闻| 依兰县| 祁连县| 永德县|