get_station.js is a helper script that will help in generating a graph.json which will be used as the input for juliuste/transit-map.
The input graph.json must be in the JSON Graph Format. It will look something like -
{
"nodes": [ // list of all nodes
{
"id": "DR", // required
"label": "Dadar", // optional
"metadata": {
"x": 0.702342, // x-coordinate in mercator, required
"y": 0.444534 // y-coordinate in mercator, required
}
}
],
"edges": [ // list of all edges
{
"source": "DR", // required
"target": "PR", // required
"metadata": {
"line": "Central" // optional
}
}
],
"lines": [ // list of all lines, optional
{
"id": "Central",
"color": "#ABDA1E",
"group": "Central"
}
]
}node.js8.0+gurobi_cl7.5+ (Free academic license)juliuste/projectionsin parent working directory
This script has a CLI which will generate a graph.json as shown above by taking inputs from the user as documented below -
USAGE: get_station.js [-n][-e][-l][-m][-c]
| Option | Description |
|---|---|
| -n | Add station nodes |
| -e | Add station edges |
| -l | Add a new line |
| -m | Generate the input file |
| -c | Set new working city |
-n: adding new station nodes will take the required parameters:(id, label, latitude, longitude)-e: adding new station edges will take the required parameters:(source, target, line)-l: adding new line will take the required parameters:(id, color, group)-m: generating a$city.input.jsonfile needs$city_nodes.json,$city_edges.jsonand$city_lines.jsonfiles present in theworking/$citydirectory-c: will set a new working city by modifyingconfig.jsonfile.
If you have a question, found a bug, or want to propose a feature, feel free to open a new issue.