# Mapping Wetlands of Kenya Using Geographic Resources Analysis Support System (GRASS GIS) with Remote Sensing Data

Polina Lemenkova

► To cite this version:

Polina Lemenkova. Mapping Wetlands of Kenya Using Geographic Resources Analysis Support System (GRASS GIS) with Remote Sensing Data. Transylvanian Review of Systematical and Ecological Research, 2023, The Wetlands Diversity, 25 (2), pp.1-18. 10.2478/trser-2023-0008. hal-04163212

HAL Id: hal-04163212

https://hal.science/hal-04163212

Submitted on 17 Jul 2023

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
# MAPPING WETLANDS OF KENYA
USING GEOGRAPHIC RESOURCES ANALYSIS SUPPORT SYSTEM
(GRASS GIS) WITH REMOTE SENSING DATA

Polina LEMENKOVA *

DOI: 10.2478/trser-2023-0008

**KEYWORDS:** Africa, Kenya, wetlands, remote sensing, image processing, cartography, GRASS GIS.

## ABSTRACT

Monitoring wetlands of Kenya is critical for analysis of environmental changes since they present unique ecosystems with special hydrological balance and biodiversity. In this study, the Landsat 8-9 OLI/TIRS satellite images for 2015-2022 were classified using GRASS GIS scripts to evaluate changes in the Lorian Swamp wetland, north-eastern Kenya. The results of the image analysis presented maps of land cover changes including wetlands. The study demonstrated technical effectiveness of the GRASS GIS for image analysis, and contributed to the environmental monitoring of African wetlands.

**RÉSUMÉ:** Cartographie des zones humides du Kenya à l'aide de données de télédétection et de scripts de GRASS GIS.

La surveillance des zones humides du Kenya est essentielle pour l'analyse des changements environnementaux car elles présentent des écosystèmes uniques avec un équilibre hydrologique et une biodiversité particuliers. Dans cette étude, les images satellite Landsat 8-9 OLI/TIRS pour 2015-2022 ont été classées à l'aide de scripts SIG GRASS pour évaluer les changements dans la zone humide du marais de Lorian, au nord-est du Kenya. Les résultats de l'analyse d'images ont présenté des cartes des changements d'occupation du sol, y compris les zones humides. L'étude a démontré l'efficacité technique du SIG GRASS pour l'analyse d'images et a contribué à la surveillance environnementale en Afrique.

**REZUMAT:** Cartografierea zonelor umede din Kenya folosind date de teledetecție și scripturi GRASS GIS.

Monitorizarea zonelor umede din Kenya este esențială pentru analiza schimbărilor de mediu, deoarece acestea prezintă ecosisteme unice cu echilibru hidrologic și biodiversitate deosebite. În acest studiu, imaginile satelitului Landsat 8-9 OLI/TIRS pentru 2015-2022 au fost clasificate folosind scripturile GRASS GIS pentru a evalua schimbările din zona umedă Lorian Swamp, din nord-estul Keniei. Rezultatele analizei imaginii au prezentat hărți ale modificărilor acoperirii solului, inclusiv zonele umede. Studiul a demonstrat eficacitatea GIS GRASS pentru monitorizarea mediului în zonele umede africane.

<footnote>* Université Libre de Bruxelles (ULB), École Polytechnique de Bruxelles (Brussels Faculty of Engineering), Laboratory of Image Synthesis and Analysis, Campus du Solbosch, Building L, ULB-LISA CP165/57, Avenue Franklin D. Roosevelt 50, 1050 Brussels, Belgium, polina.lemenkova@ulb.be, ORCID: 0000-0002-5759-1089.</footnote>
INTRODUCTION

Water, a key resource and generator of secondary resources in the 21st century, is under high threats and risks of a number of stressors (Bănăduc et al. 2022). In Kenya, recent environmental changes led to negative processes which include land degradation, vegetation decline, fragmentation of landscape patterns, changed functionality (Gomes et al., 2023) and land cover changes (Balaka Opiyo et al., 2022). Recent studies on land cover change assessment in Kenya noticed the conversions of grassland and forestland to cropland, increase of cropland and built-up area and decrease of forest, grassland, and bare lands (Rotich et al., 2022). The overexploitation and land degradation in Lake Victoria basin of Kenya resulted in decline in wetlands, vegetated landscapes, and farm lands (Onyango and Opiy, 2022). Climate effects on the environmental sustainability arise from the increasing temperature and decreased precipitation which led to the increase in aridity and scarcity of water resources (Böhme et al., 2013; Goman et al., 2020; Lemenkova, 2022a,b). This results in changed vegetation patterns such as expansion of shrubs in areas earlier occupied by pastures, the distribution of gullies due to the erosional processes (Maua et al., 2022; Lemenkova, 2022b).

Wetland fishery potential depends on water level in lakes, owing to the effects of a decline of water depth during the dry season (Kipkemboi et al., 2007). Degraded examples of biodiversity in Kenya include alien species that contribute to the decline of endemics and increase in water and food insecurity. The integrated effects of all these climate-environmental factors increase and accelerate land degradation processes and environmental unsustainability. Rehabilitation and restoration of land and water resources is a complex process which takes time, resources, and efforts. Therefore, preventive mapping of land cover changes may contribute to the operative environmental monitoring in easter Africa.

Mapping land cover types as reliable identifiers of environmental changes presents an effective baseline for assessing land degradation and environmental sustainability (Lemenkova, 2023; Steinbach et al., 2023). Wetlands in Kenya present unique ecosystems with specific features of hydrology, soils, and vegetation patterns (Böhme et al., 2016). Wetlands play a key role in hydrological balance of water resources, maintain biodiversity as habitats for rare species, and have high potential in agricultural production (Leauthaud et al., 2013). As important transition zones between land and water areas, wetlands support cycling of nutrients and energy flow. Highly sensitive to changes in hydrology, wetland complexes also present valuable data for paleoenvironmental and paleoclimate reconstructions and climate modelling, since they represent the interrelation between terrestrial and lacustrine environments in the past (Kiage and Kam-biu Liu, 2099; Goman et al., 2017; Githumbi et al., 2021).

