The distance sea is 0 at the sea, it is calculated by two methods "distance_sea_fromnodes" in riversegments which takes the data from the rivernodes tables "distance_sea" which does the calculation and is now deprecated