Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jgruenewald27 committed Oct 20, 2023
1 parent 8e2e4e9 commit 6128320
Show file tree
Hide file tree
Showing 10 changed files with 338 additions and 17 deletions.
76 changes: 72 additions & 4 deletions _sources/content/Modul_5/en_qgis_non_spatial_tools.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,80 @@
# Non-Spatial Geodataprocessing
**Competences:**

#### Introduction:
Non-spatial geodataprocessing in QGIS refers to the manipulation, subsetting and analysis of attribute data within a GIS environment without directly involving spatial components. It involves operations on the non-geometric attributes of geospatial datasets. This can include data cleaning, transformation, enrichment and analysis based on the associated attribute information, such as population statistics, land use classifications or economic indicators. Non-spatial geodataprocessing can be used to perform calculations, generate statistics and gain insights into the non-spatial aspects of geospatial datasets. QGIS offers a variety of tools for non-spatial geodataprocessing to assist users in managing and analyzing attribute data effectively.

This segment of Module 5 will start with the introduction of table functions. It will then progress into techniques for querying data, ultimately introducing the important concept of non-spatial joins.

## Table functions

### Field Calculator:
The __Field Calculator__ is a tool for querying (filtering) your data or layers using their attributes.
### Add field
The information of a vector layer can be accessed through its attribute table, and it can be enriched by adding new fields to this table.

```{Attention}
Depending on the information that will be added to the created attribute field, the correct data type must be selected.
```
__Possible data types:__
- __Whole number: Integer (32 and 64 bit)__
- __Decimal number (real)__
- __Text (string)__
- Date and Date and time
- Boolean

The most common data types are the first three.

````{dropdown} Add a field for population density; the data type should be Decimal number (real)
<video width="100%" controls src="https://github.com/GIScience/gis-training-resource-center/raw/main/fig/en_qgis_add_field.mp4"></video>
````

### Delete field
It is also possible to __delete fields__ from the attribute table. A commonly used practice is to __remove all unused or unnecessary fields__ from a layer before starting to work on it. This __makes the dataset much more organized__.

````{dropdown} Delete all unused/unnecessary fields from the vector layer
<video width="100%" controls src="https://github.com/GIScience/gis-training-resource-center/raw/main/fig/en_qgis_delete_field.mp4"></video>
````

### Calculate field
An important practice is to calculate the attribute values for a field, e.g., based on the values of other fields. In QGIS, you can __create a new field or update an existing field__.

```{Note}
It is necessary to __check if the data type of the field__ (new or updated) __and your calculation match__. For example: if you are calculating a ratio (e.g. density), the field should not be of type integer but rather of type decimal number.
```
An example could be to calculate the population density based on the already existing fields Population and Area.

A very important tool for such calculations is the __Field Calculator__. It allows you to __perform calculations based on existing attribute values or defined functions__, for example, to calculate the length or area of a geometry feature. The results of these calculations can be written into a new field or update an existing field.

````{dropdown} Calculate the population density based on the already existing fields Population and Area
<video width="100%" controls src="https://github.com/GIScience/gis-training-resource-center/raw/main/fig/en_qgis_calculate_field.mp4"></video>
````

### Basic statistics for fields
The tool __Basic statistics for fields__ generates statistics for a specific field of the attribute table of a vector layer. The results are generated as an HTML file and can be accessed by using the __file path link__ in the __Results Viewer__.

````{dropdown} Calculate statistics for the field population density for all the countries. What are the max./min. values, average, etc.?
<video width="100%" controls src="https://github.com/GIScience/gis-training-resource-center/raw/main/fig/en_qgis_field_stats.mp4"></video>
````

### Statistics by categories
To calculate statistics of a field depending on a parent class you can use the tool __Statistics by catergories__. The parent class is a combination of values from other fields.

__Questions that need to be considered when doing these calculations:__
* For which fields should the statistics be calculated in the attribute table?
* Which field in the attribute table contains which information?

````{dropdown} How many cities per country have more than 300.000 inhabitants? For each country: how many people live in the largest agglomeration?
<video width="100%" controls src="https://github.com/GIScience/gis-training-resource-center/raw/main/fig/en_qgis_stats_by_category.mp4"></video>
````

## Non-spatial queries

### Manual selection
It is possible to manually select specific rows by clicking on the number in front of it. This can be easily used to select a small number of rows. If they are selected successfully, they will appear in yellow.

# VIDEO?

### Select by expression


## Non-spatial queries (II)

#### Querying data:
In GIS one can __query__ (filter) data based on specific information (attribute). After successfull filtering only the wanted features that represent the __attribute__ are displayed. Data filtering can be used to create a __subset__ of features and export them as a new layer.
Expand Down
26 changes: 25 additions & 1 deletion _sources/content/Modul_5/en_qgis_spatial_tools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Spatial Geodataprocessing
**Competences:**

## Clip



* Clip, Buffer, Dissolve
* Spatial joins
* Clip by extent & mask
* Clip by extent & mask

## Clip vector by extent

This operation clips any vector file to a given extent. This clip extent will be defined by a bounding box that should be used for the vector output file. It also has to be defined in the target CRS coordinates. There are different methods to define the bounding box of which the following is the most prominent:
* Calculate from a layer: this uses the extent of a layer loaded into the current project

# DROPDOWN HERE OR TABS
Other option are:
* Calculate from layout map: uses the extent of a layout map item in the active project
* Calculate from bookmark: uses the extent of a saved bookmark
* Use map canvas extent
* Draw on canvas: click and drag a rectangle delimiting the area to take into account
* Enter the coordinates as xmin, xmax, ymin, ymax

## Clip vector by mask layer

This operation uses a mask polygon layer to clip any vector layer.

# AUCH FÜR RASTER DATEN??
3 changes: 3 additions & 0 deletions content/Modul_1/en_gis_theorie.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Modul 5- Intermediate GIS operation</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../Modul_5/en_qgis_spatial_tools.html">Spatial Geodataprocessing</a></li>


<li class="toctree-l1"><a class="reference internal" href="../Modul_5/en_qgis_non_spatial_tools.html">Non-Spatial Geodataprocessing</a></li>

</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Trainers corner</span></p>
<ul class="nav bd-sidenav">
Expand Down
3 changes: 3 additions & 0 deletions content/Modul_1/geodatenformate.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Modul 5- Intermediate GIS operation</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../Modul_5/en_qgis_spatial_tools.html">Spatial Geodataprocessing</a></li>


<li class="toctree-l1"><a class="reference internal" href="../Modul_5/en_qgis_non_spatial_tools.html">Non-Spatial Geodataprocessing</a></li>

</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Trainers corner</span></p>
<ul class="nav bd-sidenav">
Expand Down
Loading

0 comments on commit 6128320

Please sign in to comment.