Community header

Forum

Grid Generation from a real map

BY
Burhan Yildiz, modified 8 Months ago.

Grid Generation from a real map

Keen Forecaster Posts: 7 Join Date: 8/7/20 Recent Posts
Hi everyone,
I am trying to model a river by using Delft3D. I gathered basic info about how to use RGFGRID tool by going through its User Manual. I think, for modelling I need to obtain my land boundaries from a map file but I could not figure out how to achieve. 
Any help would be appreciated.Kindest regards,Burhan.
Victor Chavarrias, modified 8 Months ago.

RE: Grid Generation from a real map

Famous Fortune teller Posts: 48 Join Date: 4/24/20 Recent Posts
Hi,

The simplest manner to generate a grid for a real river is to use Google Earth for the land boundaries. The process is as follow:

1) Drawing the land boundaries using Google Earth
1.1)Draw a polyline (path).
1.2) Save in KML format (right click in the path in the 'Places' panel -> click 'Save Place As' -> change 'Save As type' to '.kml' -> click 'Save'

2) Converting the land boundaries to LDB format using Matlab
2.1) Open Matlab 
2.2) Add the Matlab OpenEarthTools to the path by typing in the Command Window:
run(oetsettings)
        
        If you do not have them yet, first check out the repository at:
        https://svn.oss.deltares.nl/repos/openearthtools/trunk/matlab
2.3) Convert the KML-file into LDB-file by typing in the Command Window:
        EHY_convert(path_kml,'ldb')
        
        where 'path_kml' is the path to the KML-file. Avoid spaces, dots, and these sort of things in the path!
        
3) Creating the grid using RFGRID
3.1) Open RFGRID
3.2) Load the LDB-files (click on 'File' -> 'Attribute Files' -> 'Open Land Boundaries')
3.3) Convert the land boundaries to splines (click on 'Operations' -> 'Create' -> 'Splines from Land boundaries')
3.4) Grow grid from splines (click on 'Operations' -> 'Grow Grid from Splines')
BY
Burhan Yildiz, modified 8 Months ago.

RE: Grid Generation from a real map

Keen Forecaster Posts: 7 Join Date: 8/7/20 Recent Posts
Thank you Victor for your reply. Well, I stuck on point 2.2. For adding the Matlab OpenEarthTools.. I copied setproperties m-file from svn website to my bin folder but run did not work. Can you please tell me what I am doing wrong?
Victor Chavarrias, modified 8 Months ago.

RE: Grid Generation from a real map

Famous Fortune teller Posts: 48 Join Date: 4/24/20 Recent Posts
Hi, 
You need all function in the repository. You need to checkout the whole repository (using SVN Tortoise) and then run oetsettings.m to add the function to the Matlab path. See the link. 
BY
Burhan Yildiz, modified 8 Months ago.

RE: Grid Generation from a real map

Keen Forecaster Posts: 7 Join Date: 8/7/20 Recent Posts
Thanks for the reply. Actually I applied what you wrote. I copied the repository by using tortoiseSVN to my Matlab bin folder. Then, when I run(oetsettings) I received this error: 
Error using oetsettings
Too many output arguments.
I added the path of the OET folder from Home>Environmet>Set Path. But still it is not counted, when I apply EHY_convert it gives error:
Undefined function or variable 'EHY_convert'.
Your help will be appreciated.
Victor Chavarrias, modified 8 Months ago.

RE: Grid Generation from a real map

Famous Fortune teller Posts: 48 Join Date: 4/24/20 Recent Posts
Hi, 

It is better you do not put the repository inside Matlab bin folder. Just leave it in your user folder. Then, execute oetsettings.
E.g. My repository is here:
c:\Users\chavarri\checkouts\openearthtools_matlab
and I runrun('c:\Users\chavarri\checkouts\openearthtools_matlab\oetsettings.m')
BY
Burhan Yildiz, modified 8 Months ago.

RE: Grid Generation from a real map

Keen Forecaster Posts: 7 Join Date: 8/7/20 Recent Posts
Ok, now it works. Thanks a lot for the replies.