The study region focuses on the area of wetlands in the north-eastern Kenya (Fig. 1). The origin and formation of Kenyan wetlands has a deep connection with topographic, geomorphic, and geologic setting which in turn affect the climatic conditions and hydrologic regulations including the level of drainage (Job and Sieben, 2022). With this regard, the geology of the Kenyan Rift Valley has the most prominent impact on the distribution of lacustrine and wetland environments through the formation of small shallow lakes located in gently sloping depressions in the rift floor.

Wetland ecosystems of Kenya combine the characteristics of terrestrial and aquatic habitats with special features on water, soil, and vegetation types. These wetlands play a main hydro-ecological buffer role through protecting lake shallows from excessive sedimentation and eutrophication, controlling the growth of aquatic plant and algae. In this way, wetlands maintain the livelihoods of the riparian communities and ecosystems (Morrison et al., 2013).
<figure><img src="image_2.png" /><figcaption>Figure 1: Topographic map of Kenya with study area (red rotated square).</figcaption></figure>

Data source: GEBCO. Mapping: GMT scripting toolset.

Furthermore, wetlands play a critical role in biodiversity and ecosystem services in rural areas of Kenya, which are essential to health and welfare. Thus, disturbed patterns of water supply, stagnant water and storage may affect sanitation and hygiene (Anthonj et al., 2016, 2017, 2019). At the same time, due to the associated climate threats and anthropogenic challenges, wetlands in Kenya degrade and wetland landscapes become partially or completely lost at an increasing rate. Changes in wetland landscapes are triggered by several factors including human activity, changing river hydrology and climate-change-related coastal processes (Gitau et al., 2023). The wetland habitats lose will necessarily affect the distribution of wildlife species, and will have negative effects on livelihoods of the selected communities.
The hydrogeological parameters of soil such as permeability and plasticity, content of organic mass, granularity and viscosity affect water drainage in lakes and wetlands and regulate water circulation (stagnant waters in swamps versus currents in lakes). Nowadays, the region of the Kenyan Rift Valley forms a part of the large complex of the East African Rift System (Garcin et al., 2012; Michon et al., 2022; Lemenkova, 2022e), is presented by the Quaternary extrusive and intrusive rocks (Qv), outcrops of Tertiary (Ti) sediments (Fig. 2).

<figure><img src="image_3.png" /><figcaption>Figure 2: Geologic units, lithology and provinces in Kenya.</figcaption></figure>

Data source: geologic vector layers obtained from USGS.

Other units include Quaternary sediments, and occasional Jurassic outcrops. Such formation includes fine-grained caoline, montmorillonite, kaolinite, and illite as the principal clay minerals (Yurevich, 1979). The subsequent Cenozoic extension is recorded in northern Kenya in the Turkana-Lokichar rift zone (Torres Acosta et al., 2015). Active geologic development presented conditions for formation of volcanic and tectonic lakes of the eastern branch of the African Great Rift Valley which are notable by hydrological connectivity. Besides, volcanic activity generated endorheic basins (Fazi et al., 2018).

The Olorgesailie Formation in southern Kenya Rift Valley contains lacustrine, wetland and terrestrial facies formed during the last 1.2 M years. The remaining aquatic indicators, such as diatoms, fossils and rhizolith, evidence the presence of shallow fresh to mildly saline waters in Pleistocene in this region (Owen et al., 2009; Scott et al., 2008). Such geological setting creates favourable conditions for the formation of lakes and wetlands in Kenya. Here the depth of the valley affects the velocity of streams, river discharge and ground water storage with shallow basins that better correspond to the formation of wetlands and swamps. In turn, the topographic shape of valley reflects the geomorphic parameters and soil types.
The present paper aims at mapping changes in wetlands of Kenya over the recent decade. To this end, a series of the satellite images was used to reveal changes in land cover types occasioned by the intensive human activities which requires enhancing the protection of wetlands in Kenya. Depicting the dynamics in Kenya's wetlands using remote sensing data and GIS has been documented in existing papers (Kiage et al., 2007; Olang et al., 2011; Mwita et al., 2013; Mwaniki et al., 2017; Okotto-Okotto et al., 2018; Wanjala et al., 2020). However, these papers mostly use traditional methods of mapping such as GIS. In contrast, this study presents an advanced script-based approach by the GRASS GIS scripts. Scripts used in cartographic tasks significantly improve the mapping workflow through automation and programming (Lemenkova, 2019, 2021).

A specific focus of this study is placed on the Lorian Swamp. One of the important wetlands ecosystems of north-eastern Kenya, Lorian Swamp is situated on a vast floodplain (Fig. 3). The swamp is located in the arid zone with high mean annual temperatures and excessive evaporation. The swamp is fed by occasional rainfall which have a highly irregular pattern of occurrence due to the recurrent floods and drought (Mati et al., 2005). The effects from arid and semi-arid regions result in seasonal variations of the Lorian Swamp which is a subject to occasional droughts affecting its size, the extent and level of water. Thus, the swamp varies in area from almost zero to about 5.8 km² (Crafter et al., 1992).

<figure><img src="image_4.png" /><figcaption>Figure 3: Enlarged view of the Lorian swamp, Kenya, on the aerial image: USGS.</figcaption></figure>

