## Combining SRTM height, water body and ETOPO bathymetry data |

We have the three different sources of data :

- ETOPO bathymetry : seabed depths data with approximate resolution 1 x 1 km
- SRTM Digital Elevation : HGT files with resolution approximately 100 x 100 metres
- SWBD water body data - shore contours with high resolution in ESRI format

An SRTM HGT height file covers 1 x 1° area with height values represented as regular grid of 1200x1200 intervals (1201x1201 points). Such file does not contain data about sea depth, as it was generated by the Shuttle radar measuring heights from land or sea surface. To be able to distinguish between land or water space, SWBD data is available - shore contours.

Before processing, SRTM and SWBD data are corrected :

- SRTM data with "undefined" values are replaced by averaged values from point neighbours
- ESRI "PolygonZ" waterbody data formats are corrected in few cases
- ESRI polygon rings orientation is corrected (first polygon ring must always have positive area which is not always the case, e.g. like in e100n05e.zip)

Our purpose is to **combine all the data into a regular HGT file grid.**.

Incorporation of depth is straightforward : once we get shore contours, we simply replace HGT height values by depth values everywhere inside water areas.
At points where low-resolution ETOPO data is grossly inaccurate (e.g. provides positive land height where it should be negative), a **default** water depth is taken.

Original height data may substantially differ from much more accurate shore contours. Now we need to bring HGT data close to shore contour data.

Suppose we have a regular grid of 1200x1200 intervals (1201x1201 points) for geographic area of size 1 by 1°. At each point we have a height value. So, a cell resolution for this file is, roughly speaking, 100 by 100 metres.

Let use represent height function by piecewise linear hat basis in the form

H(u,v) = Σ_{i,j=0,1200}P_{i,j} R_{i,j}(u,v)

- u,v are parameters along x,y
- H - height (depth) value
- P - control points
- R - piecewise linear basis

Suppose we have a number of constraint points (they are water countour points) which should be moved to level H = 0.
Call them S_{f}, f=1,...,h; they have parameter values (u_{f},v_{f}), f=1,...h. These points will be moved to target points T_{f}, f=1,...,h with zero height.

In order to move S_{f} to T_{f}, f=1,...,h, we need to compute displacement δ_{i,j} of each control point P_{i,j} so that the following constraints are satisfied :

T_{f} = Σ_{i,j=0,1200}(P_{i,j} + δ_{i,j}) R_{i,j}(u_{f},v_{f}) = S_{f} + Σ_{i,j=0,1200}δ_{i,j} R_{i,j}(u_{f},v_{f})

f = 1,...,h

Let us minimize displacements with constraints introduced with Lagrange multipliers

L = Σ
where λ_{f}, f = 1,...,h are Lagrange multipliers. After differentiating this function by displacements δ and Lagrange multipliers λ and equating to zero we get a system of two equations

T_{f} = S_{f} + Σ_{i,j=0,1200}δ_{i,j} R_{i,j}(u_{f},v_{f}) f = 1,...,h

δ_{i,j} = 0.5 Σ_{f=1,h} λ_{f} R_{i,j}(u_{f},v_{f}) 0≤i≤1200, 0≤j≤1200.

In the matrix form

**D**=**R**^{T}**δ** (1)

**δ**=**R****λ** (2)

By substituting equation (2) into equation (1)

**D**=**R**^{T}**R****λ**

from where we can get Lagrange multipliers by solving a system of linear equations. Further, we get the required grid node displacements from equation (2).

Nodes of HGT file grid are displaced by these values to make cell intersections with plane Z = 0 close to specified shore countour lines.

1. Direct manipulation of FFD : efficient explicit solutions and decomposible multiple point constraints. Shi-Min Hu, Hui Zhang, Chiew-Lan Tai, Jia-Guang Sun. Springer-Verlag 2001.