Fix performance issues in altimetric JSON (fixes #845)