The wetland area of the Lorian Swamp presents a vital resource for dry-season grazing as well as a sanctuary for the nomadic herds. Such climate setting creates unfavourable conditions for swamp ecosystem and affect its coverage and extent. Major water sources that fed the Lorian swamp include Ewaso Ng'iro North River with its tributaries originating in the slopes of Mountain Kenya and forming a river basin. Minor sources include seasonal wadis (Ministry of Environment and Mineral Resources, Kenya, 2012).
# MATERIAL AND METHODS

## Data

The data include two multispectral Landsat 8-9 OLI/TIRS satellite images covering target area of the Lorian swamp on 14 January 2015 and 28 January 2023 (Fig. 4). Technical characteristics common for both images are the following. The images are acquired from the USGS EarthExplorer repository with Landsat Collection Category T1 and Collection Number 2. The Landsat Worldwide Reference System (WRS) Path of the images is 167, the WRS Row is 59 which coincide with the target path and row of the satellite’s orbit. The Station Identifier is LGN; the images were taken during day period with Nadir on. The Data Type L2 is OLI_TIRS_L2SP for both of the scenes and Sensor Identifier is OLI_TIRS and Ground Control Points Version 5. The Product Map Projection L1 is Universal Transverse Mercator (UTM), Zone 37, Datum and Ellipsoid WGS84. The rest of the metadata is summarised in the table 1.

<figure><img src="image_5.png" /><figcaption>Figure 4: Remote sensing data (RGB) captured from the USGS EarthExplorer repository: Landsat 8-9 OLI/TIRS C2 L12 images. (a): 14 January 2015; (b): 28 January 2023.</figcaption></figure>

Satellite images contain repetitions of pixels arranged along the matrix structure of the raster with different brightness. This is illustrated in figures 5 and 6, which show the original Landsat OLI/TIRS scenes and the segments of the study area. Therefore, the analysis of the satellite images relies on the information containing spectral reflectance of the pixels corresponding to the land cover types on the Earth’s surface including wetlands.

The identification of the land cover types in general and wetlands in particular enables to collect information regarding the extent of these landscapes, while changes of contours over time enabled to assess the variations of the land cover types caused by the climate effects.
<table><caption>Table 1: Metadata of the two images Landsat 8-9 OLI/TIRS used in this study.</caption><thead><tr><th>Data Set Attribute</th><th>Attribute Value (2015)</th><th>Attribute Value (2023)</th></tr></thead><tbody><tr><td>Landsat Product Identifier L2</td><td>LC08_L2SP_167059_201501<br>14_20200910_02_T1</td><td>LC09_L2SP_167059_2023012<br>8_20230309_02_T1</td></tr><tr><td>Landsat Product Identifier L1</td><td>LC08_L1TP_167059_201501<br>14_20200910_02_T1</td><td>LC09_L1TP_167059_202301<br>28_20230309_02_T1</td></tr><tr><td>Landsat Scene Identifier</td><td>LC81670592015014LGN01</td><td>LC91670592023028LGN02</td></tr><tr><td>Date Acquired</td><td>2015/01/14</td><td>2023/01/28</td></tr><tr><td>Roll Angle</td><td>0.000</td><td>-0.001</td></tr><tr><td>Date Product Generated L2</td><td>2020/09/10</td><td>2023/03/09</td></tr><tr><td>Date Product Generated L1</td><td>2020/09/10</td><td>2023/03/09</td></tr><tr><td>Start Time</td><td>2015-01-14 07:35:58.666005</td><td>2023-01-28 07:36:21</td></tr><tr><td>Stop Time</td><td>2015-01-14 07:36:30.436001</td><td>2023-01-28 07:36:53</td></tr><tr><td>Land Cloud Cover</td><td>0.00</td><td>0.01</td></tr><tr><td>Scene Cloud Cover L1</td><td>0.00</td><td>0.01</td></tr><tr><td>GCP Model</td><td>866</td><td>791</td></tr><tr><td>Geometric RMSE Model</td><td>2.482</td><td>4.544</td></tr><tr><td>Geometric RMSE Model X</td><td>1.460</td><td>3.172</td></tr><tr><td>Geometric RMSE Model Y</td><td>2.008</td><td>3.254</td></tr><tr><td>Processing Software</td><td>LPGS_15.3.1c</td><td>LPGS_16.2.0</td></tr><tr><td>Sun Elevation L0RA</td><td>53.70218735</td><td>54.66787672</td></tr><tr><td>Sun Azimuth L0RA</td><td>130.48808928</td><td>125.24360389</td></tr><tr><td>TIRS SSM Model</td><td>FINAL</td><td>N/A</td></tr><tr><td>Satellite</td><td>8</td><td>9</td></tr><tr><td>Scene Center Lat DMS</td><td>1°26'47''N</td><td>1°26'46.90''N</td></tr><tr><td>Scene Center Long DMS</td><td>39°15'05.98''E</td><td>39°13'35.08''E</td></tr><tr><td>Corner Upper Left Lat DMS</td><td>2°29'29''N</td><td>2°29'28.93''N</td></tr><tr><td>Corner Upper Left Long DMS</td><td>38°13'44.90''E</td><td>38°12'07.74''E</td></tr><tr><td>Corner Upper Right Lat DMS</td><td>2°29'27.56''N</td><td>2°29'27.67''N</td></tr><tr><td>Corner Upper Right Long DMS</td><td>40°16'28.24''E</td><td>40°15'00.83''E</td></tr><tr><td>Corner Lower Left Lat DMS</td><td>0°23'36.67''N</td><td>0°23'36.67''N</td></tr><tr><td>Corner Lower Left Long DMS</td><td>38°13'47.42''E</td><td>38°12'10.37''E</td></tr><tr><td>Corner Lower Right Lat DMS</td><td>0°23'36.46''N</td><td>0°23'36.46''N</td></tr><tr><td>Corner Lower Right Long DMS</td><td>40°16'24.06''E</td><td>40°14'56.72''E</td></tr><tr><td>Scene Center Latitude</td><td>1.44639</td><td>1.44636</td></tr><tr><td>Scene Center Longitude</td><td>39.25166</td><td>39.22641</td></tr><tr><td>Corner Upper Left Latitude</td><td>2.49139</td><td>2.49137</td></tr><tr><td>Corner Upper Left Longitude</td><td>38.22914</td><td>38.20215</td></tr><tr><td>Corner Upper Right Latitude</td><td>2.49099</td><td>2.49102</td></tr><tr><td>Corner Upper Right Longitude</td><td>40.27451</td><td>40.25023</td></tr><tr><td>Corner Lower Left Latitude</td><td>0.39352</td><td>0.39352</td></tr><tr><td>Corner Lower Left Longitude</td><td>38.22984</td><td>38.20288</td></tr><tr><td>Corner Lower Right Latitude</td><td>0.39346</td><td>0.39346</td></tr><tr><td>Corner Lower Right Longitude</td><td>40.27335</td><td>40.24909</td></tr></tbody></table>
The colour composites were made using the GRASS GIS module "r.composite". The following code used for the false color composite: "r.composite blue = L8_2023_03 green = L8_2023_04 red = L8_2023_05 output = L8_2023rgb_FCC" (here, the example is given for the image of 2023, repeated likewise for 2015). The following code was used for generating the true color composite: "r.composite blue = L8_2023_02 green = L8_2023_03 red = L8_2023_04 output = L8_2023rgb_TCC".

