diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 858d4d637..000000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml new file mode 100644 index 000000000..f303ef9d3 --- /dev/null +++ b/.github/workflows/deploy-book.yml @@ -0,0 +1,42 @@ +name: deploy-book + +# Only run this when the master branch changes +on: + push: + branches: + - main + # If your git repository has the Jupyter Book within some-subfolder next to + # unrelated files, you can make this run only if a file within that specific + # folder has been modified. + # + # paths: + # - some-subfolder/** + +# This job installs dependencies, builds the book, and pushes it to `gh-pages` +jobs: + deploy-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Install dependencies + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + pip install -r requirements.txt + + # Build the book + - name: Build the book + run: | + jupyter-book build . + + # Push the book's HTML to github-pages + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3.6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html diff --git a/content/.DS_Store b/content/.DS_Store index c72f70803..f0c137fab 100644 Binary files a/content/.DS_Store and b/content/.DS_Store differ diff --git a/content/Modul_1/en_qgis_installation.md b/content/Modul_1/en_qgis_installation.md index 6978ecb2a..77610459d 100644 --- a/content/Modul_1/en_qgis_installation.md +++ b/content/Modul_1/en_qgis_installation.md @@ -5,6 +5,10 @@ QGIS is open source and therefore freely available to everyone at no cost. You c For our introduction, the standalone installers from OSGeo4W packages are sufficient for Windows. +#### QGIS tutorial: QGIS 3.28 - installation and basic setup + +[![QGIS 3.28 - installation and basic setup](/fig/image_QGIS_3.28_download.png)](https://www.youtube.com/watch?v=tSJMT96HsAo) + ## Windows ### 32 Bit or 64 Bit? diff --git a/content/Modul_1/en_qgis_start.md b/content/Modul_1/en_qgis_start.md index abed729c8..ac52eb6e1 100644 --- a/content/Modul_1/en_qgis_start.md +++ b/content/Modul_1/en_qgis_start.md @@ -1,8 +1,11 @@ # Getting started with QGIS -## Intro QGIS concept +**Competences:** -### What is QGIS? +- What is QGIS? +- Introducing QGIS: Interface and further basic functionalities + +## What is QGIS? QGIS is an __open source geoinformation system software__. That means the source code is available for everyone, making QGIS a free application. You may __view, edit, capture and analyze spatial data or create printable maps__ with it. QGIS was created in 2002 and is a project of volunteers. And it is __constantly changing__. @@ -20,7 +23,7 @@ User interface 1. __Layers List / Browser Panel:__ The __layers list__ shows __all layers/files__ that are __loaded in the project__. You can show/hide layers and set other properties. -2. __Toolsbars: __ __Toolbars__ are shortcuts__ to execute frequently used commands. For example, there are special toolbars for __vector and raster files__, but also general ones for saving your project, etc. The toolbar contains, among other things, a list of all the commands you can use. The toolbar also contains the __toolbox__, which is used later in many of the wiki videos. +2. __Toolsbars: __Toolbars__ are shortcuts__ to execute frequently used commands. For example, there are special toolbars for __vector and raster files__, but also general ones for saving your project, etc. The toolbar contains, among other things, a list of all the commands you can use. The toolbar also contains the __toolbox__, which is used later in many of the wiki videos. @@ -37,9 +40,10 @@ Toolbox 6. __Locator bar__. Here you can __search for tools and layers__. If you don't know where to find a tool, you can try here. -```{Tip} -Exercise: Create a new QGIS project -``` + + +> **Exercise: Create a new QGIS project** + - In your “GIS_Training” folder, create a __subfolder__ called __“Projects”__ - Open __QGIS__ - Click on __New Empty Project__ diff --git a/content/Modul_1/en_qgis_theorie.md b/content/Modul_1/en_qgis_theorie.md index 10fa4b4f1..f010308a5 100644 --- a/content/Modul_1/en_qgis_theorie.md +++ b/content/Modul_1/en_qgis_theorie.md @@ -1,5 +1,15 @@ # What is GIS? (Theory) +**Competences** + +- General Information +- Why are Spatial Analyses important? +- Introduction to GIS +- A Galaxy of Tools +- Paper Maps and Cartography +- GIS vs Cartography +- Web GIS Platforms + ## General Information: - A Geographic Information System (GIS) is a __digital system that connects data to maps__. @@ -12,13 +22,11 @@ ## Why are Spatial Analyses important? -```{Note} -Discuss in groups: -``` +> **Discuss in groups** +- Situations in which you benefitted from spatial analyses. +- Situations in which you could may be have benefitted from spatial analyses. +- Main areas where you see potential for spatial analyses in your work. - - Situations in which you benefitted from spatial analyses. - - Situations in which you could may be have benefitted from spatial analyses. - - Main areas where you see potential for spatial analyses in your work. ## Introduction to GIS: @@ -39,10 +47,10 @@ GIS has many applications in the __humanitarian field__: - Support security decisions - Support operations planning - Identify areas most affected by disasters - -```{Tip} -A few examples: -``` + + + +> **A few examples:** - [REACH Initiative](https://www.reachresourcecentre.info/search/) - [World Food Programme (WFP)](https://hungermap.wfp.org/) @@ -56,24 +64,15 @@ GIS comes with a __galaxy of tools__ that are constantly evolving. An increasing ### An Overview: -- __Mobile Data Collection Tools__ - -The latter make it possible to collect data via mobile or tablet, and often to visualize and exchange it with other platforms according to a common format. - -- __Mapping Tools__ - -These tools provide a simple vizualisation of geographic data, and allow for the production of maps. +| Name | Description | +| --- | --- | +| Mobile Data Collection Tools |The latter make it possible to collect data via mobile or tablet, and often to visualize and exchange it with other platforms according to a common format.| +| Mapping Tools | These tools provide a simple vizualisation of geographic data, and allow for the production of maps.| +|GIS Tools| As opposed to the previous ones, these more advanced tools are very comprehensive and allow for advanced analyses to be carried out on the geographical components of data.| +| Webmapping Tools|These tools make it possible to manipulate and create maps online in a very simple way directly in a web browser. | -- __GIS Tools__ -As opposed to the previous ones, these more advanced tools are very comprehensive and allow for advanced analyses to be carried out on the geographical components of data. - -- __Webmapping Tools__ - -These tools make it possible to manipulate and create maps online in a very simple way directly in a web browser. - - -## Paper Maps and Cartography + ## Paper Maps and Cartography ### What is Spatial Analysis? @@ -82,7 +81,9 @@ These tools make it possible to manipulate and create maps online in a very simp - Data can be __added to a map as layers and they can interact with each other__. - GIS enables you to work with these __layers__ to explore critically important questions and __find answers__ to those questions. -#### An Example from the Past: John Snows' Cholera Map + + +> **An Example from the Past: John Snows' Cholera Map** In 1854 an __outbreak of cholera__ occurred in London, England. The most common theory was that the disease was spread through the air. Dr.John Snow believed that the danger was __in the water__. He made a map to analyse the __number of deaths__ in Soho per house block. He added the __location of water pumps__ on the map. He found a __correlation__ between one specific water pump and the number of infections. @@ -93,10 +94,10 @@ __Dr. Snow's map of the Cholera outbreak of 1854__, and the reports that it acco __Using GIS__, several measures of spatial central tendency have been applied to the dataset, revealing that the Spatial Mean (the geographic center of the distribution of deaths) of the outbreak lies __within 35 meters of the Broad Street Pump__, identified as the __source of contamination__ in the 1854 outbreak. + + +> **Further information**: -```{Tip} -Further information: -``` - [Let’s explore John Snow’s map](https://www.arcgis.com/apps/PublicInformation/index.html?appid=d7deb67f810d46dfacb80ff80ac224e9) ## GIS vs Cartography diff --git a/content/Modul_2/en_qgis_geodata_concept.md b/content/Modul_2/en_qgis_geodata_concept.md index 539bb388a..593978da9 100644 --- a/content/Modul_2/en_qgis_geodata_concept.md +++ b/content/Modul_2/en_qgis_geodata_concept.md @@ -45,9 +45,9 @@ You can find all the projections and their CRS code at this [website](http://eps To change the projection of a **vector file**, click on *Vector*, *Data Management Tools*, *Reproject Layer*. Select your input layer and the target crs. Click on the three dots to *Save to File...* and click *Run*. For a detailed instruction click on this video. - + -To change the projection of a **raster file**, clickclick on *Raster*, *Projections*, *Warp (Reproject)*. Choose your input layer and target crs. Click on the three dots to *Save to File...* and click *Run*. For a detailed instruction click on this video. +To change the projection of a **raster file**, clickclick on *Raster*, *Projections*, *Warp (Reproject)*. Choose your input layer and target crs. Click on the three dots to *Save to File...* and click *Run*. For a detailed instruction click on this video. It is crucial that you are aware of the difference in data projection and project projection. They should always be the same, or else you will get wrong results! You can change the data projection by following the steps explained above. The project projection is on the bottom left corner, as seen [here](../../fig/en_QGIS_User_Interface.png). diff --git a/content/Modul_4/en_qgis_map_design_2.md b/content/Modul_4/en_qgis_map_design_2.md index 9aed03dc9..5925e5240 100644 --- a/content/Modul_4/en_qgis_map_design_2.md +++ b/content/Modul_4/en_qgis_map_design_2.md @@ -56,7 +56,17 @@ name: Add a new map --- Adding a new map to the Print Layout ``` - +:::: {tab-set} +::: {tab-item} Adding a new map + +::: + +::: {tab-item} Moving and scaling the map + +::: +:::: ### Adding a title or a text box A title should describe the phenomenen represented on the map. @@ -64,8 +74,6 @@ A title should describe the phenomenen represented on the map. - To add text (title, explanations), use the __Add Label__ tool and draw a rectangle of the desired size. - In the __Item Properties__ panel (on the right of your screen) you can __enter your text__ and __change the font, style, colour, etc.__ (_Remember to use the scroll bar in the window to see all the options). - - ```{figure} ../../fig/en_30.30.2_print_layout_add_text.png --- width: 750px @@ -73,6 +81,12 @@ name: Add text to the print layout --- Adding text to the print Layout ``` + + +### Adding an image + +VIDEO ### Adding a legend @@ -95,6 +109,22 @@ Adding a legend to the print layout In the __item properties__ panel, if you keep the __'Auto update'__ option checked, new layers added to your project will automatically be added to the legend but you cannot control them individually (rename if necessary, reorder ot remove items). Once the option is unchecked, you can update the name of the layers, group them, reorganise them, etc. +:::: {tab-set} +::: {tab-item} Adding a legend + + + +::: + +:::{tab-item} Editing the legend + + + +::: +:::: + ### Adding a scale bar Before adding a scale bar, select your main map and check in the __Item Properties__ panel that the __Scale__ fielld has a __round number__ @@ -126,6 +156,9 @@ name: Add scale bar Add and customize the scale bar ``` + + ### Adding an overview map Adding an overview map in the corner of your map will help locate the area you are viewing on the main map. @@ -169,19 +202,33 @@ Add a the extent of the main map to your overview map (the red rectangle on the ``` ``` {Caution} -This method requires you to be sure that you are not going to modify the oveview map, as once the layers are locked, they will keep the style, and any updates will not affect the overview map +This method requires you to be sure that you are not going to modify the oveview map, as once the layers are locked, they will keep the style, and any updates will not affect the overview map. ``` +## Exporting the print layout + +Once you are finished with the map composition, it is time to export export the print layout as a PDF or SVG file. + +1. On the Toolbar click on the `Export as PDF`-button. +2. Give the new file a name and select the location you want to save it. +3. Click on `Save`. +4. A new window "PDF Export Options" will open. Here you can adjust the compression algorithm. For the best results, select the lossless image compression. +5. Click `Save` again. +6. A new green bar will pop up underneath the toolbars. Click on the file link to __review the exported map__. + +```{note} +Make sure to check the map after exporting the PDF as some design elements might have changed in the exporting process. +``` # Good practices and common mistakes in mapping In order to produce good maps, there are some __basic rules__ to follow and common __semiological mistakes__ to avoid. -### Map composition +## Map composition -#### Key elements of a map +### Key elements of a map -A map is never complete without the following elements: +A map is __never complete without the following elements__: - Title - Legend - Scale @@ -237,7 +284,7 @@ name: scale bar --- A scale bar ``` -__Orientation__ +### Orientation Even if by default the majority of the maps are oriented to the North, it is still necessary to specify the orientation of the map. It is often indicated by an arrow to the North. Sometimes the orientation of different in order to optimize the representation of the study area on the map. @@ -248,9 +295,9 @@ Any data represented on a map should have its sources indicated. This provides a It is possible to give the source of each data under the legend, or to do it in a dedicated space in the map. The level of precision of the sources varies according to the author or the precision of the data. -### The 4 semiological errors +## The 4 semiological errors -#### 1. Proportional circles vs. solid colors +### 1. Proportional circles vs. solid colors ```{caution} DO NOT represent __quantitative__ stock character/data with a __solid color__. @@ -263,9 +310,10 @@ It is a mistake because: - You lose the __order relationship between the data__ (a circle can be twice as big as another one, a color cannot be "twice as dark") - Countries with a large surface area stand out visually (eg.: Russia in the example below) - We are trying to represent __data that has nothing to do with the area of a country__, but rather speaks of individual elements + >Add different example -#### Color gradient vs. distinct color palette +### 2. Color gradient vs. distinct color palette ```{caution} DO NOT use a __separate__ color palette to represent __ordered entities__ @@ -276,7 +324,7 @@ It is a mistake because: - By using a differentiating color variable, __you lose the ordinal relationship between entities__. Instead, a __gradient of the same color__ that should be used. - Different colors are used to differentiate between distinct entities. -#### Gradient in a single color vs. Gradient between two colors +### 3. Gradient in a single color vs. Gradient between two colors ```{Caution} DO NOT use a gradient across two colors for an always positive data. ``` @@ -291,7 +339,7 @@ It is a mistake because: - The map will send a message of divergence, of opposition between certain values, when we are simply trying to represent a hierarchy between values - In this way, the color itself directly indicates information about the trend (positive/negative or increasing/decreasing). -#### Limited geometric symbols vs. complex icons and symbols +### 4. Limited geometric symbols vs. complex icons and symbols ```{Caution} DO NOT use __too many symbols__ in a thematic map ``` diff --git a/content/Modul_4/en_qgis_map_design_I.md b/content/Modul_4/en_qgis_map_design_I.md index 33c2bb24e..b0629ad43 100644 --- a/content/Modul_4/en_qgis_map_design_I.md +++ b/content/Modul_4/en_qgis_map_design_I.md @@ -2,6 +2,8 @@ The representation of geodata in maps is crucial in order to provide useful location-based insights. This subchapter will cover the basics of good map design, how to create a map design in QGIS as well as common mistakes when designing or interpreting maps. +>Overview? + ## Types of maps In general, there are two main types of maps: __topographic maps__ and __thematic maps__. @@ -82,6 +84,8 @@ align: left Styling panel in QGIS 3.30.2 ``` + + For each layer in QGIS, there is a styling panel where you can change the symbology, colour and label for the features in that layer. There are two ways to open the layer styling options in QGIS: 1. Right click on the layer you wish to style and select properties 2. Open the layer styling panel by enabling it under "View">"Panels">"Layer Styling" @@ -90,6 +94,9 @@ On the left of the styling panel you can choose the different tabs to access dif In the styling panel you can change the styling for all features of a layer, set up categories for different symbols, create labels, and create colour ramps to differentiate between features with variable values. + + + ## Symbology - Symbology is used to change the look of features on a map @@ -100,8 +107,7 @@ In the styling panel you can change the styling for all features of a layer, set ## Colours -Colours are arguably the most striking visual variables as they are easily disinguishable. However, depending on the type of data and the information you wish to convey, there are a few things to consider when choosing a colour scheme for your map. The most important variables for colours are the __hue__ and the __value__ (saturation, transparency). -> look for correct words +Colours are arguably the most striking visual variables as they are easily disinguishable. However, depending on the type of data and the information you wish to convey, there are a few things to consider when choosing a colour scheme for your map. The most important variables for colours are the __hue__, the __value__ (saturation) and the __transparency__. Colours schemes can be __categorial, sequential, or diverging__. If you wish to display different types of buildings or roads, the colour schemes should be categorial. Colour gradients, either sequential or diverging, are used for numerical data or data that can be ordered. For example, for the population sizes of districts a sequential colouring schemes is best to show the relative difference between the values. However, if the data has positive __and__ negative values, a diverging colour gradient should be used. @@ -123,7 +129,7 @@ width: 800px Examples for different colour gradients translated into black and white. Pay attention to the saturation gradient ``` -- Colour gradients can also encompass multiple hues +Colour gradients can also encompass multiple hues: ```{figure} ../../fig/Colour_Gradients_2.png --- @@ -159,7 +165,9 @@ width: 750px Symbolization for vector data; Source: White, T. (2017). Symbolization and the Visual Variables. *The Geographic Information Science & Technology Body of Knowledge (2nd Quarter 2017 Edition), John P. Wilson (ed.). DOI: 10.2222/gistbok/2017.2.3 ``` -In the dropdowns below you can find examples on how to set up common vector data styling. +In the dropdowns below you can find examples on how to set up common vector data styling. Make sure you have downloaded the Exercise XX data from the github repository if you want to follow along! + +>Link the files and github repository :::{dropdown} Exercise: Only display the outlines of polygons @@ -174,14 +182,18 @@ To change the symbology of a single layer: ```{figure} ../../fig/en_30.30.2_vector_layer_styling_transparent.png --- name: layer styling transparent +width: 500 px --- ``` + + ::: :::{dropdown} Change the styling for multiple overlayed layers ->This is exercise 7 in the PPP. Participants will need the specific data. +>This is exercise 7 in the PPP. Participants will need the specific data. + In this exercise, we will apply the same style to all features in a layer, but we will change multiple layers and overlay them so each is visible in a different style. We have the polygons for 3 administrative levels. ```{figure} ../../fig/en_30.30.2_changing_layer_style_1.png @@ -213,6 +225,9 @@ Change the Fill type 8. __Repeat the same process__ for the Adm1 layer, using the same colour as for Adm0 (it will be in "Recent colors) and leave the stroke width at 0.26. 9. Now we can see the boundaries of the country and its states, and behind that we cann see the districs (Adm2). 10. Let's make the districs layer's style consistent with the others. + +

