On our site you often read about this „geospatial data” thing. I thought that since we mentioned it so frequently, I dedicated a whole article to it. In it I sum up what you need to know about these data, how you can classify them and how they’re being used. I also add a „how to” section with exact software tutorials. All presented software are free to use so you can try all the described methods and techniques. I recommend this article for those who are only getting into mapping and modeling.
I think this will be very useful for beginner drone users because from this article you can learn how to create cartographically correct road network, estate records, land cover maps by using orthophotos. Or how to create slope and aspect maps. For the end of the article, I’ve prepared a special satellite image analysis which has direct agricultural significance.
Be prepared because this is going to be a long but hopefully instructive read. 🙂
What is geospatial data?
In a nutshell, geospatial data are any data that have connection to an exact place in geometrical terms. Okay…I said that it’s gonna be a long read so I’m not taking it brief. A geospatial data can be a coordinate or a location which we can position in space. Also, aerial photos, digital elevation models (DEM), satellite images, LIDAR point clouds, plot boundary maps belong to the category of geospatial data. Of course, I won’t mention all of them but now you have a clue about what we are dealing with here. Geospatial data can be divided into two groups based on data models: vector and raster. In case of vector files, we display the geometrical elements (points, lines, polygons, solids) by coordinates ordered to vertices. Meanwhile when we use a raster data model, we cover the surface like a mosaic. These covering elements can be triangles, squares, hexagons.
“Which model should I use?” you might ask. Well, it depends on the nature of data collection and on the goal of the work. Creating a vector file can be a bit complicated because you must plan the geometry itself. Also, you need to create the attribute table and even fill it with data if needed. Storing vector data is also less problematic since it doesn’t require that much storage compared to the raster model.
Sidenote: The statement about the storage requirements is only partly true because a point cloud is also a vector data model and these files can be huge.
Raster files can be created on an easier and quicker way however with these files you can only achieve an exact display because every cell can contain only one type of data. If you would like to read more about vectors I recommend this article.
If you are interested in raster and you want to really dig into the basics of geospatial data then I recommend this article.
The fact, my dear Reader, is that If I wanted to present all data types in the needed depth, then you wouldn’t have time to read our other magnificent articles.
Now we will be talking about creating a shapefile which is the most common GIS format. Also, I will show you how you can create map-content by using this shapefile and how you can shape this in 3D. At the end I will also show you how to convert a 3D file into a point cloud and I will also make a special measurement.
Before we get started it is important to mention that the software I use in this section is called QGIS 3.22.1. It’s a free software so feel free to download it and try it out.
If you open QGIS after installing you will see the following.
Choose “New Empty Project”. Be very careful with coordinate systems and transformations when using this software. Here you find them in EPSG (European Petroleum Survey Group) code formats, for example 4326=WGS84. GPS, GNSS and UAV also use this.Add a base map to our map, so we will always know where we are located in space. Of course, this basic map can be an orthophoto map made by drone. If you look up the orthophoto in the sidebar on the left hand side you just easily drag-and-drop it to the map. If you don’t have your own base map you choose “XYZ Tiles” on the left sidebar then double-click to the “OpenStreetMap” option.
If you are attentive, you can notice that in the bottom right corner the EPSG code changed from 4326 to 3857. This change happened because most of the web-based maps (e.g. OneStreetMap) are using the “Pseudo-Mercator coordinate system.
Zoom to an arbitrary area using the mouse scroll. We will vectorize a building chosen by you. Click on the third button on the menu bar above the map canvas which is “New Shapefile Layer…”. Can you figure out the next step? Yes, the name of the subtitle becomes reality, and we will create a shapefile.
First you need to give the name and the location of the new file. It’s recommended to create a new folder for that operation because the software creates some additional files while creating the shapefile. At “file decoding” you can set the character encoding of the attribute table (which is actually the data content behind the geometry). If you are uncertain which one to choose then set UTF-8 encoding. This contains almost everything. The next one is the geometry type field.
Let’s take a little break here… Shapefiles, unlike CAD (DXF and DWG) type spaghetti models, are made up topologically. Okay, don’t close the blog yet, I will explain this, then we get back to QGIS. The essence of the spaghetti model is that points, lines and polygons can be in the same data table regardless of what object we want to display. In contrast, when working with a topological data model we need to determine in advance, what type of geometry we want to store in a data table. And that’s it, let’s get back to QGIS.
Let’s pick the “Polygon” option. When choosing dimensions, if we select the “Z (+M values)” option then we create an area that can be interpreted in 3D. Let’s make it exciting and select it! The next step is to set the coordinate system of geospatial data. Choose the 3857 Pseudo-Mercator. Here comes another interesting part that technically differentiates GIS from CAD. This is the attribute data table. Name a column (for example “building”) then beneath the “Type” field you can give the data type of the new fields. In this particular case we use “Text” which is a simple string. Click on “OK” and now you can see that the shapefile has been added to the layer tree of the map. Select the new layer on the menu bar then click on the pencil icon to start editor mode.
Afterwards you can pick “Add Polygon Feature” to activate the drawing. With clicking on the map, you can create vertices and between them an area appears. If you feel like you’re ready and your polygon covers the foundation of the selected building, right-click on the map to close the geometry. A small dialog box will appear to ask for attributes. Enter the data and click on “OK”.
From the menu bar let’s pick “Vertex Tool ”. With that we can assign Z values to coordinates. The easiest way to do that is to press and hold the left mouse button and select your whole geometry. Then move your cursor above a vertex and press the right mouse button. A table will appear on the left.
Change “z” values. Save the shapefile by clicking “Save Layer Edits” on the menu bar. Turn off the Editor mode and we are ready.
3D modeling using CG
In this chapter I will show you the 3D editing possibilities of the previously presented shapefile in Computer Graphics (CG) environment.
After installing Blender and its addon, let’s start it. In the 3D model space, a small window will appear which disappears if you click outside of it. In the model space you see a small cube, a light source, and a camera. In this tutorial we don’t need them, so we delete all of them. Press “A” on your keyboard to select all the items then press “Delete” to delete the objects. Now the track (i.e. the model space) is all clear, let’s import the shapefile.
To edit, first select the geometry with the left click. Press the “Tab” key and now you are in editor mode. By pressing “A” again, you select all the vertices. Let’s extrude this area along the Z axis! Press the “E” key then move the cursor in the model space. It’s cool, isn’t it? 🙂
Save our 3D model. For that first exit editor mode by pressing “Tab”. Then export the model in OBJ format.
While exporting, take care of the following: on the right in the “Transform” menu set “Forward” value to “X Forward” and “Up” value to “Z Up”.
With the basic functions of Blender you can even create buildings and add texture to them. So if you want to unite GIS with 3D modeling, this software will be your best friend. Blender itself has a tremendous number of tools that will not be discussed in this introductory article. If you want to become a master of Blender, I recommend this YouTube channel. The guy is a genius.
If you are looking into the opportunities specifically in BlenderGIS and 3D modeling functions I recommend these videos.
Three Step Over Point clouds
In this section, I will present another software and multiple useful methods. For this I will use previously presented results.
If you want to complete the tutorial you will need another free software as usual. This is CloudCompare.
Sidenote: It’s possible that your antivirus will detect it as a dangerous software. If you feel uncomfortable installing it, just skip this, you can follow the steps presented here without having CloudCompare. But I’ve been using it for years now and it never caused any trouble. 🙂
After starting CloudCompare, open the OBJ file made before. The software has the advantage that it can open and export a lot of file formats.
To be honest with you I must admit I cheated, because I made a model in Blender which is a bit different from the one presented. I’ve done that to be able to make a comparison between the two models.
If you select the (mesh) layer of the 3D model in the menu bar above, then you select “Sample points on a mesh”, you can create a point cloud from the mesh. Here you can set the number of the points (for example: 100 thousand), the density, and also colors you want from your mesh model to inherit. After running, a new layer appears.
We will examine the differences and the distances between the point cloud and the mesh model. You can do that by holding “Ctrl” button and selecting the new point cloud layer and also the mesh layer. Then select “Compute cloud/mesh distance” on the menu bar. If the process was successful, you can examine the extent of difference on a scale from red to blue. Red areas indicate positive distance, while blue areas indicate negative distance.
Apart from these, CloudCompare is a great tool to calculate the volume of the object. It is also possible to compute using UAV or ground photogrammetric and even LiDAR point clouds. You can read more about that in a later article.
Raster geospatial data
In this chapter we will discuss how to create a DEM without photogrammetrical or LiDAR based output. I will show you how to easily create a slope and an aspect map by using a DEM file. And at the end we will make NDWI (drought index) and NDVI (vegetation index) maps using Sentinel-2 sateillite images. This is going to be exciting so don’t give up just yet. 🙂
Creating DEM from vector
So if you are into photogrammetry and LiDAR technology, creating a DEM won’t be a novelty. However you can also create a digital elevation model in QGIS using GPS points or contour lines.
In this example we will create a DEM from existing contour lines. If you are curious how to make a contour line map from an old paper map, read this article ().
As shown before, open the shapefile in QGIS.
We can make a raster terrain model with the help of interpolation.Interpolation is a difficult geostatistical tool that can predict values of the areas with lack of data, based on the known points. The most common interpolation tools are Inverse Distance Weighting (IDW), Spline, Kriging. All of them are available in QGIS. I need to highlight that geostatistical calculations can only be used if the shapefile’s attribute table contains the elevation, or the vertices of lines have “z” coordinates.
First we need to find the processing toolbox. For that, in QGIS you right click on the top menu bar and choose the “Processing Toolbox Panel” option, then tick it.
After all this, a search bar on the right side appears. Type “IDW” and choose the first option. Now you see a new window which can seem a bit complicated. Here you can pick which field you want to examine with the geostatistical tool. Resolution and geospatial extent also need to be set.
Click on “Run” and the calculation begins. This process can take a few minutes depending on the size and resolution.
Let’s see what we can make with a raster, actually a DEM, to be precise. In this chapter we will make a slope- and aspect map. Now we need to search for the word “slope” in the well-known processing toolbar of QGIS. We run the function with default settings by choosing the first option. The result will be a nice black-white map, but we can style it. We double-click on “Slope” layer, then in the “Symbology” menu change “Render type” to “Singleband pseudocolor” value. Pick an arbitrary “Color ramp” then press “OK”.
Now on the map you can see the slope angles of the surface with categorized coloring. Of course, these maps can be created for roofs and for buildings too.
In the search field we type “aspect” and run it on the DEM with default settings. The result will be indistinct, but you can set coloring based on directions in the “Symbology” menu. You can see that in the following picture:
Based on all these, we can define which areas get more sunlight (also for larger areas). This is important in an agricultural aspect but also important when installing solar panels.
Here I used QGIS 3.14. If the analysis doesn’t run with the newest version, try it with my version.
So, let’s start this with describing the source of data, the Sentinel-2 satellites. Sentinel-2 is a part of the Copernicus Program of the European Union. It takes images of lands and coastal areas of Earth in high geospatial resolution (10 to 60 meters). The Sentinel-2 program consists of 2 simultaneously working twin-satellites (Sentinel-2A and Sentinel-2B). They take pictures in visible light and close infra-red ranges (in 13 bands). The mission supports a high range of applications and services, like agricultural monitoring activity, emergencies management, land use, land cover classification or water quality. Sentinel-2 was developed and operated by the European Space Agency (ESA).
That’s enough of theory, let’s see that in practice! On the website of ESA free satellite images are available after registering. Image processing can be done in QGIS afterwards.
Important to mention that your registration goes live 24 hours after registering, so you will be able to use the database after that time.
After our registration is approved, in QGIS in the “Plugins” menu we choose “Manage and Install Plugins”. Here we search for “Semi-Automatic Classification” and install the first hit. The plugins will start automatically, and you will find a bunch of new icons on the QGIS interface. Don’t worry, the process is going to be simple. Move the window away from the top left corner with “drag and drop”, to make it a bit more visible. On the interface of the plugin first we can connect to the data of Sentinel-2. To do this, click on “Download products”.
Here, under the “Login data” tab at “Login Sentinels” you need to give your nickname and password. Under the “Search” tab we need to define the search area by giving its corner coordinates (EPSG:3857). By clicking on the “OSM” button, the base map of OpenStreetMap will appear. On that you can select the search area by clicking on “Set area in the map”.
In the map you can select the area with the left and right mouse button. We can set the date range and it’s also available to filter those images with optimal cloud cover.
We won’t use all the Sentinel-2 bands so under the “Download options” tab pick the following: 2,3,4,8A,11.
Click on “Find images” (it has a small magnifying glass image). Now the download of images will start shortly.
Select the image you want to examine and press “Display preview of highlighted images in the map”.
Press “RUN” in the bottom right corner and save the image in a separate folder. If you have selected multiple images, this can take a while. After that, the calculation of raster files starts, which consist of mathematical analysis of different channels (“Band”). Okay it won’t be as difficult as you think. At first, we go to the “Band set” menu, where we can open downloaded images with the “Open file” button.
Then embed the images into a “Bandset” by pressing “RUN”.
You can add NDVI and NDWI index calculation formulas under the “Band Calc” tab. Let’s start with the calculation of normalized difference vegetation index (NDVI):
This covers the following formula: (Band8A-Band4)/(Band8A+Band4), where Band8A is a near-infrared range (NIR) and Band4 is a visible red range. If you adjust the color scale (as I’ve shown you before), you get a nice vegetation map.
Now we create normalized difference water index (NDWI) too:
("bandset#b4" - "bandset#b5")/("bandset#b4"+"bandset#b5")
This covers the following formula: (Band8A-Band11)/(Band8A+Band11), where Band8A is the near-infrared range (NIR) and Band11 is the short-wave infrared (SWIR). The water index result map also well shows which areas are permanently or periodically water-covered.
Fields of use of Geospatial data
In this last chapter I’ve collected the most important fields where geospatial data can be used (of course in a non-exhaustive list).
Geospatial data give opportunities to inspect agricultural and forestry tasks from a different angle.
- Investigation of the health of vegetation becomes possible via mass data collection methods. This can result in a more accurate yield estimation.
- Multispectral cameras allow us to early diagnose and map tree diseases
- Wildlife damage can be measured and mapped in a larger area
- We can make up to date maps of drought damage
- It’s also possible to regularly survey forest roads and hiking trails We can create high accuracy soil maps with extensive attribute data
In the construction industry CAD and BIM based geospatial data is becoming dominant nowadays. These technologies allow us to represent whole buildings as 3D models, including wires and pipelines together.
3D models and aerial maps are also importantly related to archeological research and monument protection. Investigation of layouts from old buildings or restoration of monuments for instance (before and after).
Today, raw material research is also based on satellite and UAV images. Searching for natural resources like oil and other mineral treasures is a field where remote sensing (and geospatial data) is widely used.
And let’s not forget that city councils and other government agencies can control their cities via geospatial data. When I say that I mean SmartCity projects which are based on geospatial data.
Media- and entertainment industry, insurance sector, the law, real estate market, disaster management and of course transportation are sectors that have started to adopt technologies based on geoinformatics.
I hope this article successfully describes geospatial data and how you can use them even with free software. Even though here we only had a few examples, in our other articles we discuss these topics in more detail.
Did you like what you read? Do you want to read similar ones?
If you really like what you just read, you can share it with your friends via our social media sites.