# An automated algorithm of GRASS GIS to retrieve the data on land cover types in Guinea, West Africa, from Landsat-8 OLI/TIRS images

Polina Lemenkova

► To cite this version:

Polina Lemenkova. An automated algorithm of GRASS GIS to retrieve the data on land cover types in Guinea, West Africa, from Landsat-8 OLI/TIRS images. Ovidius University Annals Series: Civil Engineering, 2024, 25 (1), pp.19-36. 10.2478/ouacsce-2025-0005. hal-04463330

HAL Id: hal-04463330

https://hal.science/hal-04463330v1

Submitted on 16 Feb 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

# An automated algorithm of GRASS GIS to retrieve the data on land cover types in Guinea, West Africa, from Landsat-8 OLI/TIRS images

Polina Lemenkova

*Abstract* – The objective of this research is to evaluate Landsat OLI/TIRS multispectral images, and fusion of GRASS GIS, GMT and QGIS software for land cover mapping in Guinea, West Africa. The scenes of Landsat imagery were acquired on February 2014, 2018 and 2023. Land cover data were used from FAO for validation of classes. The images were classified into 18 classes and upscaled to 10 classes for generalisation towards the study area regional setting. The method included K-means clustering using scripting approach with programming codes included in Appendix. The results demonstrated that the script-based computer vision approach to image processing, classification and analysis is effective in extracting land cover classes for environmental mapping of tropical region of West Africa.

*Keywords* – cartography, geoinformatics, programming, satellite image.

## 1. INTRODUCTION

It is well known that the remote sensing is widely used in the environmental applications such as land monitoring and landscape management. As it is a remote method of measuring spectral reflectance of pixels indicating land cover type properties, it is considered as the best way to be used to identify features on the Earth surface. Image classification techniques automatically groups neighbouring pixels into meaningful regions based on homogeneity or heterogeneity criteria [1]-[3]. Even though image classification has been intensively studied in image processing and computer vision fields, the algorithms of classification are mostly based on using traditional GIS software. In contrast, scripting and programming approaches have only recently started receiving emphasis in remote sensing image analysis while more applied in cartographic tasks [4]-[6].

With the increasing availability of high-resolution imagery and development of machine learning techniques, image classification has become possible using computer vision, programming scripts and interpretation [7]-[9]. Examples of image classification through programming codes in the remote sensing literature include cases of R [10]-[11], Python [12] and GRASS GIS [13]. In view of this, a motivation for this work is to provide the technical foundations using scripts for extracting information from remote sensing data. Such data are received as spectral reflectance of pixels automatically derived from the satellite images using GRSAS GIS modules. Besides, the focus is set on representing these values as land cover types as a support for environmental analysis.
The study area is focused on guinea which is situated in West Africa with tropical environmental setting in the south and dry savanna woodlands in the north-east, Figure 1

<figure><img src="image_3.png" /><figcaption>Fig. 1 Topographic map of Guinea, West Africa. Map source: elaborated by the author using Generic Mapping Tools (GMT)</figcaption></figure>

The Guinean forests present a hotspot with high biodiversity level in West Africa. This region of study area is selected with in the coastal region around Conakry, the capital of Guinea. In the past, this region was a tropical forest of West Africa with dominating thick mangroves and typical landscapes. However, recently, land cover in this region has changed significantly. The main triggers for land cover changes included forest cutting, conversion of forest grounds into pastures for livestock and agricultural activities, urban sprawl and bush fires [14]-[16]. Besides, certain impact was from the climate change. This resulted in deforestation and significant decrease of vegetation, as well as changes in landscape structure along the rivers and wetlands. Satellite image processing is defined as the branch of remote sensing that uses Earth observation spaceborne data for thematic mapping through image classification and analysis.

According to FAO, major land cover types in Guinea include mosaic cropland vegetation, mixed types of forest, shrubland and grassland typical for tropical environment of West Africa. Agricultural areas are represented by the rainfed and aquatic croplands. Central regions include open broadleaved, evergreen, semi-deciduous or deciduous forests with diverse coverage in percentage and woodlands. Costal and riverine regions are covered by the closed broadleaved forest or shrubland permanently flooded in brackish water such as mangroves. The transform type includes the herbaceous vegetation, lichen and mosses
and sparse woody vegetation. The rest is covered by the artificial surfaces and associated areas, urban spaces and bare areas. Major land cover types are shown in Figure 2.

<figure><img src="image_4.png" /><figcaption>Fig. 2 Land cover types in Guinea according to Food and Agriculture Organization of the United Nations (FAO UN) data. Software: QGIS. Map source: author</figcaption></figure>