The Landsat 8 true (or natural) color composite uses visible spectral bands where red corresponds for Band 4, green for Band 3 and blue for Band 2 in the respecting red, green, and blue spectral channels as color composites. This results in the image composed in a natural colored product, which is a representation of the Earth's landscapes on the photo image as naturally visible by human's eyes.

## Methods

The study utilizes the Geographic Resources Analysis Support System Geographic Information System (GRASS GIS) (Neteler and Mitasova, 2008; Neteler et al., 2008) as a major tool for cartographic data processing. The existing techniques and scripts of the GRASS GIS for mapping tasks were applied (Lemenkova, 2020). Image processing started from creating the color composites of the images which were generated for natural (true) and false colour composites (Figs. 5 and 6).

<figure><img src="image_6.png" /><figcaption>Figure 5: True color composites of the Landsat 8-9 OLI/TIRS images. (a) Bands composed from the image on 14.01.2015; (b) Bands composed from the image on 14.01.2015.</figcaption></figure>

To this end, the images were processed, visualised and saved as bitmap graphics using the following sequence of GRASS GIS commands and modules (here, the example for the false color composite): "d.mon wx0 g.region raster = L8_2023rgb_FCC -p d.rast L8_2023 rgb FCC d.out.file output = L8_2023 rgb FCC".

The false color composite with 5-4-3 band combination of the Landsat OLI/TIRS images is useful for monitoring plant density in wetlands and health monitoring of vegetation, since the chlorophyll contained in leaves of the plants strongly reflects NIR light while absorbing red, therefore the areas covered by vegetation are colored by bright red. In this way, the settlements and the areas of sparsely populated villages in the surroundings, as well as
exposed ground are coloured grey or tan/middle brown colors, while water appears blueish or black. In contrast, area covered by dense vegetation near the Lorian swamp is represented by bright red with differences visible for 2015 and 2023 (Fig. 6).

<figure><img src="image_7.png" /><figcaption>Figure 6: False color composites of the Landsat 8-9 OLI/TIRS images: Band B05 as the Red channel, Band B04 in the Green channel, and Band B03 in the blue channel. (a) Bands composed of the image on 28.01.2023; (b) Bands composed of the image on 28.01.2023.</figcaption></figure>

Spectral reflectance of the pixels that differ for each case visually breaks the satellite image as multi-color scene depending on colour composites of bands (e.g., false colour composites of true colour composites). The description and interpretation of the objects identified as various land cover types was based on the information on land cover types of Kenya obtained from the FAO. The annotations, descriptions, and locations of the land cover classes were performed for images of each target year. Creating the classes was possible using the “maximum-likelihood discriminant analysis classifier” due to the functionality of this algorithm which includes image discrimination techniques by clustering and the preceding procedure of k-means clustering. After the classification, the classes were annotated as objects and features including the extent of wetlands in Kenya for comparison in multiple years.

For a GRASS GIS-based environment, the commands are called using the following sequence of commands implemented by a sequence of modules. First, the module “r.import” calls a raster TIFF files and imports it to the working folder with bilinear resampling: “r.import input=/Users/polinalemenkova/grassdata/Kenya/LC09_L2SP_167059_20230128_20230309_0 2_T1_SR_B1.TIF output=L8_2023_01 resample=bilinear extent=region resolution=region --overwrite”. The imported data were checked by the “g.list rast” command. As explained earlier, before using the algorithm, according to established GRASS GIS techniques using a sequence of modules “i.group”, “i.cluster”, “i.maxlik” (Lemenkova, 2022d), the snippets of the Landsat OLI/TIRS data were first visualized in the USGS to evaluate data quality and to define the cloudiness of the scenes. Both the scenes were selected with the cloudiness lesser than 2% to ensure correct classification.
Afterwards, the metadata of the raster images were checked by the “r.info” module (e.g., r.info -r L8_2015_07), and “g.list rast” which was used for listing the imported raster files in the next step. Thereafter, the “i.group” modules was used to create the groups and subgroups of the Landsat bands to include visible spectral bands: “i.group group=L8_2023 subgroup res_30m input=L8_2023_01, <...>, L8_2023_07”. The following module “r support” command was used to define semantic labels for all Landsat OLI/TIRS bands by considering the number of bands in the image: “r support map=L8_2015_01 semantic label=OLI_1”.

