Qgis ex 2

Page 1

QGIS Exercise 2

Working with Vector Data 1. Now click on the Load Vector icon . In the new Add Vector Layer dialog [Directory] should be selected as [Source Type] and [Arc/Info Arc/Info Binary Coverage Coverage] should be selected as [Source Source]. Now click [Browse] and navigate to the directory (GIS DataBase/qgis_sample_data/vmap0_shapefiles/). DataBase/qgis_sample_data/ And click [Open]. [Open]

2. From the next wizard select some shape files (airports, lakes, rivers) and click [Ok].

Page 1 of 13


QGIS Exercise 2 The Vector Properties Dialog Dialog: The Layer Properties dialog for a vector layer provides information about the layer, symbology settings and labeling options. To access the Layer Properties dialog, double doubleclick on a layer in the legend or right-click right on the layer and select elect Properties from the popup menu.

General Tab: The General tab is essentially like that of the raster dialog. There are several options available: •

Change the display name of the layer.

• •

Set a display field to be used for the Map Tips dialog . View or change the projection of the specific vector layer, clicking on Specify CRS. Furthermore you can activate and set Use scale dependent rendering, define provider specific options (as ( stated before).

Page 2 of 13


QGIS Exercise 2 Metadata Tab: The Metadata tab contains general information about the layer, including specifics about the type and location, number of features, feature type, and the editing capabilities. This is a quick way to get information about the layer.

Page 3 of 13


QGIS Exercise 2 Style Tab (Working Working with the Generation Symbology Symbology): 1. Open the Layer Properties dialog of the airports shapefile. 2. Click on the Style tab.

• Single Symbol: The Single Symbol Renderer is used to render all features of the layer using a single user userdefined symbol. You can choose a suitable symbol as well as its properties (size, rotation angle, color, and degree of transparency).

Page 4 of 13


QGIS Exercise 2 • Categorized: The Categorized Renderer is used to render all features from a layer, using a single useruser defined symbol, which color reflects the value of a selected feature’s attribute. Now select the attribute,, symbol, and color ramp. Click [Classify]. Note: you can modify the classes after the automatic classification.

Page 5 of 13


QGIS Exercise 2 • Graduated: The Graduated Renderer is used to render all the features from a layer, using a single user-defined defined symbol, whose color reflects the classification of a selected feature’s attribute to a class. Like Categorized Renderer, it allows to define rotation and size scale from specified columns. Also, you can modify the classes after the automatic classification. c Additionally, you can specify the number of classes and also the mode how to classify features inside the classes (using the Mode list). The available modes are: • Natural Breaks (Jenks) • Equal Interval • Quantile • Standard Deviation • Pretty Breaks

• Rule-based • Point displacement Page 6 of 13


QGIS Exercise 2 Labels Tab: 3. 4. 5. 6. 7.

Open the Layer Properties dialog of the airports shapefile. Click on the Labels tab. Check the Display labels checkbox to enable labeling. Choose the field to label with. We will use Field containing label: NAMES. NAMES Enter a default for lakes that have no name. The default label will be used each time QGIS encounters a lake with no value in the NAMES field. 8. Select the font size, color, the rotation angle, and the placement. 9. If you have labels extending over over several lines, check Multiline labels? 10. Click [Apply]. 11. You can use scale dependent rendering for the labels only as stated before. 12. Click the Buffer Labels checkbox to enable buffering. 13. Choose a size for the buffer using the spin box. 14. Choose a color by clicking clicking on [Color] and choosing your favorite from the color selector. You can also set some transparency for the buffer if you prefer. 15. Click [Apply] to see if you like the changes.

Page 7 of 13


QGIS Exercise 2 Advanced New Labeling: Labeling The new Labeling core application provides smart labeling for vector point, line and polygon layers and only requires a few parameters. This new application will replace the current QGIS labeling, described in section Labels Tab. 1. Load a vector point, line or polygon layer. 2. Activate the layer in the legend and click on the Labeling icon toolbar menu.

in the QGIS

Page 8 of 13


QGIS Exercise 2 Fields Tab: Within the Fields tab the field attributes of the selected dataset can be manipulated. The buttons New Column editing mode

and Delete Column

can be used, when the dataset is

.

The edit widget column can be used to define values or a range of values that are allowed to be added to the specific attribute table column. If you click on the [edit widget] button, a dialog opens, where you can define different widgets. These widgets are: 1. Line edit: an edit field which allows entering simple text (or restricting to numbers for numeric attributes). 2. Classification: Displays a combo box with the values used for classification, if you have chosen ‘unique value’ as legend type in the Style tab of the properties dialog. 3. Range: Allows setting numeric values from a specific range. The edit widget can be either a slider or a spin box. 4. Unique values: 5. File name: 6. Value map 7. Enumeration: 8. Immutable: The immutable attribute column is read read-only. only. The user is not able to modify the content. 9. Hidden: A hidden attribute column is invisible. The user is not able to see its content. 10. Checkbox: 11. Text edit: 12. Calendar: Opens a calendar widget to enter a date. Column Column type must be text. 13. Value Relation: 14. UUID Generator:

Page 9 of 13


QGIS Exercise 2 Action Tab: QGIS provides the ability to perform an action based on the attributes of a feature. This can be used to perform any number of actions, for example, running a program with arguments built from the attributes of a feature or passing parameters to a web reporting tool. As an exercise we create an action that does a Google search on the name of the airport. airport 1. Open the Layer Properties dialog and click on the Actions tab. 2. Enter a name for the action, for example “Google Search�. 3. For the action, we need to provide the name of the external program to run. You need to provide the full path of your browser. 4. Following the name of the external application, add the URL used for doing a Google search, up to but not included the search term. 5. The text in the Action field should now look like this: "C:\Program Files\...................\iexplore.exe" iexplore.exe" [Space] https://www.google.com.eg/#hl=ar&tbo=d&q= 6. From the drop-down down box, select Field containing label: NAME and click [Insert Field]. 7. Your action text now looks like this: "C:\Program Files\...................\iexplore.exe" iexplore.exe" [Space] https://www.google.com.eg/#hl=ar&tbo=d&q= [% "NAME" %] 8. To finalize the action click the [Insert action] button.

Page 10 of 13


QGIS Exercise 2 We can now use the action. Close the Layer Properties dialog and zoom in to an area of interest. Make sure the “airports” layer is active and identify an airport. In the result box you’ll now see that our action is visible. When we click on the action, it brings up your browser and navigates to the search URL.

You can define multiple actions for a layer and each will show up in the Identify Results dialog.

Page 11 of 13


QGIS Exercise 2 Diagrams Tab: The Diagrams tab allows you to add a graphic overlay to a vector layer. layer 1. Now click on the Load Vector icon and browse to the QGIS sample dataset folder and load the two vector shape layers alaska.shp and climate.shp. 2. Double click the climate layer in the map legend to open the Layer Properties dialog. Click on the Diagrams tab, activate Display diagrams and select Text diagram as Diagram type. 3. Placement could be set to AroundPoint. 4. In the diagram we want to display the values of the three columns T_F_JAN, T_F_JUL and T_F_MEAN. First select elect “T_F_JAN� as Attributes and click the green [+] button, then T_F_JUL and finally T_F_MEAN. 5. Now click [Apply] to display the diagram in the QGIS main window. 6. You can now adapt the chart size, or change the attribute colors by double clicking on the color values in the attribute field. 7. Finally click [Ok].

Page 12 of 13


QGIS Exercise 2 8. Repeat all steps above but change the Diagram Type to be “Pie Chart”.

Page 13 of 13


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.