To add the bathymetry we will use the Gebco dataset as used in delft dashboard. We start by using the following line
Get bathymetry data
bathymetryData = GetGebcoBathymetryData(xOffset, yOffset, xOffset + gridWidth, yOffset + gridHeigth, 3857)
Here we retrieve the bathymetry data from the gebco dataset using the extent of our grid and the coordinate system EPSG code. This is needed because the dataset uses a specific (different) coordinate system.
The next step is to remove the cells that are on land. We can determine this by using our bathymetry data. Add and run the following line to remove the land cells
Remove land cells
CleanupLandCells(fmModel, bathymetryData, -2)
Remove land cells
values = [] for vertex in fmModel.Grid.Vertices : values.append(GetGebcoBathymetryValueFor(vertex.CoordinateValue, 3857, bathymetryData)) fmModel.Bathymetry.SetValues(values)