mirror of
https://github.com/skoobasteeve/MTAPI-docker.git
synced 2026-03-20 03:28:57 +00:00
remove build step and rename
This commit is contained in:
27
update_stations_files.sh
Normal file
27
update_stations_files.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SUBWAY_DATA_URL="http://web.mta.info/developers/data/nyct/subway/google_transit.zip"
|
||||
|
||||
# Create tmp directory
|
||||
if [ -d "tmp" ]; then
|
||||
rm -rf "tmp"
|
||||
mkdir tmp
|
||||
else
|
||||
mkdir tmp
|
||||
fi
|
||||
|
||||
# Clone the MTAPI repo
|
||||
if [ -d "tmp/MTAPI" ]; then
|
||||
rm -rf "tmp/MTAPI"
|
||||
git clone "$MTAPI_URL" tmp/MTAPI
|
||||
else
|
||||
git clone "$MTAPI_URL" tmp/MTAPI
|
||||
fi
|
||||
|
||||
# Download and extract subway data from MTA
|
||||
curl -o tmp/subway.zip "$SUBWAY_DATA_URL"
|
||||
unzip -d tmp/subway-data -o tmp/subway.zip
|
||||
|
||||
# Create the stations data files
|
||||
python tmp/MTAPI/scripts/make_stations_csv.py tmp/subway-data/stops.txt tmp/subway-data/transfers.txt > data/stations.csv
|
||||
python tmp/MTAPI/scripts/make_stations_json.py data/stations.csv > data/stations.json
|
||||
Reference in New Issue
Block a user