(coords)
| 113 | |
| 114 | // Build OSRM API query URL from coordinate array |
| 115 | function makeQuery(coords) { |
| 116 | const coords_string = coords.map((c) => coord_template.replace('{lon}', c[0]).replace('{lat}', c[1])).join(coords_separator); |
| 117 | const path = url_templates[options.type].replace('{coords}', coords_string); |
| 118 | return `http://${options.host}:${options.port}${path}`; |
| 119 | } |
| 120 | |
| 121 | // Generate queries based on distance or waypoint count |
| 122 | // Output in CSV format (quoted) for compatibility with osrm-runner.js |