## 2. EXPERIMENT DESCRIPTION

Three practical applications were done in this research using the GRASS GIS method of image processing to produce maps of land cover types over Guinea, West Africa. Such maps are the best source for environmental monitoring and management for such countries, since it is affected by environmental problems such as deforestation, erosion and desertification. Dynamic of these processes can be monitoring using comparison of satellite images showing changes in land cover types. In the next subsections, the data sources and the workflow of the GRASS GIS methodology will be explained.

### 2.1. Data and materials

The downloaded data included three satellite images of the Landsat-8 OLI/TIRS Collection 2 Level-1 products on 01.02.2014, 12.02.2018 and 10.02.2023, Figure 3.

<figure><img src="image_5.png" /><figcaption>Fig. 3 Data: three Landsat OLI/TIRS satellite images (February 2014, February 2018 and February 2023) in natural colors covering study area in Guinea. Data source: USGS</figcaption></figure>
First, the colour composite were made using three different combinations of the Landsat bands, Figure 4. including aerosol channel is based on the following combination of bands: Band B07 as the Red channel, Band B05 in the Green channel, and Band B01 in the blue channel; False Colour Composite (FCC) of the Landsat 8 OLI/TIRS images consists of the following bands: Band B05 as the Red channel, Band B04 in the Green channel, and Band B03 in the blue channel; Natural Colour Composite (NCC) a band combination of Red (4), Green (3), and Blue (2), Figure 4.

<figure><img src="image_6.png" /><figcaption>**Fig. 4** Colour composites of the Landsat images covering study area: Left: false colour composite with aerosol channel (7-5-1); centre: false colour composite (bands 5-4-3) right: natural colour composite (bands 4-3-2)</figcaption></figure>

Then, the images were processed using GRASS GIS software using k-means clustering approach and scripting techniques, as shown in Appendix.

## 2.2. GRASS GIS workflow

This study uses the GRASS GIS as a software for image processing, and QGIS and GMT for cartographic visualization of topographic and thematic maps. The topographic map was done using techniques of GMT [17]-[18]. There are key differences between supervised and machine-based classification methods with regard to information extraction.

The data obtained from automated approach is extracted from images using machine-based approach and has objectively separated classes discriminated by computer vision algorithms. In contract, human-based classification often relies on subjective decision that many typical approaches use. In view of this, automated recognition of images by the machine identified a number of locations (such as landscape patches) along the path by the analysis of pixel's spectral properties. In such a way, the method presents a precise approach for remote sensing data processing using GIS. In this study, we use the automated classification approach of GRASS GIS for image processing with scripts presented in the Appendix of this manuscript.

Initially, the data were imported as raster files into a GRASS GIS project using GDAL library and reprojects on the fly using module r.import. Then, modules 'i.cluster' and 'i.maxlik' were utsed to retrieve information regarding the spectral reflectance and convert it into the components of land cover classes. The features of these characteristics are generally associated with various parameters of landscape patches, such as brightness due to albedo, greenness and wetness of leaves, as well as moisture of vegetation and soil, especially for comparison between northern savannah regions and coastal areas. First, the images were classified into 18 classes according to the FAO classification, Figure 5.
<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /><figcaption>**Fig. 5** Classified images of the coastal region of Guinea (Conakry and surroundings) on 2014, 2018 and 2023 performed in GRASS GIS (18 classes)</figcaption></figure>

Afterwards, the data were upscaled to 10 classes according to the land cover features available in the coastal region of Conakry, Figure 6. The difference in images illustrates changes in land cover types caused by the natural and anthropogenic processes in Guinea.

<figure><img src="image_9.png" /><figcaption>**Fig. 6** Classified images of the coastal region of Guinea (Conakry and surroundings) on 2014, 2018 and 2023 performed in GRASS GIS (10 classes)</figcaption></figure>

## 2.3. Accuracy assessment

The accuracy assessment was performed using estimated output of pixels in the raster map holding reject threshold results, available in the maximum-likelihood discriminant analysis classifier. The statistical kappa parameter has been calculated using r.kappa for computing the error matrix and kappa parameter for evaluating classification result. The visualised output raster map with rejection probability values of pixel classification confidence levels is presented in Figure 7.

<figure><img src="image_10.png" /><figcaption>**Fig. 7** Accuracy assessment of the pixels allocation to land cover classes for classified images on 2014, 2018 and 2023, performed in GRASS GIS</figcaption></figure>
The tables of the estimated clustering matrices are available in the GitHub (rep_clust_L8_2014_10classes.txt, rep_clust_L8_2014_10classes, rep_clust_L8_2023_10classes.txt) with the results of the classification reports: https://github.com/paulinelemenkova/GRASS_GIS_Image Processing_Guinea_Scripts-

