Recursive function to calculate the offset from the downstream
junction needed to place points with fixed distance along the streams.
It is called by calc_prediction_sites for each
outlet and should not be called by the user.
Usage
calc_offset(dt, id, offs, dist)
Arguments
dt
data.table containing the attributes of the stream segments
id
integer; 'stream' of the stream segment
offs
number; offset from outlet of the stream segment (downstream);
equals the length of the segment if the point shall be placed directly at the
downstream junction.
dist
number giving the distance between the points to create in map units.