Write to elevation.
Distances in separate step.
Elevation files with distances.
Unused.
Store distance with elevation.