The MaxLike algorithm embedded in the GRASS GIS classifies pixels into those below the threshold as the target class objects using the centroids of the clusters generated by the “i.cluster” module in previous step: “i.cluster group=L8_2023 subgroup res_30m signaturefile=cluster_L8_2023 classes=10 reportfile=rep_clust_L8_2023.txt --overwrite”. The rest of the image is classified automatically into the selected 10 target classes, based on the identified colour intensity of pixels. This is essentially done based on the discriminating of the breaks between the levels of the spectral reflectance of the pixels identified on the images and colour of the background of the Landsat OLI/TIRS scenes. The algorithm recognises spectral reflectance of the pixels and identifies those that do not reach the threshold level as not belonging to the target class and vice versa.

The procedure was performed using the “i.maxlike” algorithm, a commonly used robust method in the unsupervised classification of image processing to classify the cell spectral reflectances in imagery data as follows: “i.maxlike group=L8_2023 subgroup res_30m signaturefile=cluster_L8_2023 output=L8_2023_cl_classes reject=L8_2023_cl_reject”. The aim is to select the correct inlier correspondences of the pixels to the target classes given a set of the one-to-one matches. In this model, the algorithm uses the clusters generated previously as a signature file to fit the pixels into the target groups. Using the defined parameters, the pixels were discriminated against the groups of the centroids of clusters using the objects parameters defined in a threshold. The boolean array of cells was defined as a class in each case. Thus, pixels with values excessed the threshold indicated another land cover class different from the given one, while pixels within the given class were used for data processing. Similar to object recognition, the maximal classifier is used to define the threshold of objects parameters for identification of the land cover classes and wetlands as a target class.

The maps were plotted based on the implemented algorithm and the comparison of the actual land cover classes was performed within the several years. The image was partitioned using a threshold by assigning/rejecting pixels to/from the classed of land cover types. The object tracking was done iteratively until the Landsat image is classified and classes detected for the target region of Kenya. The procedure was repeated for each image for all the relevant years. Here, the commands used in the GRASS GIS workflow have the following meaning:

1. “g.region” – Lists the region of the images and sets region to match the scene;

2. “i.group” – Lists the necessary Landsat bands from visible spectrum available on Landsat band collection (the panchromatic and TIR are excluded);

3. “i.cluster” – Creates a new group of the classes using k-means clustering algorithm for a given image. It partitions the image and finds optimal parameters for pixels for a given target number of classes. The input signature file is generated for the following “i.maxlike” algorithm;

4. “r support” – Creates the semantic labels for repetitive entries for automation;

5. “i.maxlike” algorithm – Classified the image into land cover classes.
The classification of the images consists of training the algorithm of classifiers that discriminates pixels forming clusters from the spectral bands of the image, detecting their spectral reflectance, assigning to clusters according to the centroids. The clusters of the pixels are defined by a series of the automatic trial tests with defined parameters, changing pixels' distance to the centroids of the clusters and closeness to the centers of the clusters to reach optimal combination. Natural clusters of the land cover classes are based on the location or attribute values using the k-means algorithm embedded in the GRASS GIS. Plotting the classified maps is implemented using the "d.mon wx0" command by the "d.rast.leg L8_2014_cluster_classes" command that defines color legends and visualizes them on the maps.

## RESULTS AND DISCUSSION

Figures 7 and 8 show the images representing classes for each of the two images with the assigned land cover classes for various groups of pixels, number of pixels in a class and percentage of the correctly classified pixels represented in grey colour. The cluster groups used as empirical testing and training data during K-means algorithm for identification of optimal classes in the landscapes of north-east Kenya are groups of land cover types. The assignment was performed without the replacements and visualised as a continuous plot for both images (Figs. 7 and 8) to visually compare the outputs.

<figure><img src="image_8.png" /><figcaption>Figure 7: (a) Classification of the Landsat 8-9 OLI/TIRS on 14.01.2015 of the Lorian Swamp wetland, Kenya with pixels classified into 10 classes. (b) Rejection probability values for image on 14.01.2015 with pixel classification confidence levels.</figcaption></figure>

Land cover classification is applied to each image from the USGS. The clusters were optimized using the cycles of the k-means algorithm executed iteratively by the GRASS GIS until only the suitable pixels of the images are remained using the following parameters: number of clusters forming the scene, radius of pixel's neighborhood and threshold of colour intensity. Similar classes of the landscapes (tree cover: open, deciduous broadleaved, evergreen broadleaved, mixed type, unknown type, evergreen needle-leaved) defined by the k-means parameters were merged according to the landscape structure and resolution of the Landsat images (30 m) where combined classes signify the common type of the landscapes.
Each land cover class on the image was identified with dominated vegetation patterns crossing the landscapes and indicating the presence or absence of wetlands. This resulted in a series of the segments visualised assigned to the land cover classes as randomly coloured areas. The classified images were then converted to maps with added legends explaining the land cover types, computed correctness of the pixels assigned for data quality control, and compared with the original raster files of the Landsat 8-9 OLI/TIRS scenes. Quality control of the classified images was performed in pixels' level with identified examples (Figs. 7 and 8).

<figure><img src="image_9.png" /><figcaption>Figure 8: (a) Classification of the Landsat 8-9 OLI/TIRS on 28.01.2023 of the Lorian Swamp wetland, Kenya with pixels classified into 10 classes. (b) Rejection probability values for image on 28.01.2023 with pixel classification confidence levels.</figcaption></figure>

