# How to determine the rivers coordinates in the model grid from the geographical coordinates

**URL:** <https://forum.croco-ocean.org/t/how-to-determine-the-rivers-coordinates-in-the-model-grid-from-the-geographical-coordinates/509>\
**Category:** croco tools (pre/post-processing)\
**Tags:** CROCO-tools, matlab, grid\
**Created:** [December 4, 2023, 6:38am UTC](https://forum.croco-ocean.org/t/how-to-determine-the-rivers-coordinates-in-the-model-grid-from-the-geographical-coordinates/509 "2023-12-04T06:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bechir](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/bechir/32/263_2.png) [@Bechir](https://forum.croco-ocean.org/u/Bechir)\
**Post date:** [December 4, 2023, 6:38am UTC](https://forum.croco-ocean.org/t/how-to-determine-the-rivers-coordinates-in-the-model-grid-from-the-geographical-coordinates/509/1 "2023-12-04T06:38:08Z")

</div>

Dear CROCO-USERS,  
I have the geographical coordinates **(lon, lat)** of rivers, I would like to find the coordinates **(nx, ny)** in the model grid. How can I do it? Is there available script?  
I’m grateful for your help.

---

<div class="post-metadata">

**Author:** ![crisalas](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@crisalas](https://forum.croco-ocean.org/u/crisalas)\
**Post date:** [December 5, 2023, 3:13pm UTC](https://forum.croco-ocean.org/t/how-to-determine-the-rivers-coordinates-in-the-model-grid-from-the-geographical-coordinates/509/2 "2023-12-05T15:13:44Z")

</div>

Hi Bechir

The system that I use is quite manual, I use nestgui in matlab.

First I know the longitude and latitude of the river using Google Earth, then in Matlab I load the grid and look for the lon and lat closest to the river. Finally I open nestgui (Matlab) to go with the river tooling and position myself on the lon and lat found in the previous step, and I correct so that it is not in some corner of the grid, it is not on the land or in the sea.

I hope it helps you,

Regards

Cristian

---

<div class="post-metadata">

**Author:** ![Bechir](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/bechir/32/263_2.png) [@Bechir](https://forum.croco-ocean.org/u/Bechir)\
**Post date:** [December 8, 2023, 3:02am UTC](https://forum.croco-ocean.org/t/how-to-determine-the-rivers-coordinates-in-the-model-grid-from-the-geographical-coordinates/509/3 "2023-12-08T03:02:53Z")

</div>

Hi Cristian,  
Thank you for the reply,  
I also use a manual method. I simply plot the lon lat of rivers on model grid and then pick the corresponding i an j.  
A new plot with the mask to see if they are in the see!  
The manual method could work when we have 2-3 rivers, but if the number of rivers becomes like 100, an atraumatic method is requested.  
My Best Regards  
Bechir
