python getjson.py http://www.nydailynews.com/json/cmlink/eating-b-line-1.3377799
mv eating-b-line-1.3377799 www/data/
- re-deploy.
Get the current MTA route data from CUNY.
Convert it into something usable with https://ogre.adc4gis.com/ on the web or the ogr2ogr command-line client.
- Edit data/mta.geojson and add / update the route for the desired line. This file controls the direction of the line's line.
- If you have stations to add / remove / change location, edit the data/subway_geo.geojson file. Each line in it corresponds with a station, and records the station name and lat/long. This file controls the location of the station markers.
- If you're just adding or removing stations, also update the data/stops.json file.
How to figure out what's wrong when an article that should appear on a particular subway line is not appearing
- Make sure the line is in the array assigned to the stop in data/stops.json
- Make sure the article is tagged with "eating along the X line"
Most all of this is done in js/scripts.js.
- In the
var rss = [...
array, add an object that looks like this with the line number and URL to that line's RSS feed,{"line":"2", "link":"http://www.nydailynews.com/json/cmlink/eating-2-line-1.2734246"},
, somewhere inside the array. - Add a "cover" photo that's representative of the line into the img directory. Name it like
img/A_Train-min.jpg
except well you know. The image should be horizontal and at least 400px wide. - In the
var cover = [...
array in scripts.js add an object that looks like{"line":"2", "image":"img/2_Train-min.jpg","text":""},
except for the line you're adding. - If there are any subway line labels that need to be angled up, add an object for that particular line to the
var labels = [...
array like this{"line":"Q", "upper":["57th St", "Ocean Pkwy", "Coney Island - Stillwell Av"]},
. - Remove the line from the
var lines_no = [...
array.
Edit the data/subway_geo.geojson file.
- Make sure the stop name is in data/subway_geo.geojson file.
- Make sure there's a record for the line in the labels array in
js/app.js
near line 50.
- Remove the line image from splash.html
- Remove the letter / number of the line from these two arrays in js/scripts.js:
var lines = ['1','2','3',...
var lines_no = ['1',....
Updating the json for the B line routes:
python getjson.py http://www.nydailynews.com/json/cmlink/eating-b-line-1.3377799; mv eating-b-line-1.3377799 www/data/; git commit -m "Update json" .;