Here, the white colour signify the high rejection probability values with pixel classification confidence levels, while black to dark grey colours in the middle of the images signify the successfully classified pixels. Middle grey coloured pixels crossing the main image mean the successfully classified land cover classes, slant grey pixels mean the occasional pixels with occasional noise. The interpretation of the land cover classes and wetlands in Kenya by GRASS GIS approach performed well, while the overlapping of the neighboring classes required more attention when defining the parameters for automatic land cover class detection. The overlap cases existed between the two neighbor classes with similar spectral reflectance due to similar vegetation patterns. In these cases, border classes were reclassified. The correction of such cases was done semi-automatically by checking the border regions of land cover classes and ignoring the overlapped segments in the neighbouring classes.

The final data structure of the mosaic patterns in the north-eastern Kenya is presented by the areas of the 10 land cover classes. The presented maps were compared with the original raster TIFF files of the Landsat OLI/TIRS images for quality control and visual inspections in the GRASS GIS environment. The following 10 land cover classes were mapped using data adopted from ESA CCI-LC project derived from Kenya Land Degradation Neutrality Target Setting Final Report, Secretariat and the Global Mechanism of the UNCCD, based on UN Land Cover Classification System developed by FAO: 1) Cropland (rainfed and irrigated); 2) Wetlands, swamps and flooded areas; 3) Grassland; 4) Forests and tree cover (broadleaved,
evergreen); 5) Forests and tree cover (broadleaved, deciduous); 6) Mosaic natural vegetation of mixed leave type (broad-leaved and needle-leaved); 7) Shrubland (deciduous); 8) Settlements and urban areas; 9) Bare areas; 10) Water bodies.

For classification, we applied two possible algorithm steps provided by the GRASS GIS modules "i.cluster" and "i.maxlik" for fusing pixels into the structured land cover classes which represent a complex mosaic of the wetland landscapes in Kenya. A k-means clustering method was used for partition of the images into 10 classes using estimation of distance from each pixel to the cluster centroid. A more principled approach is presented by the "i.maxlik" module which selects the 10 cluster categories as land cover classes, and performs the assignment of pixels into these classes according to their spectral reflectance and spectral signature file generated earlier by the "i.cluster". Such sequence of the GRASS GIS modules demonstrated an integrated workflow concept for the task of vegetation objects detection, showing how structured classes support image classification process for multi-spectral imagery with a case of the Landsat scenes.

## CONCLUSIONS

Mapping land cover types is necessary to meet the environmental needs of the sustainable development in Africa. It is usefull for monitoring land resources to support ecosystem in Kenya. Here, we presented a way to integrate remote sensing data and process them using GRASS GIS scripts for the task of image classification, analysis and monitoring landscape changes. In particular, we incorporated the clustering technique by k-means using "i.cluster" module in the training process of image partition. The module "i.maxlik" enabled to assign pixels into valid land cover classes and perform image partition according to adjacent object categories. During image classification, a topological description of the land cover classes by FAO was adopted for a selected region in the Lorian swamp surroundings for exploring structured pattern of the land cover types in the north-eastern Kenya.

Scripting algorithm of GRASS GIS provides classification more accurate and faster than the GIS tools, since the processing of one image takes few seconds. Such performance is achieved due to automation of image processing through the GRASS GIS scripting approach. Image capture from the USGS format was performed using the EarthExplorer repository which enables the repeatability of the workflow in similar projects. We demonstrated the sequential use of several modules of the GRASS GIS. Selecting visual spectral Landsat bands was performed by "i.group"; assigning semantic labels was done by "r support"; "i.cluster" was used for image partition by k-means clustering algorithm, and the unsupervised classification by the maximum likelihood discriminant analysis classifier was implemented by "i.maxlik".

To classify the Landsat imagery using GRASS GIS scripts, we used a workflow in GRASS GIS interface and several modules as described and explained in the Methodology section. The GRASS GIS modules were used as a sequence of separate tools to run the GRASS GIS scripts on the MacOS machine through a high-level scripting language of GRASS GIS, with an example for the images covering Lorian swamp, north-east Kenya. The workflow consisted of the following steps: image capture and preprocessing, grouping and sorting data by "i.group", creating semantic labels by "r support", clustering by "i.cluster" module, "classification by i.maxlike" module, plotting, analysis and visualization of the completed images by "d.mon" and "d.legend" modules of the GRASS GIS. The cartographic workflow in the GRASS GIS scripting environment for classification of the satellite images included running the scripts of the GRASS GIS algorithm.
Two sensors were tested for image analysis with OLI-8 sensor for image on 2015 and OLI-9 sensor for image on 2023. We provided GRASS GIS scripting for both of them: clustering by k-means and maximum-likelihood classification for detecting changes in wetland and decline of vegetation. The GRASS GIS approach demonstrated superior results when compared to traditional GIS due to the high level of automation by scripts which resulted in higher speed and accuracy of image classification. We compared the results of classification based on the GRASS GIS algorithm and the existing state-of-the-art land cover maps of Kenya with an example of GIS performed through both digitizing the landscapes and remote sensing data processing, as well as technical assessment of image analysis. The performance of the GRASS GIS demonstrated effective approach to classification of the land cover classes aimed to find changes in vegetation patterns over the Lorian swamp wetlands, north-eastern Kenya. The study contributed to the environmental monitoring of wetlands by mapping Lorian Swamp area of Kenya, east Africa using GRASS GIS scripts for remote sensing data processing.
ACKNOWLEDGEMENTS

The author thanks the reviewers for reading and commenting on this manuscript.
REFERENCES

1. Anthonj C., Rechenburg A. and Kistemann T., 2016 – Water, sanitation and hygiene in wetlands. A case study from the Ewaso Narok Swamp, Kenya, *International Journal of Hygiene and Environmental Health*, 219, 7, A, 606-616.

2. Anthonj C., Rechenburg A., Höser C. and Kistemann T., 2017 – Contracting infectious diseases in Sub-Saharan African wetlands: A question of use? A review, *International Journal of Hygiene and Environmental Health*, 220, 7, 1110-1123.

