Analysing Vector_Data_with_QGIS

THIS PAGE IS STILL IN EDITING MODE

For most of the following analysis tools the processing toolbox is the easiest way to use your tools. You can find the processing toolbox when you click on processing. Then you can open the toolbox and find whatever tools you want to use. A short pretext on computer capacity and efficiency: Vector data is usually considered to be less harddrive space intensive compared to raster data. However, some of the approaches presented here can be pretty computer intensive. Saving your project before certain procedures is always advisable, and some projects may demand slicing your data into parts in order to pretest your calculations with a smaller subset.

Processing Toolbox.jpg

Interpolation[edit]

Interpolation.jpg

Interpolation refers to extending the known values and estimating the unknown values when there are multiple point values in a polygon. Points with known values are used to estimate the missing values inside the polygon. For example, the population density of an area can be estimated with interpolation. If the population density at different points is known, the density in between those points can be estimated through interpolation. To use the interpolation tool search for interpolation in the toolbox

There are different types of interpolation. Depending on the data you use, the one or the other will be most useful. The TIN interpolation creates a surface formed by triangles of nearest neighbour points. It is mainly used to create elevation profiles based on vector data. The IDW interpolation weighs the points based on the distance to the point that should be created. This means that the nearer the point to the unknown point the higher the influence. This method is prone to outliers and if the data is distributed unevenly it can lead to a wrong representation of the data. (The values between two available Points are estimated (interpolation) and the missing values are found. Spatial interpolation is the process of using points with known values to estimate values at other unknown points)

Buffering[edit]

Buffers create a zone around a real-world feature. This can be for example a protection zone around rivers or a zone around an existing street if the street should be enlarged. Like this you can check if unwanted objects such as industrial sites near rivers or objects that would need to be removed for the new road are present.

Here you can see a buffer around the rhine and other waters. With this further spatial analysis could be conducted.

Buffering 1.jpg
Buffering 2.jpg


For this you need to load the geb_01f and the gew_01f layers. Make sure that the geb_01f layer is below the gew_01f layer in the list at the left, otherwise you will not be able to see the waters. To use this tool, you search for buffer in the toolbox.

Buffer.jpg

In the window that opens when you double click on the buffer you can choose the characteristics for the buffer you want to create. As input layer you choose gew_01f to create a buffer around the waters you want to examine. Then you can choose the size of your buffer and the distance you want to cover. For this example, five kilometres were used. Be careful as the buffer distance may interact with the projection you use, and it is advisable to make sure that your units (Degrees vs. meters) are correctly selected. Otherwise you might get very large or very small buffers.

Parameters buffer.jpg

Once you set all the parameters as you want them, you click run and a new layer will be created.

Conversion[edit]

For some analysis tools it can be useful to convert your vector data into raster data or the other way round. To do so you search for conversion in the toolbox. To convert vector into raster you choose vector conversion and then rasterize (vector to raster). To convert raster into vector you need to choose raster conversion and the polygonize (raster to vector).

Raster conversion 1.jpg

Here we will focus on the rasterize algorithm. If you choose the rasterize tool a dialogue field will open in which you can choose the layer you want to rasterize and other qualities of the raster you want to create. We use the gew01_l file. As output raster size units, you choose pixels and then you can choose the resolution you want for your raster. Other optional values can be fixed as well. To finish, you click run to perform your rasterization. Now you can perform the analysis you want with your rasterized data.

Rasterize.jpg

Merge[edit]

To merge two vector files both need to be of the same type (point, line, or polygon). To do so you must search merge in the toolbox and then you choose merge vector layers.

Merge vector layers.jpg

In the dialogue field that opens you can choose the two or more layers that you want to merge (you need to load them into your project first). For example, you can merge the geb01_f and the geb03_f layers to have the protected areas and the districts in one layer.

Merge vector layers 2.jpg

Clip[edit]

If you only want to have one part of a layer, one way to get it is the clip tool. With the clip tool it is possible to cut one part of a layer. For example, you can cut only the areas used for agriculture out of the protected areas.

Clip 1.jpg
Clip 2.jpg

First you search for and choose the clip tool in the processing tool bar. When you open the tool, you choose the layer you want to cut something out of (input layer) and after this the part you want to cut out (overlay layer). In our case we choose the geb03_f as input and the veg01_f as the overlay layer. To finish you run your algorithm and the new layer is created.

Parameters clip.jpg

Vector Overlay[edit]

Intersection[edit]