## 3. RESULTS AND SIGNIFICANCES

The spatial analysis of the three satellite images was developed using GRASS GIS scripts. The most important feature of this approach is writing a script that operates the functional modules of the GRASS GIS similar to the programming languages. Through the key commands shown in script in Appendix, the satellite images were processed, classified and visualised. For identifying 18 land-cover classes, FAO-based and pixel-based classification of Landsat data yielded an overall classification accuracy after 10 iterations of 98.1% for 2014 (kappa: 0.821), 98.03% for 2018 (kappa: 0.814) and 98.4% for 2023 with kappa: 0.858. Hence, for identifying 10 land-cover classes, GRASS GIS based computer vision classification of remote sensing data yielded an overall high accuracy due to high automation through scripting. The full scripts are available in the GitHub of the author with provided link.

## 4. CONCLUSIONS

The land cover types forming the system of landscapes over Guinea was evaluated by purposefully selected landscape patches identified automatically by GRASS GIS during image classification. The selection criteria included spectral brightness of the land cover patches as reflected on the images and homogeneity of the polygons. Spectral reflectance of pixels in the satellite images represents the landscape patch components which predominantly characterize Earth's surface properties. Hence, a comprehensive evaluation of remote sensing data using GIS enables to analyse environmental trends using digital approaches. Using GRASS GIS codes, multispectral Landsat-9 have been processed, classified, analysed and compared for evaluation of landscape dynamics in Guinea, Africa. The results demonstrated land cover changes during recent decade, since 2014 until 2023.

## APPENDIX

Script of GRASS GIS used for satellite image processing of the coastal region of Guinea and surrounding of Conakry (example of 2014):

g.mapset location=Guinea_2014 mapset=PERMANENT
g.list rast
r.import
input=/Users/polinalemenkova/grassdata/Guinea_2014/LC08_L2SP_202053_20140201_20200912_02_T1
_SR_B1.TIF output=L8_2014_01 resample=bilinear extent=region resolution=region
# repeated likewise for other Landsat OLI-TIRS bands
g.list rast
g.region raster=L8_2014_01 -p
i.group group=L8_2014 subgroup=30m input=L8_2014_01,<...>,L8_2014_07
i.cluster group=L8_2014 subgroup=30m \
signaturefile=cluster_L8_2014 classes=18 reportfile=rep_clust_L8_2014.txt
i.maxlik group=L8_2014 subgroup=30m signaturefile=cluster_L8_2014 \
output=L8_2014_cluster_classes reject=L8_2014_cluster_reject
d.mon wx0
g.region raster=L8_2014_cluster_classes -p
rcolors L8_2014_cluster_classes color=roygbiv -e
d.rast L8_2014_cluster_classes
d.legend raster=L8_2014_cluster_classes title="2014 February 01"
d.out.file output=Guinea_2014 format=jpg
d.mon wx1
g.region raster=L8_2014_cluster_classes -p
rcolors L8_2014_cluster_reject color=bcyr -e
d.rast L8_2014_cluster_reject
d.legend raster=L8_2014_cluster_reject title="2014 February 01" border_color=white
d.out.file output=Guinea_2014_reject format=jpg
r.composite blue=L8_2014_03 green=L8_2014_04 red=L8_2014_05 output=L8_2014
d.out.file output=Guinea_fcc format=jpg

5. REFERENCES

[1] Nyerges, A.E. and Green, G.M. (2000), *The Ethnography of Landscape: GIS and Remote Sensing in the Study of Forest Change in West African Guinea Savanna*. American Anthropologist, 102: 271-289. https://doi.org/10.1525/aa.2000.102.2.271

[2] Lemenkova, P., (2023), *Monitoring Seasonal Fluctuations in Saline Lakes of Tunisia Using Earth Observation Data Processed by GRASS GIS*. Land, 12(11), 1995. https://doi.org/10.3390/land12111995

[3] Leach, M. and Fairhead, J. (1994), *Natural Resource Management: the Reproduction and Use of Environmental Misinformation in Guinea's Forest-Savanna Transition Zone*, IDS Bulletin, 25: 81-87. https://doi.org/10.1111/j.1759-5436.1994.mp25002008.x

[4] Lemenkova, P., (2023), *A GRASS GIS Scripting Framework for Monitoring Changes in the Ephemeral Salt Lakes of Chotts Melrhir and Merouane, Algeria*. Applied System Innovation, 6(4), 61. https://doi.org/10.3390/asi6040061