+ 11. Choose a __Fill Color__ 12. Use the same __Stroke color__ as for Adm0 and Adm1, but make the width 0.1 Millimeters and the Stroke Style a __Dash Line__ 13. Click OK and look at yout map: hopefully it's starting to look nicer! @@ -224,6 +239,9 @@ name: change layer style 3 The styling of a vector data consists of the colour and the outline ``` + + ```{note} Remember that __the layer's symbology is saved within your project file, not within your shapefile!__ If you share a shapefile with a colleague, it will have a different style when they add it to their own project. ``` @@ -232,6 +250,14 @@ Remember that __the layer's symbology is saved within your project file, not wit :::{dropdown} Use different styles in a single layer +```{note}For this exercise, you must have convertet the excel-spreadsheet "ACLED_Nigeria_2022-2023" into a .csv-file. Read how you can do this [here](/gis-training-resource-center/content/Modul_2/en_qgis_basic_data_processing.html#delimited-text-import). + +>Check if the others have the same issue with importing the .csv file (excel export as csv delimits with ";" instead of ",". QGIS expects ",", if you replace all the ";" with "," the coordinates do not work any longer because the degree are delimited with a "," as well. You can fix it in VSC) +``` + + + We can use symbology to __show the difference between features__ in the same layer. For example, it could be different types of buildings, quantities of Covid cases by district, or types of roads. We can choose a specific attribute of a dataset to assign different colors, outlines, or sizes to features: 1. From your shapefile folder, __drag te ACLED security incidents shapefile onto your map__ @@ -274,14 +300,18 @@ Regions affected by explosions in Nigeria ``` ::: -:::{dropdown} Style data based on variable ranges +:::{dropdown} Style data based on variable ranges (graduated styling) + If a layer contains numeric values that are continuous, they can be organized in intervals. These intervals can be displayed in graduated colours. In this exercise, we assign colours to Adm1 polygons based on the total population of each State. > Don't forget to check that they have access to the data -1. From __Sharepoint__, download the NGA_Adm1_Pop shapefile and save it in your shapefile folder + + +1. Download the NGA_Adm1_Pop shapefile [link!!] and save it in your shapefile folder 2. In QGIS, turn off the Adm1 and Adm2 layer, leaving only Adm0 -3. Drag the shapefile you just downloaded into your map +3. Drag the shapefile NGA_Adm1_Pop into your map 4. Open its Symbology options and choose "__Graduated__" 5. Select the value you want to use to assign colours, in this case, it will be "__population__" @@ -307,41 +337,17 @@ width: 500px You can categorize the continuous values into classes and assign a colour ramp ``` -The following map shows the most populated States of Nigeria using a graduated colour categorization. +The following map shows the most populated States of Nigeria using a graduated colour categorization. These types of maps are called __Coropleth maps__. ```{figure} ../../fig/en_map_design_example_variable_ranges.png --- name: map design example_state population Nigeria width: 500px --- -An unfinished map showing the population of Nigerian states +A map showing the population of Nigerian states ``` ::: -## Symbology for raster data - -As we have already learned, raster data are basically a grid of pixels with different (numerical) values. As such, you can't style the shape, fill or outline of raster data. It is only possible to assign colours to the different values of the pixels. - -### Assigning a colour gradient to raster data - -To assign a colour gradient for raster data, you need to: - -1. Open the styling panel for the raster layer -2. Navigate to the Symbology tab -3. By default, the colour scheme is set to Singleband gray (if you only have one colour band in the data set). Click on __Singleband gray__ and switch to __Singleband pseudocolour__ -4. Click on the arrow to the right of the colour ramp. Here you can choose a premade colour ramp -5. You can modify the colour ramp by clicking on the colour ramp itself - -``` {figure} ../../fig/en_30.30.2_raster_data_colour_gradient.png ---- -name: raster data colour gradient -width: 600px ---- -Colour Ramp Selector -``` - -In the colour ramp selector, you can adjust each colour step. On the bottom, you can see a plot for the Hue, __Saturation__, __Lightness__ and __Opacity__. Especially latter three are useful to see how your colour ramp will translate. - ## Labels - Labels are text that show a specific attribute of features. @@ -354,33 +360,34 @@ In the colour ramp selector, you can adjust each colour step. On the bottom, you 1. In the styling panel, click on the "Labels" tab. 2. Select *Single Labels*. -3. "Value" is where you choose the attribute that will be displayed as a label. For example "NAME". This will display the "NAME" attribute for each feature. In the example (figure X), *ADM1_EN* will display the English names of Nigerian states. ->change figure number +3. `"Value"` is where you choose the attribute that will be displayed as a label. For example `*ADM1_EN*` will display the English names of Nigerian states for each feature in the data set. 4. Let's change the font: make it Arial, bold, dark grey, 8 pt 5. Let's add a white buffer around the label. 7. Click Apply and Ok. ```{figure} ../../fig/en_30.30.2_setting_up_labels.png --- -width: 750px +width: 500px name: Setting up labels --- Setting up labels in QGIS 30.30.2 ``` + + ::: :::{dropdown} Adding different label styles to the same layer ->This is exercise 3 in PPP Sometimes you will need to create two different label styles for different features of a single layer. In this example, we will create one label style for the *Country Capital*, and another one for the *State Capitals* -1. Open the styling panel and click on the Labels tab +1. Open the styling panel for the `"NGA_settlements_nga"` layer and click on the Labels tab 2. Select __Rule-based Labeling__ 3. Click on the __Add Rule__ button at the bottom (the "+"-sign) and create the first rule 4. For __Value__, select __"NAME"__ (so that the labels will show the name of each city), then click on the "ε"-button next to the "Filter" bar. -```{figure} ../../fig/en.30.30.2_adding_rule-based_labels.png +```{figure} ../../fig/en_30.30.2_adding_rule-based_labels.png --- width: 500px name: adding rule-based labels @@ -388,9 +395,9 @@ name: adding rule-based labels To add rule-based labels, you need to enter an expression ``` -5. In the central column, expand ==__Fields and Values__== to display a list of all the fields in your layer and double-click on _Class__ to add it to the expression frame on the left. -6. In the right column, click on __All unique__ to list all unique values contained in the Class field -7. Click on the "`=`" operator, then doube-click on the _value 1_ (which represent the Country capital in this case). Click OK. +5. In the central column, expand __Fields and Values__ to display a list of all the fields in your layer and double-click on __Class__ to add it to the expression frame on the left. +6. In the right column, click on __All unique__ to list all unique values contained in the Class field. In this dataset, `"CLASS"=1` designates the capital city, whereas `"CLASS"=2` designate other major cities. +7. Click on the `"="` operator, then doube-click on the _value 1_ (which represent the Country capital in this case). Click OK. 8. Scroll down to *change the label style*. Make it Arial, bold, black, 12pt and add a white buffer. 9. Repeat steps 4 to 9, but select *Value 2* (State capitals) and make the label black, bold, 10pt, no buffer. 10. Click **Apply**, the OK. @@ -402,13 +409,19 @@ name: rule-based labels expression builder --- The expression builder: Expression (left); building blocks, operators, fields and values(center); unique values (right) ``` + + ::: -:::{dopdown} Add underligned labels +:::{dropdown} Add underligned labels 1. Set up the labels by following the same steps as before. 2. TO underlign labels, click on the underlign-button + + ::: :::{dropdown} Move labels independently @@ -416,13 +429,53 @@ Sometimes the placement of labels is not ideal and can obstruct the readability 1. On the label toolbar, there is an option to move labels independently. Click on it to activate it. (Note: In some cases, the label toolbar might not be visible. In this case, turn it on by navigating to "View">"Toolbars">activate the Label toolbar) 2. Click on the label you want to move. -3. You will be prompted to select the primary key for joining with internal data storage. You do not need to change it, or select the ID of the feature and click on OK. +3. You will be prompted to select the primary key for joining with internal data storage. You do not need to change it (you can select the ID field of the dataset) and click OK. 4. Click on the label again, now you can move it freely. + + ::: :::{dropdown} Add labels to roads >When working with line features, the labels will align themselves parallel to the line representing the feature. ->VIDEO + + ::: + +## Symbology for raster data + +As we have already learned, raster data are basically a grid of pixels with different (numerical) values. As such, you can't style the shape, fill or outline of raster data. It is only possible to assign colours to the different values of the pixels. + +### Assigning a colour gradient to raster data + +To assign a colour gradient for raster data, you need to: + +1. Open the styling panel for the raster layer +2. Navigate to the Symbology tab +3. By default, the colour scheme is set to Singleband gray (if you only have one colour band in the data set). Click on __Singleband gray__ and switch to __Singleband pseudocolour__ +4. Click on the arrow to the right of the colour ramp. Here you can choose a premade colour ramp +5. You can modify the colour ramp by clicking on the colour ramp itself + +``` {figure} ../../fig/en_30.30.2_raster_data_colour_gradient.png +--- +name: raster data colour gradient +width: 600px +--- +Colour Ramp Selector +``` + +In the colour ramp selector, you can adjust each colour step. On the bottom, you can see a plot for the Hue, __Saturation__, __Lightness__ and __Opacity__. Especially latter three are useful to see how your colour ramp will translate. Gradients from light to dark are easier to read: Check if the plot for the __Lightness__ has a more or less linear plot. + +>Examples Video! and how to invert ramp + + +# Exporting and Importing Styles + +As we have already learned, the layers in QGIS are saved separately from the settings and styles of a QGIS Project. Therefore, it can be useful to + +# Examples for Map design + +>insert maps and discuss how to achieve this \ No newline at end of file diff --git a/content/Modul_4/en_qgis_map_design_I_ex1.md b/content/Modul_4/en_qgis_map_design_I_ex1.md index acaddd7ef..e69de29bb 100644 --- a/content/Modul_4/en_qgis_map_design_I_ex1.md +++ b/content/Modul_4/en_qgis_map_design_I_ex1.md @@ -1,136 +0,0 @@ -# Map design Exercise 1 - - -### Exercise: Change the symbology of a layer ->This is exercise 7 in the PPP. Participants will need the specific data. - -In this exercise, we will apply the same style to all features in the layer. We have the polygons for 3 administrative levels - -1. Add the "Adm0", "Adm1" and "Adm2" shapefiles to your Session 2 project. -2. Order the layers so they are all visible: Put the Adm2 at the bottom, then the Adm1 then Adm0. At first, this might look weird because Adm0 will cover everything. -3. Change the symbology of the Adm0 layer by opening the stlying panel and navigating to the Symbology tab. By default, the symbology type will be __Single Symbol__. This means that the same colours and contours will be applied to all the features in that layer. - -```{figure} ../../fig/en_30.30.2_changing_layer_style_1.png ---- -name: change layer style 1 -height: 400px -align: left ---- -Order the layers and navigate to the styling panel of the topmost layer -``` -```{figure} ../../fig/en_30.30.2_changing_layer_style_2.png ---- -name: change layer style 2 -width: 300 px -align: right ---- -Change the "Simple Fill" -``` - -4. Click on "__Simple Fill__" to open the style options. -5. Expand the "__Fill Color__" menu and check the __Transparent Fill__ option. This will make only the boundaries visible, so __we will be able to see the layer under this one__. -6. Choose a __Stroke color__, and make the __Stroke width__ 0.66 Millimeters. -7. Click OK - -```{figure} ../../fig/en_30.30.2_changing_layer_style_3.png ---- -name: change layer style 3 ---- -The styling of a vector data consists of the colour and the outline -``` - -8. __Repeat the same process__ for the Adm1 layer, using the same colour as for Adm0 (it will be in "Recent colors) and leave the stroke width at 0.26. -9. Now we can see the boundaries of the country and its states, and behind that we cann see the districs (Adm2). -10. Let's make the districs layer's style consistent with the others. -11. Choose a __Fill Color__ -12. Use the same __Stroke color__ as for Adm0 and Adm1, but make the width 0.1 Millimeters and the Stroke Style a __Dash Line__ -13. Click OK and look at yout map: hopefully it's starting to look nicer! - -```{note} -Remember that __the layer's symbology is saved within your project file, not within your shapefile!__ If you share a shapefile with a colleague, it will have a different style when they add it to their own project. -``` - -### Exercise: Use different styles in a single layer - -We can use symbology to __show the difference between features__ in the same layer. For example, it could be different types of buildings, quantities of Covid cases by district, or types of roads. We can choose a specific attribute of a dataset to assign different colors, outlines, or sizes to features: - -1. From your shapefile folder, __drag te ACLED security incidents shapefile onto your map__ -2. Open the layer __Symbology__ and choose __Categorized__ instead of Single Symbol. -> Categorized symbology is used when you have ***discrete*** variables. -```{figure} ../../figure/en_30.30.2_categorized_layer_symbology_1.png ---- -name: categorized layer symbology 1 -width: 500px ---- -Change the symbology type to "categorized" and choose the Value (variable) you wish to display -``` - -3. Now we need to __choose which attributes we want to display through the symbology__. In this case, it could be the number of casualtiees, or the actor who perpetrated the act. Let's categorize the features by **event_type** -4. Click on __"Classify" to list all the unique values contained in the event_type field__ (i.e. all the possible types of security incidents recorded in our table) -5. Now we can __change the style of each single value__ -6. Double click on Explosions -7. At the bottom of the __Symbol selector__ window, choose a symbol to make Explosion points stand our -8. Click on OK, then Apply to preview what the layer will look like -9. Click OK again - -``` {figure} ../../fig/en_30.30.2_categorized_layer_symbology_2 ---- -name: categorized layer symbology 2 -width: 500 px ---- -By double clicking on the __unique values__ in the classified list, you can change the symbol for each value -``` - -Now we have a map of Nigeria where you can locate the areas, that are affected by explosions more than others. On the map below, we also added text labels, which will be explained below. - -``` {figure} ../../fig/en_exercise_map_design_example_Nigeria.png ---- -name: map design example regions affected by explosions in Nigeria -width: 500px ---- -Regions affected by explosions in Nigeria -``` - -### Exercise: Style data based on variable ranges - -If a layer contains numeric values that are continuous, they can be organized in intervals. These intervals can be displayed in graduated colours. In this exercise, we assign colours to Adm1 polygons based on the total population of each State. - -> Don't forget to check that they have access to the data - -1. From __Sharepoint__, download the NGA_Adm1_Pop shapefile and save it in your shapefile folder -2. In QGIS, turn off the Adm1 and Adm2 layer, leaving only Adm0 -3. Drag the shapefile you just downloaded into your map -4. Open its Symbology options and choose "__Graduated__" -5. Select the value you want to use to assign colours, in this case, it will be "__population__" - -``` {figure} ../../fig/en_30.30.2_symbology_variable_ranges_1.png ---- -name: symbology of variable ranges 1 -width: 500px ---- -With variable ranges, select __Graduated__ symbology and choose the attribute with continuous values -``` - -6. Click on __Classify__ to list all valued, divided in classes -7. Choose __how many classes__ you want the data to be divided into ‒ let's say 4 -8. By default, the colour ramp will be red. However, red is not the rivht colour to use for population count, as it is generally used to communicate negative elements, such as food insecurity or cholera cases -9. Click on the arrow next to __Color Ramp__ to choose another combination of colours - let's say a color ramp from white to blue -10. Click Apply to preview the look of your layer, then OK - -```{figure} ../../fig/en_30.30.2_symbology_variable_ranges_2.png ---- -name: symbology of variable ranges 2 -width: 500px ---- -You can categorize the continuous values into classes and assign a colour ramp -``` - -The following map shows the most populated States of Nigeria using a graduated colour categorization. - -```{figure} ../../fig/en_map_design_example_variable_ranges ---- -name: map design example_state population Nigeria -width: 500px ---- -An unfinished map showing the population of Nigerian states -``` \ No newline at end of file diff --git a/content/Wiki/en_qgis_attribute_table_wiki.md b/content/Wiki/en_qgis_attribute_table_wiki.md index dd75489a2..5603b5cb7 100644 --- a/content/Wiki/en_qgis_attribute_table_wiki.md +++ b/content/Wiki/en_qgis_attribute_table_wiki.md @@ -1,10 +1,12 @@ # Attribute Table in QGIS -The attribute table, a core component of Geographic Information Systems (GIS), organizes and presents detailed information about features in a selected layer. Each row in the table represents a feature, while columns store specific attributes. This table facilitates searching, selection, sorting, filtering, and editing of features. +The attribute table, a core component of Geographic Information Systems (GIS), __organizes and presents__ detailed information about features in a selected layer. Each __row__ in the table represents a __feature__, while __columns__ store specific __attributes__. This table facilitates searching, selection, sorting, filtering, and editing of features. ## Buttons of Attribute Tabel -![](/fig/attribute_table.png) +![Example of an attribute table](/fig/attribute_table.png) + +Below all buttons of the attribute table are listed. |Icon|Description|Purpose|Shortcut| |---|---|-----|---| @@ -33,4 +35,87 @@ The attribute table, a core component of Geographic Information Systems (GIS), o |![](/fig/dock.png)| Dock attribute table | Allows to dock/undock the attribute table|| |![](/fig/mAction.png)| Actions | Lists the actions related to the layer | | +## Attribute Table- Basics + +### Display attribute table and sort features + +* __Open Attribute Table:__ Right click on your layer --> `Open Attribute Table` +* __Sort column:__ Click on a column header + + + + +### Manually select features in the attribute table + +* __Select:__ Click on the lines of the features. +* __Multi Select:__ To select multiple features press `Ctrl` and select features. +* __Show only selected features:__ In the bottom left of the attribute table open the dropdown menu and select `Show selected features`. To show again all features click on `Show all features` + + + +### Unselect feature + +* __Unselect:__ Click on ![](/fig/mActionDeselectActiveLayer.png) or use `Ctrl+Shift+A`. + + + +### Zoom in on a specific feature + +* __Zoom:__ Right click onyour feature --> `Zoom To Feature` + + + +## Table view vs Form view +QGIS provides two view modes to easily manipulate data in the attribute table: + +* __Table View:__ ![](/fig/mActionOpenTable.png)This mode presents the values of multiple features in a tabular format, where each row corresponds to a feature, and each column represents a field. +* __Form view:__![](/fig/mActionFormView.png) This mode shows all attributes of __one_ selected feature. + +To switch between the modes use the ![](/fig/mActionFormView.png) ![](/fig/mActionOpenTable.png) buttons in the down right corner of the attribute table. + +___ + +## Attribute Table- Data Editing + +### Change data in the attribute table + +* __Open Attribute table:__ Right click on your layer --> `Open Attribute Table` +* __Edit Data:__ Activate editing mode by clicking on ![](/fig/mActionToggleEditing.png) --> Do your edits +* __Save edits:__ Click on ![](/fig/mActionSaveEdits.png) __or__ deactivate editing mode by clicking on ![](/fig/mActionToggleEditing.png) --> `Save` + + + +### Add new column + +* __Add new column:__ Activate editing mode by clicking on ![](/fig/mActionToggleEditing.png) --> click on ![](/fig/mActionNewAttribute.png), the window `Add Field` will open +* __Specify column variables:__ Fill the window and click `OK` + * `Name` = Name of column + * `Comment` = Additional info about column + * `Type` = Select the type of data the column will have.Table of data types below. + + +| Type | Property | +|-----------------------------|----------------------------------------------------| +| Whole number (integer) | Whole numbers like counts, quantities, or IDs. | +| Whole number (integer 64-bit) | Larger whole numbers for very big counts. | +| Decimal number (real) | Numbers with decimal points, useful for measurements and fractions. | +| Text (string) | Alphanumeric characters, such as names and descriptions. | +| JSON (string) | Structured text data often used for complex information. | +| Date | Specific calendar dates. | +| Date & Time | Dates and times together | +| Binary object (BLOB) | For storing binary data like images, audio, or files. | +| Boolean | Simple true/false or yes/no values. | + + + +### Delete column + +* __Delet column:__ Activate editing mode by clicking on ![](/fig/mActionToggleEditing.png) --> click on ![](/fig/mActionDeleteAttribute.png) --> Select the columns you want to delete --> Click on `OK` --> Click on ![](/fig/mActionSaveEdits.png) + +```{Hint} +To select multiple columns press `Ctrl` and select columns. +``` + + + diff --git a/fig/en_30.30.2_Moving_and_scaling_the_map.mp4 b/fig/en_30.30.2_Moving_and_scaling_the_map.mp4 new file mode 100644 index 000000000..8f16e2f44 Binary files /dev/null and b/fig/en_30.30.2_Moving_and_scaling_the_map.mp4 differ diff --git a/fig/en_30.30.2_add_road_labels.mp4 b/fig/en_30.30.2_add_road_labels.mp4 new file mode 100644 index 000000000..850653c26 Binary files /dev/null and b/fig/en_30.30.2_add_road_labels.mp4 differ diff --git a/fig/en_30.30.2_adding_a_legend.mp4 b/fig/en_30.30.2_adding_a_legend.mp4 new file mode 100644 index 000000000..0ee89e2b8 Binary files /dev/null and b/fig/en_30.30.2_adding_a_legend.mp4 differ diff --git a/fig/en_30.30.2_adding_a_new_map.mp4 b/fig/en_30.30.2_adding_a_new_map.mp4 new file mode 100644 index 000000000..df9763436 Binary files /dev/null and b/fig/en_30.30.2_adding_a_new_map.mp4 differ diff --git a/fig/en_30.30.2_change_style_for_multiple_layers.mp4 b/fig/en_30.30.2_change_style_for_multiple_layers.mp4 new file mode 100644 index 000000000..bc8345bda Binary files /dev/null and b/fig/en_30.30.2_change_style_for_multiple_layers.mp4 differ diff --git a/fig/en_30.30.2_editing_the_legend.mp4 b/fig/en_30.30.2_editing_the_legend.mp4 new file mode 100644 index 000000000..29fe9d5a9 Binary files /dev/null and b/fig/en_30.30.2_editing_the_legend.mp4 differ diff --git a/fig/en_30.30.2_graduated_styling.mp4 b/fig/en_30.30.2_graduated_styling.mp4 new file mode 100644 index 000000000..aec3aa80d Binary files /dev/null and b/fig/en_30.30.2_graduated_styling.mp4 differ diff --git a/fig/en_30.30.2_make_only_outlines_visible.mp4 b/fig/en_30.30.2_make_only_outlines_visible.mp4 new file mode 100644 index 000000000..1a8447c80 Binary files /dev/null and b/fig/en_30.30.2_make_only_outlines_visible.mp4 differ diff --git a/fig/en_30.30.2_move_labels_independently.mp4 b/fig/en_30.30.2_move_labels_independently.mp4 new file mode 100644 index 000000000..e53037306 Binary files /dev/null and b/fig/en_30.30.2_move_labels_independently.mp4 differ diff --git a/fig/en_30.30.2_opening_the_styling_panel.mp4 b/fig/en_30.30.2_opening_the_styling_panel.mp4 new file mode 100644 index 000000000..18a71ae12 Binary files /dev/null and b/fig/en_30.30.2_opening_the_styling_panel.mp4 differ diff --git a/fig/en_30.30.2_print_layout_adding_a_title.mp4 b/fig/en_30.30.2_print_layout_adding_a_title.mp4 new file mode 100644 index 000000000..5e504507b Binary files /dev/null and b/fig/en_30.30.2_print_layout_adding_a_title.mp4 differ diff --git a/fig/en_30.30.2_rule_based_labelling.mp4 b/fig/en_30.30.2_rule_based_labelling.mp4 new file mode 100644 index 000000000..b1d7646f8 Binary files /dev/null and b/fig/en_30.30.2_rule_based_labelling.mp4 differ diff --git a/fig/en_30.30.2_rule_based_styling.mp4 b/fig/en_30.30.2_rule_based_styling.mp4 new file mode 100644 index 000000000..33e1063f0 Binary files /dev/null and b/fig/en_30.30.2_rule_based_styling.mp4 differ diff --git a/fig/en_30.30.2_setting_up_labels.mp4 b/fig/en_30.30.2_setting_up_labels.mp4 new file mode 100644 index 000000000..a6676969c Binary files /dev/null and b/fig/en_30.30.2_setting_up_labels.mp4 differ diff --git a/fig/en_30.30.2_underlign_labels.mp4 b/fig/en_30.30.2_underlign_labels.mp4 new file mode 100644 index 000000000..c36e52cd8 Binary files /dev/null and b/fig/en_30.30.2_underlign_labels.mp4 differ diff --git a/fig/mActionFormView.png b/fig/mActionFormView.png new file mode 100644 index 000000000..629dad87a Binary files /dev/null and b/fig/mActionFormView.png differ diff --git a/fig/mActionOpenTable.png b/fig/mActionOpenTable.png new file mode 100644 index 000000000..dcdcacf4c Binary files /dev/null and b/fig/mActionOpenTable.png differ diff --git a/fig/qgis_reproject_raster.mp4 b/fig/qgis_reproject_raster.mp4 new file mode 100644 index 000000000..f106dfb77 Binary files /dev/null and b/fig/qgis_reproject_raster.mp4 differ diff --git a/fig/qgis_reproject_vector.mp4 b/fig/qgis_reproject_vector.mp4 new file mode 100644 index 000000000..24f596483 Binary files /dev/null and b/fig/qgis_reproject_vector.mp4 differ diff --git a/jupyterbook b/jupyterbook deleted file mode 100644 index e69de29bb..000000000 diff --git a/search b/search deleted file mode 100644 index e69de29bb..000000000