Under *Vector Overlay*, there is a function called *Intersection*. You can use it if you have features in two separate vector layers that overlap. It will return a new layer that includes only the part where both layers overlap. It will therefore return similar results to the *Clip* function, however for the *Clip* function, only the attributes of the input layer are preserved, while the *Intersection* tool transfers the attributes of both original layers to the new layer.

To perform this function, go to the *Processing Toolbox* and search for *Vector Overlay*. Then choose *Intersection*.

You can see two vector layers here, each containing a rectangle, which overlap partly. To extract the overlapping part while preserving attributes from both layers, look for the Vector Layer → Intersection in the Processing Toolbox.

Next, add your input layer and your overlay layer, choose a file location for the output and *Run*.

Intersection 2.png

The resulting layer will return the intersecting part only, including the attributes from both layers in the attribute table.

Intersection 3.png


Union[edit]

Under *Vector Overlay* you can find a function called *Union*. You can use it if you have two vector layers with features that partly overlap. It will return a new layer with separate features for both overlapping, and non-overlapping parts. Any overlapping parts will contain attributes from both original layers (as in the *Intersection* function) and any non-overlapping parts will contain the attributes from the respective original layer only.

To use the *Union* function, search for *Vector Overlay* in the *Processing Toolbox* and choose *Union*.

Union 1.png

Then, add your input and your overlay layer, choose a location for the output file and Run.

Union 2.png

The resulting layer contains all unique combinations, i.e. overlapping and non-overlapping parts, as separate features. If you use the Identify features button to click on the individual features, you will see that overlapping areas contain attributes from both layers, and non-overlapping parts include information from the respective original layer only.

Union 3.png


Join-By Location[edit]

Join attributes by location is a tool that allows you to add information from one vector layer to another. For example, we have a vector layer containing different districts in Lüneburg. In the *attribute table*, there is a field called “name” that contains each districts name. The second layer contains information on bus stops in Lüneburg, but it does not contain to which districts they belong. We can add this information to the bus stop layer by joining the attributes of the layers.

In the *Processing Toolbox*, under *Vector general*, double-click on the tool *Join attributes by location*.

Join 1.png

Choose the first layer. This is the one that attributes will be added to. Then, choose a geometric predicate. This will depend on the data you are using and what you want to achieve:

Intersect joins features if they intersect at any point, most inclusive
Contain joins features if one is located within the other - without crossing the boundary
Equal if features are exactly the same
Touch features share a boundary point, no overlap
Overlap features overlap partly (must be the same geometry type)
Within opposite of contain
Cross features of different geometry types intersect and the dimension of their intersection is lower than the dimension of at least one of the features, e.g. two lines crossing at a point.

In this example, we want the bus stops located within districts. Choose the second layer from which the new attributes will be taken. Optionally, you can specify which fields you want to add, in this case, only the name of the district. Next, adjust the Join type if necessary. In this example, there were several bus stops outside of the districts of interest, so the box Discard records which could not be joined is ticked to remove those points. Lastly, specify where you want to save the output file if desired and click Run.

Join 2.png

A new layer will be created with the bus stops located in the districts. In its attribute table, for each point, there is now the name of the district it lies within added in an additional column.

Join 3.png

Data Transformation[edit]

Excel to Point[edit]

First, we learn how to import coordinates from an Excel file to GIS. Please download this data file: 3_GIS Tutorial_Lueneburg_Special Places.csv It contains the coordinates of some favourite student places in Lüneburg. In the end we will have transformed the coordinates into point data in QGIS:

Point data LG.jpg
Map LG.jpg

Note that whatever data you want to import from Excel must be saved in a .csv-format.

Open QGIS and select Layer → Add Layer → Add Delimited Text Layer

Add layer.jpg

The following window will appear.

1. You can import the “3_GIS Tutorial_Lueneburg_Special Places.csv”-file using the “…” button in the upper right corner.

2. Go to File Format. Select Regular expression delimiters and type “;” since this is the separator used in the csv.file used here. If you have a comma-separated file, you can just select “csv”. You can check whether QGIS can read the file in the Sample Data window. The data should show in a table with each value being in a separated cell.

3. Go to Geometry Definition. Select for the X-field “Longitude” and for the Y-field “Latitude”. It is important not to confuse the two.

4. Under Geometry Definition, you find a field to select the coordinate reference system, it is called Geometry CRS. Select “EPSG: 4326: WGS 84”.

5. Now you can Add the layer.

Delimited text.jpg

Once you closed the window, you will recognise that some points appeared in your main window. To check if they correctly appear in the right place, you can load a map to check.

Untitled project.jpg

Select Web → QuickMapServices → OSM → OSM Standard to add a layer which contains a standard map from OpenStreetMaps.

