Skip the lambda/map
Use a function to write.
Sort before writing JSON
Generate files for complete stops, with both directions.