Defining Water Turbidity in River Nile, Cairo Using AI
Multiple clicks just got simplified using AI?
- Published
- Reading time
- 10 min
- Place
- Cairo, Egypt
- By
- Jannat Khosla

River Nile flows directly through the city of Cairo. As much as scenic beauty it gives to the city, it may also face certain environmental issues. The specific turbidity issues of the Nile River as it flows through the Greater Cairo area represent a complex, multi-faceted environmental challenge. While the Aswan High Dam upstream captures a massive portion of the river’s historical natural silt and sediment flux, localized human activities, urban dynamics, and systemic infrastructure gaps in the capital city drive severe spikes in local turbidity and Total Suspended Solids (TSS). [1]
Turbidity is the measure of relative clarity of a liquid. It is an optical characteristic of water and is a measurement of the amount of light that is scattered by material in the water when a light is shined through the water sample. The higher the intensity of scattered light, the higher the turbidity. Materials that cause water to be turbid include clay, silt, very tiny inorganic and organic matter, algae, dissolved colored organic compounds, and plankton and other microscopic organisms. [2]
Water turbidity index analysis is a powerful, decision-oriented approach that converts raw water quality measurements into actionable insights for policymakers, planners, and environmental managers, and it is widely applied in hydrology, environmental monitoring, and GIS-based water resource management. In particular, the Normalized Difference Turbidity Index (NDTI) plays a critical role in detecting suspended sediments and assessing water clarity using remote sensing data. In this study, Sentinel-2 Level-2A (Surface Reflectance) imagery processed and atmospherically corrected by the European Space Agency through the Sen2Cor algorithm was utilized. The workflow includes water body extraction to ensure turbidity is only measured over water surfaces, and subsequent computation of the turbidity index. The NDTI is calculated using the formula: NDTI=(R_red-R_green)/(R_red+R_green) where R_red and R_green represent the reflectance values in the red and green spectral bands, respectively.
And I wanted to answer one specific question- What percentage of water in River Nile, Cairo is turbid in today’s time when Aswan Dam is supposed to capture the natural silt that the river used to bring downstream before 1970?
Another interesting thing I came across was an AI Agent that would help me with answering this question.
TerraLab made it possible by building an AI Agent that works as a chatbot too inside the QGIS Application. If you have the QGIS from 3.28 and above- tell the tool to find relevant data, define analysis processing, what styling options to pick, and it will do all for you.

Search the Plugin in the Manage and Install Plugins in the QGIS. Search: “AI Agent by TerraLab”. Install it and login from the browser using your Email Id.
The workflow followed
-
After successful Login, set the AI Permissions. I wanted to use “Ask First” because it’s my first time trying this tool and wanted to understand its workflow from top to bottom.

-
Search the dataset required. Navigate to the Data tab in the agent. Another window opens and select your data.


-
The dataset used here: Satellite and Imagery > Copernicus > Datasets > Sentinel 2 2021 Cloud free Satellite Picture, 10 m

-
Click once on the dataset and it pops up in the AI Chat. Calculate NDTI using the formula.
(Band_04_red – Band_03_green ) / (Band_04_red + Band_03_green ).Sentinel 2, Band 4- Red
Sentinel 2, Band 3- Green
Sentinel 2, Band 8- NIR
-
Here, the agent would ask a follow up question. This is important because this determines for what year you are trying to process the data. I wanted to use the data for the latest time period hence I chose the Recent Imagery. This Multiple Choice Type Question UI is convenient for the users to try.
Here, I would have appreciated for the Agent to ask me another question regarding the extent of the imagery to be used. Nevertheless, another prompt may be given to define the extent of the study area to be used. But it would be useful to have the agent ask me the follow up question regarding the same.

-
The agent processes the requests and adds the data layers as well as the results in the content pane. Give required permissions as it asks.


-
The NDTI in raster calculator was done by the Agent.

-
Changing the layer style. The Agent chooses a more contrasty style scheme. This is important because usually AI Agents learn from your patterns- what you like and don’t like in your work. This can be tested through doing different projects through the tool over time.


-
Asking the questions which I wanted to know along the way. The Agent is able to grasp what is asked and gives the answers. One important thing to note here is that- it runs python code to answer everything which is good because the answers aren’t random. They have been tested by the Agent first before it reaches the users.


-
Now, calculating NDWI using raster calculation, while giving relevant formula for the calculation.


-
Aligning the Rasters.


-
Masking the NDTI values on NDWI.

-
Further operations on the raster.


-
Final Analysis- Counting pixel values in each class > Calculating area in sq.m and sq km > Percentage of water turbidity in each class. Having the Agent do quantitative analysis was relatively easy. This helped me define the exact waters to their turbidity levels. I was able to define areas in sq.m and sq. km and also define the area percentage by giving the exact instructions to the Agent.







-
Making the final map layout: Making the map layout took longer than usual. Defining the instructions and follow up questions took most time. It is important to tell the Agent what exactly you want which I definitely underestimated earlier.





It can be clearly seen that 92% of the water in the chosen extent of the River Nile, Cairo falls in the Moderate Turbidity class between the NDTI ranges of -0.15 to 0.02 which suits the on-ground conditions as well. Aswan High Dam which was built in 1970 to stop the natural silt from coming downstream has significantly reduced the turbidity of the river. This could be tested if satellite imagery of the same scene was available before 1970.
Conclusion and what this means for future AI enabled GIS tasks?
In some of the prompts, I wanted to edit the prompt while the agent was working but the option to edit isn’t there so if you are planning to use this tool, think about the prompt and give the correct one otherwise you could make the changes later on too but that would also make the process a bit slow. I would have to give it to the AI Agent by TerraLab for developing this tool which makes the GIS processing much easier and faster.
An AI Agent doing the work all by itself- finding relevant data, reading instructions, running the python code and displaying outputs. This can be a ten plus addition to the existing QGIS workflow despite its existing limitations of mid-prompt editing and some relevant follow up questions. The limitations identified in this example are not a deal breaker but definitely something that can be looked upon to fix.
What I would like to genuinely test next is that do tools like AI Agent by TerraLab can help with other kinds of data? Does it work with complex vector data as well? Can it perform heavy tasks like network analysis or interpolation or even weighted overlay for example? Or was this exercise best suited to be performed by the tool? I am not sure yet and this is something that I would definitely try to answer before I decide how much of my work do I hand it over to agent to perform on its own without much intervention.
References
[1] Hegab, M. H., El Sayed, S. M., Ahmed, N. M., Abdel-Aal, E. I., Kassem, D. A., Gaber, K. M., Haroon, A. M., Abdel Gawad, S. S., Goher, M. E., & Hussian, A. M. (2025). Evaluating the spatial pattern of water quality of the Nile River, Egypt, through multivariate analysis of chemical and biological indicators. Scientific reports, 15(1), 7626. https://doi.org/10.1038/s41598-025-89982-2
Need this done for your own study area? Send me the area and what you need.
Cite this post
Khosla, J. (2026, November 4). Defining Water Turbidity in River Nile, Cairo Using AI. Jannat Khosla. https://jannatkhosla.com/blog/defining-water-turbidity-river-nile-cairo-ai
› BibTeX
@online{khosla2026defining,
author = {Khosla, Jannat},
title = {Defining Water Turbidity in River Nile, Cairo Using AI},
date = {2026-11-04},
url = {https://jannatkhosla.com/blog/defining-water-turbidity-river-nile-cairo-ai}
}