3. Anthonj C., Diekkrüger B., Borgemeister C. and Kistemann T., 2019 – Health risk perceptions and local knowledge of water-related infectious disease exposure among Kenyan wetland communities, *International Journal of Hygiene and Environmental Health*, 222, 1, 34-48.

4. Balaka Opiyo S., Opinde G. and Letema S., 2022 – Dynamics and drivers of land use and land cover changes in Migori River Watershed, western Kenya region, *Watershed Ecology and the Environment*, 4, 219-232.

5. Bănăduc D., Simić V., Cianfaglione K., Barinova S., Afanasyev S., Öktener A., McCall G., Simić S. and Curtean-Bănăduc A., 2022 – Freshwater as a sustainable resource and generator of secondary resources in the 21st century: stressors, threats, risks, management and protection strategies, and conservation approaches, *International Journal of Environmental Research and Public Health*, 19, 16570, 1-30, 10.3390/ijerph193416570.

6. Böhme B., Becker M. and Diekkrüger B., 2013 – Calibrating a FDR sensor for soil moisture monitoring in a wetland in Central Kenya, *Physics and Chemistry of the Earth, Parts A/B/C*, 66, 101-111.

7. Böhme B., Becker M., Diekkrüger B. and Förch, G. 2016 – How is water availability related to the land use and morphology of an inland valley wetland in Kenya? *Physics and Chemistry of the Earth, A/B/C*, 93, 84-95.

8. Crafter S. A., Njuguna S. G. and Howard G. W., 1992 – Wetlands of Kenya. Proceedings of the KWWG Seminar on Wetlands of Kenya, National Museums of Kenya, Nairobi, Kenya, 3-5 July 1991, The IUCN Wetlands Programme.

9. Fazi S., Butturini A., Tassi F., Amalfitano S., Venturi S., Vazquez E., Clokie M., Wanjala S. W., Pacini N. and Harper D. M., 2018 – Biogeochemistry and biodiversity in a network of saline-alkaline lakes: implications of ecohydrological connectivity in the Kenyan Rift Valley, *Ecohydrology & Hydrobiology*, 18, 2, 96-106.

10. Gitau P. N., Duvail S. and Verschuren D., 2023 – Evaluating the combined impacts of hydrological change, coastal dynamics and human activity on mangrove cover and health in the Tana River delta, Kenya, *Regional Studies in Marine Science*, 61, 102898.

11. Garcin Y., Melnick D., Strecker M.R., Olago D. and Tiercelin J.-J., 2012 – East African mid-Holocene wet-dry transition recorded in palaeo-shorelines of Lake Turkana, northern Kenya Rift, *Earth and Planetary Science Letters*, 331-334.

12. Githumbi E. N., Courtney Mustaphi C. J. and Marchant R., 2021 – Late Pleistocene and Holocene Afromontane vegetation and headwater wetland dynamics within the Eastern Mau Forest, Kenya, *Journal of Quaternary Science*, 36, 239-254.

13. Goman M., Ashley G. M., Owen R. B. and Maharjan D. K., 2017 – Late Holocene environmental reconstructions from Lake Solai, *The Professional Geographer*, 69, 3, 438-454.

14. Goman M. F., Ashley G. M., Owen R. B., Driese S. G., Muasya A. M. and Hover V. C., 2020 – A high-resolution climate history of geochemical and biological proxies from a tropical freshwater wetland located in the Kenyan Rift Valley, *Journal of African Earth Sciences*, 162, 103703.

15. Gomes M., Ralph T. J., Helander C. and Humphries M. S., 2023 – Landscape connectivity dynamics of the transboundary Mara River catchment, East Africa, and implications for river and wetland response in a globally important conservation region, *Catena*, 228, 107148.
16. Job N. M. and Sieben E. J. J., 2022 – Factors controlling wetland formation, Chapter 2, in Dalu T. and Wasserman R. J., Fundamentals of tropical freshwater wetlands, Elsevier, 25-41.

17. Kiage L. M., Liu K. B., Walker N. D., Lam N. and Huh O. K., 2007 – Recent land-cover/use change associated with land degradation in the Lake Baringo catchment, Kenya: evidence from Landsat TM and ETM+, *International Journal of Remote Sensing*, 28,19, 4285-4309.

18. Kiage L. M. and Kam-biu L., 2009 – Paleoenvironmental changes in the Lake Baringo Basin, Kenya, East Africa Since AD 1650: Evidence from the Paleorecord, *The Professional Geographer*, 61, 4, 438-458.

19. Kipkemboi J., van Dam A. A., Mathooko J. M. and Denny P., 2007 – Hydrology and the functioning of seasonal wetland aquaculture-agriculture systems (Fingerponds) at the shores of Lake Victoria, Kenya, *Aquacultural engineering*, 37, 3, 202-214.

20. Leauthaud C., Duvail S., Hamerlynck O., Paul J.-L., Cochet H., Nyunja J., Albergel J. and Grünberger O., 2013 – Floods and livelihoods: The impact of changing water resources on wetland agro-ecological production systems in the Tana River delta, Kenya, *Global Environmental Change*, 23, 1, 252-263.

21. 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.

22. Lemenkova P., 2022a – 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.

23. Lemenkova P., 2022b – Mapping Ghana by GMT and R scripting: advanced cartographic approaches to visualize correlations between the topography, climate and environmental setting, *Advances in Geodesy and Geoinformation*, 71, 1, e16.

24. Lemenkova P., 2022c – Console-Based mapping of Mongolia Using GMT Cartographic Scripting Toolset for Processing TerraClimate Data, *Geosciences*, 12, 140.