[5] Lemenkova P., (2022), *Mapping Climate Parameters over the Territory of Botswana Using GMT and Gridded Surface Data from TerraClimate*, ISPRS International Journal of Geo-Information, 11(9), 473. https://doi.org/10.3390/ijgi11090473

[6] Lemenkova, P., (2020), *GRASS GIS for topographic and geophysical mapping of the Peru-Chile Trench*. Forum geografic, 19(2), 143-157 https://doi.org/10.5775/fg.2020.009.d

[7] Gupta, R., Kumar, S., Gupta, A., (2022), *Application of Convolution Neural Network for Cloud Shadows Removal in Landsat Imagery*, 2022 IEEE International Conference on Current Development in Engineering and Technology (CCET), Bhopal, India, pp. 1-8, https://doi.org/10.1109/CCET56606.2022.10080513

[8] Cuartero, A., Paoletti, M. E., Presas, A. R., Haut, J. M., (2022), *Bi-Dimensional Vector Data Analysis of Positional Accuracy of Landsat-8 Image with Pycircularstats*. IGARSS 2022 - 2022 IEEE International Geoscience and Remote Sensing Symposium, Kuala Lumpur, Malaysia, 2442-2445, https://doi.org/10.1109/IGARSS46834.2022.9883588

[9] Adugna, T., Xu, W., Haitao, J., Fan, J., (2022), *Comparison of FY-3C VIRR and MODIS Time-Series Composite Data for Regional Land Cover Mapping of a Part of Africa*. IGARSS 2022 - 2022 IEEE International Geoscience and Remote Sensing Symposium, 3163-3166, https://doi.org/10.1109/IGARSS46834.2022.9884244

[10] Lemenkova, P., Debeir, O., (2023), *Multispectral Satellite Image Analysis for Computing Vegetation Indices by R in the Khartoum Region of Sudan, Northeast Africa*. Journal of Imaging, 9(5), 98. https://doi.org/10.3390/jimaging9050098
[11] Lemenkova, P, Debeir, O., (2022), *R Libraries for Remote Sensing Data Classification by K-Means Clustering and NDVI Computation in Congo River Basin*, DRC. Applied Sciences, 12(24),12554. https://doi.org/10.3390/app122412554

[12] Lemenkova P, Debeir O. (2022), *Satellite Image Processing by Python and R Using Landsat 9 OLI/TIRS and SRTM DEM Data on Côte d'Ivoire, West Africa*. Journal of Imaging; 8(12):317. https://doi.org/10.3390/jimaging8120317

[13] Lemenkova P, Debeir O., (2023), *Computing Vegetation Indices from the Satellite Images Using GRASS GIS Scripts for Monitoring Mangrove Forests in the Coastal Landscapes of Niger Delta, Nigeria*. Journal of Marine Science and Engineering.; 11(4):871. https://doi.org/10.3390/jmse11040871

[14] Sylla, L., Xiong, D., Zhang, H.Y., Bangoura, S.T., (2012), *A GIS technology and method to assess environmental problems from land use/cover changes: Conakry, Coyah and Dubreka region case study*. The Egyptian Journal of Remote Sensing and Space Science, 15(1), 31-38. https://doi.org/10.1016/j.ejrs.2011.12.002

[15] Diallo, I. D., Tilioua, A., Darraz, C., Alali, A., Sidibe, D., (2023), *Study and analysis of seasonal soil degradation in Lower Guinea and Forest Guinea*. Results in Engineering, 19, 101381. https://doi.org/10.1016/j.rineng.2023.101381

[16] Mering, C., Baro, J., Upegui, E., (2010), *Retrieving urban areas on Google Earth images: application to towns of West Africa*, International Journal of Remote Sensing, 31:22, 5867-5877, https://doi.org/10.1080/01431161.2010.512311

[17] Lemenkova, P., (2022), *Cartographic scripts for seismic and geophysical mapping of Ecuador*. Geografie, 127, 195-218. https://doi.org/10.37040/geografie.2022.006

[18] Lemenkova, P., (2022), *Console-Based Mapping of Mongolia Using GMT Cartographic Scripting Toolset for Processing TerraClimate Data*. Geosciences, 12(3), 140. https://doi.org/10.3390/geosciences12030140

**Note:**

**Polina Lemenkova**- Universität Salzburg, Fakultät für Digitale und Analytische Wissenschaften, Fachbereich Geoinformatik (University of Salzburg, Faculty of Digital and Analytical Sciences, Department of Geoinformatics), Schillerstraße 30, A-5020 Salzburg, Austria; Tel.: +43-677-6173-2772, e-mail: polina.lemenkova@plus.ac.at)