OSM.jpg

Now you can check whether you find the dots where they are supposed to be.

Finally, you can save your imported file as a “shape-file”. This allows you to make additional changes as well as sharing the data easier with others.

Right-click on your file in the Layer-Panel (bottom left). Select Export → Save Features As

Save Feature As.jpg

A window appears, where you can make some changes about what properties the shape file should have.

1. Go to Format and select “ESRI Shapefile”.

2. Go to File name and give your new shape file a name.

3. Go to CRS and check if the right coordinate reference system is selected (EPSG: 4326: WGS 84)

4. Select OK.

Save Vector Layer.jpg

In your Layer Panel, a new layer should have appeared. You can now edit the visual appearance of the coordinates. Double click on the new layer and a window will appear. Select Symbology to edit the colour and size of the dots. Select Apply to see if you like the result.

Symbology.jpg

Go to Labels to add a label to each coordinate. Select Single Labels at the top. Now you can choose which names shall appear next to the dots. You can simply refer to the names that are saved in the CSV file. Go to Value and select “Location N” which is a column in the csv.-file you downloaded at the beginning. Select OK to save the changes and take a look at the result.

Labels.jpg

Congrats, you successfully imported point coordinates from an Excel file to QGIS!

Point to Polygon[edit]

Next, we would like to highlight certain areas on campus where people often meet to eat. To do so, we need to move from the point data, which was sampled in the Campus Survey, to polygons, which are able to display areas on the map. Please download this csv-file (Link: 03_Tutorial_Point to Polygon_Campus Survey.csv). It contains a modified version of the point data you worked with before; it only contains the outer points of the most-frequented lunch-places. Feel free to take a look at the data in Excel, you will notice that each point has assigned a group and an order value, this will become relevant for the next steps.

To import that csv-file into your project, repeat the steps from previous tutorials to ‘import the data in QGIS’ and turn it into a shapefile. If you have already closed it again, you can open the Open Street Map again to give yourself a better sense of which location the data is referring to. You should now see three groups of four dots each, delimiting areas of food consumption at Leuphana Campus.

Leuphana 1.jpg

To create polygons, we first need to connect the dots by drawing lines between them.

Search for the “Points to path” function in the toolbox at the right and open it.

Points to path.jpg

1. Select the shape-file which you just downloaded as the “Input Layer”.

2. Select “Order” for “Order Expression”. This indicates the order in which the points are connected.

3. Select “Group” for “Path group expression”. Thereby, QGIS knows which points belong together and are thus to be connected.

4. Save the file you are about to create by clicking on the “...” under “Path” and choosing a location on your hard drive as well as a name.

5. Hit “Run”. A layer should appear which connects the points on your map with lines.

Leuphana polygons.jpg

Now we can create polygons from these lines. Open the function Lines to Polygons via the toolbox. You just need to select the line-layer, which you have just created and then hit Run.

Lines to polygons.jpg
Leuphana polygons lines.jpg

Congratulations! You have now created points, lines, and polygons. It is not very elegant yet but your map displays three of the most frequented areas on Leuphana Campus where people eat their lunch.

Normativity[edit]

Normativity in vector data analysis refers to the implicit and explicit values, assumptions, and judgments that shape the processes of data collection, interpretation, and representation. While GIS is often perceived as a neutral, objective technology, its use is inherently value-laden, reflecting the priorities, biases, and intentions of its designers, analysts, and users. At every stage—from deciding what data to collect, to how it is categorized, symbolized, and spatially represented—normative choices are made. For example, land use classifications may privilege economic activities like agriculture or development over indigenous land practices or conservation efforts. Similarly, the spatial resolution chosen can emphasize certain patterns while obscuring others, influencing how problems are perceived and which solutions are considered viable. Furthermore, the application of GIS in policy and planning often carries normative weight. Decisions based on GIS analyses, such as where to build infrastructure or how to allocate resources, can reinforce existing power structures or marginalize vulnerable communities if not critically examined. For example can GIS also build on different scales or projections, which represent different approximations on how the world is represented, which often has a cultural or even social dimension. As such, questions of ethics, equity, and social justice are central to a normative critique of GIS. Recognizing the normative dimensions of GIS encourages more transparent, reflective, and inclusive practices. It challenges analysts to consider whose knowledge is included or excluded, what values underlie spatial decisions, and how GIS can be used to empower rather than dominate. In this way, normativity is not a flaw to be eliminated, but a dimension to be acknowledged and responsibly engaged with in spatial analysis.


The authors of this entry are Neha Chauhan, Benjamin Richetr, Carlo Krügermeier, Hannah Metke.