25. Lemenkova P. 2022d – GRASS GIS Scripts for Satellite Image Analysis by Raster Calculations Using Modules r.mapcalc, d.rgb, r.slope aspect, *Tehnicki Vjesnik*, 29, 6, 1956-1963.

26. Lemenkova P., 2022e – Tanzania Craton, Serengeti Plain and Eastern Rift Valley: mapping of geospatial data by scripting techniques, *Estonian Journal of Earth Sciences*, 71, 2, 61-79.

27. Lemenkova P., 2021 – Geophysical mapping of Ghana using advanced cartographic tool GMT, *Kartografija i Geoinformacije*, 20, 36, 16-37.

28. Lemenkova P., 2020 – GRASS GIS for topographic and geophysical mapping of the Peru-Chile Trench, *Forum geografic*, XIX, 2, 143-157.

29. Lemenkova P., 2019 – Automatic data processing for visualising Yap and Palau Trenches by Generic Mapping Tools, *Cartographic Letters*, 27, 2,72-89.

30. Mwita E., Menz G., Misana S., Becker M., Kisanga D. and Boehme, B., 2013 – Mapping small wetlands of Kenya and Tanzania using remote sensing techniques, *International Journal of Applied Earth Observation and Geoinformation*, 21, 173-183.

31. Maua J. O., Mbuvi M. T. E., Matiku P., Munguti S., Mateche E. and Owili M., 2022 – The difficult choice – to conserve the living filters or utilizing the full potential of wetlands: Insights from the Yala swamp, Kenya, *Environmental Challenges*, 6, 100427.

32. Michon L., Famin V. and Quidelleur X., 2022 – Evolution of the East African Rift System from trap-scale to plate-scale rifting, *Earth-Science Reviews*, 231, 104089.

33. Ministry of Environment and Mineral Resources, Kenya, 2012 – Kenya Wetlands Atlas, Government of Kenya Publication, Progress Press Co Ltd, Malta, ISBN: 978-9966-21-178-1.

34. Morrison E. H. J., Upton C., Pacini N., Odhiambo-K'oyoh K. and Harper D. M., 2013 – Public perceptions of papyrus: community appraisal of wetland ecosystem services at Lake Naivasha, Kenya, *Ecohydrology and Hydrobiology*, 13, 2, 135-147.
35. Mwaniki M. W., Kuria D. N., Boitt M. K. and Ngigi T. G., 2017 – Image enhancements of Landsat 8 (OLI) and SAR data for preliminary landslide identification and mapping applied to the central region of Kenya, *Geomorphology*, 282, 162-175.

36. Neteler M. and Mitasova H., 2008 – Open Source GIS – A GRASS GIS Approach, 3 ed., Springer: New York, NY, USA.

37. Neteler M., Beaudette D. E., Cavallini P., Lami L. and Cepicky J., 2008 – GRASS GIS, in Open Source Approaches in Spatial Data Handling, 865 Springer Berlin Heidelberg: Berlin, Heidelberg, 171-199.

38. Okotto-Okotto J., Raburu P. O., Obiero K. O., Obwoyere G. O., Mironga J. M., Okotto L. G. and Raburu E. A., 2018 – Spatio-temporal impacts of Lake Victoria level recession on the Fringing Nyado Wetland, Kenya, *Wetlands*, 38, 1107-1119.

39. Olang L. O., Kundu P., Bauer T. and Fürst J., 2011 – Analysis of spatio-temporal land cover changes for hydrological impact assessment within the Nyando River basin of Kenya, *Environmental Monitoring and Assessment*, 179, 389-401.

40. Onyango D. O. and Opiy S. B., 2022 – Detection of historical landscape changes in Lake Victoria Basin, Kenya, using remote sensing multi-spectral indices, *Watershed Ecology and the Environment*, 4, 1-11.

41. Owen B. R., Renaut R. W., Scott J. J., Potts R. and Behrensmeyer A. K., 2009 – Wetland sedimentation and associated diatoms in the Pleistocene Olorgesailie Basin, southern Kenya, *Rift Valley, Sedimentary Geology*, 222, 1-2, 124-137.

42. Rotich B., Kindu M., Kipkulei H., Kibet S. and Ojwang D., 2022 – Impact of land use/land cover changes on ecosystem service values in the cherangany hills water tower, Kenya, *Environmental Challenges*, 8, 100576.

43. Scott J. J., Renaut R. W. and Owen R. B., 2008 – Preservation and paleoenvironmental significance of a footprinted surface on the Sandai Plain, Lake Bogoria, Kenya, *Rift Valley, Ichnos*, 15, 3-4, 208-231.

44. Steinbach S., Hentschel E., Hentze K., Rienow A., Umulisa V., Zwart S. J. and Nelson A., 2023 – Automatization and evaluation of a remote sensing-based indicator for wetland health assessment in East Africa on national and local scales, *Ecological Informatics*, 75, 102032.

45. Torres Acosta V., Bande A., Sobel E. R., Parra M., Schildgen T. F., Stuart F., and Strecker M. R., 2015 – Cenozoic extension in the Kenya Rift from low-temperature thermochronology: Links to diachronous spatiotemporal evolution of rifting in East Africa, *Tectonics*, 34, 2367-2386.

46. Yurevich, R. F., 1979 – Modern sediments and sedimentary processes in Lake Rudolf (Lake Turkana) eastern Rift Valley, Kenya. Modern sediments and sedimentary processes in Lake Rudolf (Lake Turkana) eastern Rift Valley, Kenya, *Sedimentology*, 26, 313-331.

47. Wanjala J. A., Sichangi A. W. Mundia C. N. and Makokha G. O., 2020 – Modelling the dry season inundation pattern of Yala Swamp in Kenya, *Modeling Earth Systems and Environment*, 6, 2091-2101.