Quantum GIS: the Open-Source Geographic Information System
Loading shapefiles into QGIS is done by clicking the toolbar icon labeled Add vector layer, which looks like a plus sign hovering over a map; it opens a standard open file dialog. By preselecting ESRI shapefile (suffix .shp) from Files of Type, I can be sure I'm opening the right file, which is useful, because a shapefile is actually a bundle of files. As I load each shapefile, it shows up under its original name on the left under the Legend window, which acts as a sort of table of contents.
After unpacking the datasets, I load these five shapefiles in this order: allroads_161v7b.shp (roads), hydro_161v7b.shp (rivers), hydropoly_161v7b.shp (lakes), Washtenaw_Potential_Restoration_Area.shp (the name says it all) and Washtenaw_nlcd_1992.shp (land use).
Unfortunately, upon loading the shapefiles, the sum total map that's displayed on the right in the Map View window looks like a big rectangle covered with random black and green blobs and no lines. Where are the roads, lakes and rivers I loaded? One reason for the odd display and missing elements is that the layers I added first are buried under the county-wide land-use layer, which sits on top of everything else. I can begin to solve this problem by dragging the land-use layer down to the bottom of the Legend and tinkering with the other layers so they all are visible.
The other reason for the strange-looking map is that QGIS defaults to display one color for every characteristic in the shapefile. For the road layer, defaulting to one color is fine, because it is simply a collection of lines. However, layers with thousands of polygons are more complicated. All of the many land-use types default to the same color, thus creating no differentiation among them. I must give each land-use type its own unique color manually. To do so, I first right-click on the land-use entry in the legend and select Properties from the menu. On the Symbology tab, I change the drop-down menu next to Legend type from the default value of Single Symbol to Unique Value. Using the drop-down menu in Classification Field, I can select which field in the database to classify. In my case, I classify a field called GRIDCODE, which contains the code that designates the land-use code for each polygon in the layer.
How do I know which database field I should classify, as well as the meaning of each classification? To find out, I sometimes need to leave the Layer Properties menu and examine the attribute table, a display of the database containing the attribute data for the layer. For example, I can examine the attribute table of the land-use layer by right-clicking on the title in the Legend (on the main GUI) and selecting the command Open attribute table. An example of an attribute table is shown in Figure 2. The land-use attribute layer contains a field ID to designate each polygon, as well as the field GRIDCODE to classify each one. Oftentimes the attribute table also contains a field with the label for each classification. Although such a field is missing from the land-use attribute table, a separate file with classifications is found in a text file included in the downloaded dataset.
After consulting the attribute table and the file containing classifications, I am ready to continue with the classification of the field GRIDCODE back in the Layer Properties menu. Pressing the Classify button populates the window below with the unique classification codes found in the layer. I can label each classification as I wish using the "Label" field, and I can give each classification its own color with the Fill color option.
After finishing the classification, I also want to do some more housekeeping to make the Legend and Map View more useful, such as making the colors of the other layers more intuitive (for example, blue lakes) and thickening the lines designating the roads and rivers. I can carry these out also with the Layer Properties dialog (right-click on layer name→Properties). A right-click on the layer name also gives me the option to change the layer name displayed in the Legend.
Post-housekeeping, the Map View in QGIS finally takes shape. I finally can recognize features such as roads and rivers, and now that the land-use types are differentiated, I easily can tell which areas are urban, agricultural, forested and so on. Figure 3 shows the end result.
To simplify visual analysis on my map, I also applied the same color to similar land-use categories. For instance, I applied the same color to two different agricultural categories as well as three different forest-related ones. For this application, I am interested to know only whether the land use is agricultural or forested, not the specific type of each. Fewer colors makes my map less busy.
James Gray is Products Editor for Linux Journal.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- Stunnel Security for Oracle
- The Firebird Project's Firebird Relational Database
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Google's SwiftShader Released
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide