Skip to content

Commit

Permalink
v3.1.0 bugfixes and win binary
Browse files Browse the repository at this point in the history
  • Loading branch information
answerquest committed Oct 11, 2018
1 parent b44fcb5 commit f5fb0e2
Show file tree
Hide file tree
Showing 25 changed files with 839 additions and 101 deletions.
Binary file added GTFSManager.exe
Binary file not shown.
27 changes: 12 additions & 15 deletions GTFSManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,31 +496,28 @@ def get(self):
self.write("Error: Please save this trip to DB in the Trips tab first.")
return

chunkFile = findChunk(trip_id)
if chunkFile is None:
returnMessage = 'This trip is new. Loading default sequence, please fill in timings and save to DB.'
newFlag = True
else:
tablename = chunkFile[:-3]
stoptimesDf = readTableDB(tablename, 'trip_id', trip_id)
stoptimesDf = readTableDB('stop_times', 'trip_id', trip_id)
# this will simply be empty if the trip doesn't exist yet

stoptimesArray = stoptimesDf.to_dict(orient='records')

if len(stoptimesArray):
returnMessage = 'Loaded timings from stop_times table.'
newFlag = False
else:
returnMessage = 'This trip is new. Loading default sequence, please fill in timings and save to DB.'
newFlag = True

if not len(stoptimesDf) : # this shouldn't happen
self.set_status(400)
self.write('Error: trip {} is supposed to be in {} but couldn\'t find it there.'.format(trip_id,chunkFile))
return

stoptimesArray = stoptimesDf.to_dict(orient='records')
# let's send back not just the array but even the message to display.
returnJson = {'data':stoptimesArray, 'message':returnMessage, 'newFlag':newFlag }
logmessage(returnJson['message'])
# let's send back not just the array but even the message to display.
logmessage('returnJson.message:',returnJson['message'])

self.write(json.dumps(returnJson))
# time check, from https://stackoverflow.com/a/24878413/4355695
end = time.time()
logmessage("stopTimes GET call took {} seconds.".format(round(end-start,2)))


def post(self):
# ${APIpath}stopTimes?pw=${pw}&trip=${trip_id}
start = time.time() # time check, from https://stackoverflow.com/a/24878413/4355695
Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

A browser-based user interface for creating, editing, exporting of static GTFS (General Transit Feed Specification Reference) feeds for a public transit authority.

**Development Status** : V 3.0.1
~And Windows binary is available too now.~ Download from [Releases page](https://github.com/WRI-Cities/static-GTFS-manager/releases/).
**Development Status** : V 3.1.0
Windows binary is available too now. Download from [Releases page](https://github.com/WRI-Cities/static-GTFS-manager/releases/).

## Intro
This project is the result of a collaboration between WRI ([World Resources Institute](http://wri-india.org/)) and KMRL ([Kochi Metro Rail Limited](http://kochimetro.org)).
Expand Down Expand Up @@ -34,17 +34,14 @@ See this and many more GTFS related resources listed on **[Awesome Transit](http
Psst! Password is `program`.

### Windows standalone executable, Double-click and Go!
***Alert: not made for v2.x yet. Hang on!***

1. Download the latest `GTFS-Manager-Windows-vxxx.zip` from [Releases section](https://github.com/WRI-Cities/static-GTFS-manager/releases/) and unzip it on your system. Get into the folder created.
1. (Updated, Oct 2018) Download the repo, unzip, and double-click GTFSManager.exe in the main program folder. It'll have an icon.

2. Double-click on the shortcut "GTFS-Manager".
2. That's it, that should start the program! A dos box should open up giving console messages, and in a few seconds a new tab should open in your system's default web browser with the program loaded.

3. That's it, that should start the program! A dos box should open up giving status messages, and in a few seconds a new tab should open in your system's default web browser with the program loaded.
3. There will probably be a Windows Firewall popup. Click OK or cancel.. this program doesn't do any to-and-fro communication over internet, that's just a default question that comes up when a server is activated. (In our case we're creating a portable web server for the front-end and back-end partd of the program to communicate). It does need internet for loading the background tiles on web maps, but other than that the program can run without internet connection.

4. There will probably be a Windows Firewall popup. Just click cancel.. this program doesn't intend to do anything over the internet apart from loading the web map background tiles.

5. More notes on this, including some troubleshooting and watchouts, **[on the wiki](https://github.com/WRI-Cities/static-GTFS-manager/wiki/Standalone-Windows-Executable)**.
4. More notes on this, including some troubleshooting and watchouts, **[on the wiki](https://github.com/WRI-Cities/static-GTFS-manager/wiki/Standalone-Windows-Executable)**.


### On Ubuntu / Linux OS
Expand Down Expand Up @@ -81,10 +78,10 @@ gtfs.zip
Some requirements, *s'il vous plait !*
1. Keep all your files with lowercase `.txt` extension
2. Keep them up at root level in the zip archive, not inside any folders.
3. The table in `stop_times.txt` **must be sorted by `trip_id`** (you can open it in LibreOffice, or rename as .csv and open in Excel).
4. Similarly, the table in `shapes.txt` **must be sorted by `shape_id`**.
3. The table in `stop_times.txt` **must be sorted by `trip_id`** (you can open it in LibreOffice, or rename as .csv and open in Excel) before importing.
4. Similarly, the table in `shapes.txt` **must be sorted by `shape_id`** before importing.

Kindly [validate](http://gtfsfeedvalidator.transitscreen.com) your GTFS zip prior to importing so you know in advance if there are any issues with the feed. And no worries, this tool is made FOR fixing bad feeds, the system will import whatever you give it. If you need to delete a lot of junk data in the feed, the Misc > Maintenance section will be your favorite place to be.
Kindly [validate](http://gtfsfeedvalidator.transitscreen.com) your GTFS zip prior to importing so you know in advance if there are any issues with the feed. And no worries, this tool is made FOR fixing bad feeds, the system will import whatever you give it. If you need to delete a lot of junk data in the feed, the Tools > Delete ID section will be your favorite place to be.

In the import process, the program creates a backup ZIP of the current data and then imports your data into its database. You can see the backup listed later on under Past Commits section on the home page.

Expand Down
2 changes: 1 addition & 1 deletion config/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// from commonfuncs.js

const VERSION = 'v3.0.1';
const VERSION = 'v3.1.0';
const APIpath = 'API/';
const CURRENCY = 'INR';
const route_type_options = {0:"0-Tram, Streetcar, Light rail", 1:"1-Subway, Metro", 2:"2-Rail", 3:"3-Bus",4:"4-Ferry" };
Expand Down
34 changes: 34 additions & 0 deletions db/sequence.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,40 @@
"route_id": "218D",
"shape0": "218D_1",
"shape1": "218D_0"
},
"2": {
"0": [
"NARSI1",
"HANUM1",
"TARAM1",
"IBRAH1",
"RAMDE1",
"TIPPU1",
"BAPUG1",
"LANGA1",
"FLOUR1",
"SALAR1",
"NALAN1",
"RETHI1",
"MEHDI1"
],
"1": [
"MEHDI2",
"RETHI2",
"NANAL1",
"SALAR2",
"FLOUR1",
"LANGE1",
"BAPUN1",
"BAPUG2",
"CHAVE1",
"RAMDE2",
"IBRAH2",
"TARAM1",
"HANUM2",
"NARSI2"
],
"route_id": "120M"
}
}
}
Binary file modified db/trips.h5
Binary file not shown.
55 changes: 55 additions & 0 deletions frequencies.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Frequencies</title>
<link href="lib/jquery-ui.min.css" rel="stylesheet">
<link href="lib/tabulator.min.css" rel="stylesheet">
<link href="lib/bootstrap.v4.0.0.min.css" crossorigin="anonymous" alt="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" rel="stylesheet">
<link rel="stylesheet" href="lib/chosen/chosen.min.css">
<link href="js/commonstyle.css" rel="stylesheet">
<!-- Put the CSSs first and JSs next -->

<script src="lib/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="lib/jquery-ui.min.js" type="text/javascript"></script>
<script src="lib/tabulator.js" type="text/javascript"></script>
<script src="lib/popper.v1.12.9.min.js" crossorigin="anonymous" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" alt="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="lib/bootstrap.v4.0.0.min.js" crossorigin="anonymous" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" alt="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="lib/papaparse.min.js" type="text/javascript"></script>
<script src="lib/chosen/chosen.jquery.min.js" type="text/javascript"></script>
<style>
#calendar-table {
height: 300px;
}
</style></head>
<body>
<div id="navBar"></div>

<div class="container">
<h2>Calendar</h2>
<div id="instructions" class="container">
<h3>Instructions</h3>
<div>
<p>Frequencies table serves as an alternative to the default route > trip > stop_timings system in GTFS.<br>
Normally, we have to lay out each trip in the day that a route takes in trips table, and then expand each trip in stop_times table with the specific timings.<br>
But for some transit systems, the route may be plying at a certain frequency, for example every 30 mins between 5am and 11pm. And even the journey may be the same throughout. (ie, trip sequences or time between stops don't change)<br>
Instead of having to define each trip (72 times in the example case), the GTFS spec enables setting up a special "frequency" trip in the frequencies table.<br>
In stop_times table, the exact timings in arrival_time and departure_time become irrelevant, instead </p>
</div></div><!-- Accordion over -->
<br>


<div id="calendar-table"></div>
<br>
<p>Create a new calendar service: <input placeholder="service_id" id="calendar2add" size="6"><button class="btn-primary btn-xs" id="addCalendarButton" type="button">Add</button> &nbsp; <small id="calendarAddStatus"></small></p>

<p><button id="saveCalendarButton" class="btn btn-outline-success btn-md">Save Calendar Changes</button> &nbsp; <small id="calendarSaveStatus"></small></p>


</div>
<script src="config/settings.js" type="text/javascript"></script>
<script src="js/commonfuncs.js" type="text/javascript"></script>
<script src="js/calendar.js"></script>

</body>
</html>
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions hydcsv_related/backup-before-Oct2018/stops-override.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"route_id","stop_id","replace_with"
"RED","AME1","AME2"
"BLU","AME1","AME4"
"BLU","AME2","AME4"
Binary file not shown.
25 changes: 25 additions & 0 deletions hydcsv_related/backup-before-Oct2018/translations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sr,English,Telegu,Urdu,Hindi
1,Miyapur,మియాపూర్ ,میااپور,मियापुर
2,JNTU College,జె.ఎన్.టి.యు కాలేజ్,جی این ٹی.یو.,जे.एन.टि.यु कॉलेज
3,KPHB Colony,కె.పి.హెచ్.బి కాలనీ,,के.पि.एच.बि कॉलोनी
4,Kukatpally,కూకట్ పల్లి ,,कूकटपल्ली
5,Dr. B. R. Ambedkar Balanagar,డా. బి. ఆర్. అంబేద్కర్ బాలానగర్,بالانگر,डॉ. बी. आर. अंबेडकर बालानगर
6,Moosapet,మూసాపేట్ ,,मूसापेट
7,Bharath Nagar,భరత్ నగర్,بھارتھ نگر,भारत नगर
8,Erragadda,ఎర్రగడ్డ ,ارگداڈا,एरागड्डा
9,ESI Hospital,ఇ. ఎస్. ఐ. హోస్పిటల్ ,ای. ایس.,ई.एस.आई अस्पताल
10,S R Nagar,ఎస్.ఆర్. నగర్,ایس آرنگر,एस. आर. नगर
11,Ameerpet,అమీర్ పేట్ ,امیرچیٹ,अमीरपेट
12,Begumpet,బేగంపేట్,,बेगमपेट
13,Prakash Nagar,ప్రకాశ్ నగర్ ,پراشک نگر,प्रकाशनगर
14,Rasoolpura,రసూల్ పుర ,,रसूलपुरा
15,Paradise,ప్యారడైజ్,جنت,पैरेडाइस
16,Parade Grounds,పరేడ్ గ్రౌండ్,پریڈ میدان,परेड़ ग्राउण्ड
17,Secunderabad (E),సికింద్రాబాద్ ఈస్ట్,سکندرآباد (ای),सिकन्दराबाद ईस्ट
18,Mettuguda,మెట్టుగూడ,,मेट्टुगूडा
19,Tarnaka,తార్నాక ,ترنکا,तार्नाका
20,Habsiguda,హబ్సిగూడ ,حبسگدا,हब्सिगुडा
21,NGRI,ఎన్ జి ఆర్ ఐ ,این جی آر. آئی.,एन. जी. आर. आई
22,Stadium,స్టేడియం,اسٹیڈیم,स्टेडियम
23,Uppal,ఉప్పల్ ,اپپال,उप्पल
24,Nagole,నాగోల్ ,ناگول,नागोल
Binary file modified hydcsv_related/missing-stops-rules.csv
Binary file not shown.
7 changes: 3 additions & 4 deletions hydcsv_related/stops-override.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"route_id","stop_id","replace_with"
"RED","AME1","AME2"
"BLU","AME1","AME4"
"BLU","AME2","AME4"
route_id,stop_id,replace_with
BLU,AME1,AME4
BLU,AME2,AME4
Binary file modified hydcsv_related/stops_simple.csv
Binary file not shown.
54 changes: 35 additions & 19 deletions hydcsv_related/translations.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
sr,English,Telegu,Urdu,Hindi
1,Miyapur,మియాపూర్ ,میااپور,मियापुर
1,Miyapur,మియాపూర్,میااپور,मियापुर
2,JNTU College,జె.ఎన్.టి.యు కాలేజ్,جی این ٹی.یو.,जे.एन.टि.यु कॉलेज
3,KPHB Colony,కె.పి.హెచ్.బి కాలనీ,,के.पि.एच.बि कॉलोनी
4,Kukatpally,కూకట్ పల్లి ,,कूकटपल्ली
4,Kukatpally,కూకట్ పల్లి,,कूकटपल्लि
5,Dr. B. R. Ambedkar Balanagar,డా. బి. ఆర్. అంబేద్కర్ బాలానగర్,بالانگر,डॉ. बी. आर. अंबेडकर बालानगर
6,Moosapet,మూసాపేట్ ,,मूसापेट
6,Moosapet,మూసాపేట్,,मूसापेट
7,Bharath Nagar,భరత్ నగర్,بھارتھ نگر,भारत नगर
8,Erragadda,ఎర్రగడ్డ ,ارگداڈا,एरागड्डा
9,ESI Hospital,ఇ. ఎస్. ఐ. హోస్పిటల్ ,ای. ایس.,ई.एस.आई अस्पताल
8,Erragadda,ఎర్రగడ్డ,ارگداڈا,एरागड्डा
9,ESI Hospital,ఇ. ఎస్. ఐ. హోస్పిటల్,ای. ایس.,ई.एस.आई. हॉस्पिटल
10,S R Nagar,ఎస్.ఆర్. నగర్,ایس آرنگر,एस. आर. नगर
11,Ameerpet,అమీర్ పేట్ ,امیرچیٹ,अमीरपेट
12,Begumpet,బేగంపేట్,,बेगमपेट
13,Prakash Nagar,ప్రకాశ్ నగర్ ,پراشک نگر,प्रकाशनगर
14,Rasoolpura,రసూల్ పుర ,,रसूलपुरा
15,Paradise,ప్యారడైజ్,جنت,पैरेडाइस
16,Parade Grounds,పరేడ్ గ్రౌండ్,پریڈ میدان,परेड़ ग्राउण्ड
17,Secunderabad (E),సికింద్రాబాద్ ఈస్ట్,سکندرآباد (ای),सिकन्दराबाद ईस्ट
18,Mettuguda,మెట్టుగూడ,,मेट्टुगूडा
19,Tarnaka,తార్నాక ,ترنکا,तार्नाका
20,Habsiguda,హబ్సిగూడ ,حبسگدا,हब्सिगुडा
21,NGRI,ఎన్ జి ఆర్ ఐ ,این جی آر. آئی.,एन. जी. आर. आई
22,Stadium,స్టేడియం,اسٹیڈیم,स्टेडियम
23,Uppal,ఉప్పల్ ,اپپال,उप्पल
24,Nagole,నాగోల్ ,ناگول,नागोल
11,Ameerpet,అమీర్ పేట్,امیرچیٹ,अमीरपेट
12,Punjagutta,పంజాగుట్ట,,पंजागुट्टा
13,Irrum Manzil,ఇరమంజిల్,,इर्रम् मंजिल
14,Khairatabad,ఖైరతాబాద్,,खैरताबाद
15,Lakdikapul,లక్డి-క-పూల్,,लकड़ी-का-पुल
16,Assembly,అసెంబ్లీ,,असेम्ब्ली
17,Nampally,నాంపల్లి,,नामपल्लि
18,Gandhi Bhavan,గాంధీ భవన్,,गांधी भवन
19,Osmania Medical College,ఉస్మానియా మెడికల్ కాలేజీ,,उस्मानिया मेडिकल कॉलेज
20,MG Bus station,ఎం.జి. బస్ స్టేషన్,,एम.जि. बस स्टेशन
21,Malakpet,మలక్ పేట్,,मलकपेट
22,New Market,న్యూ మార్కెట్,,न्यू मार्केट
23,Musarambagh,ముసరంబాగ్,,मुसरमबाग
24,Dilsukhnagar,దిల్ సుఖ్ నగర్,,दिलसुखनगर
25,Chaitanyapuri,చైతన్యపురి,,चैतन्यपुरी
26,Victoria Memorial,విక్టోరియా మెమోరియల్,,विकटोरिया मेमोरिअल
27,L B Nagar,ఎల్.బి నగర్ మెట్రో స్టేషన్,,एल.बि. नगर
28,Nagole,నాగోల్,ناگول,नागोल
29,Uppal,ఉప్పల్,اپپال,उप्पल
30,Stadium,స్టేడియం,اسٹیڈیم,स्टेडियम
31,NGRI,ఎన్ జి ఆర్ ఐ,این جی آر. آئی.,एन. जी. आर. आई
32,Habsiguda,హబ్సిగూడ,حبسگدا,हब्सिगुडा
33,Tarnaka,తార్నాక,ترنکا,तार्नाका
34,Mettuguda,మెట్టుగూడ,,मेट्टुगूडा
35,Secunderabad (E),సికింద్రాబాద్ ఈస్ట్,سکندرآباد (ای),सिकन्दराबाद ईस्ट
36,Parade Grounds,పరేడ్ గ్రౌండ్,پریڈ میدان,परेड़ ग्राउण्ड
37,Paradise,ప్యారడైజ్,جنت,पैरेडाइस
38,Rasoolpura,రసూల్ పుర,,रसूलपुरा
39,Prakash Nagar,ప్రకాశ్ నగర్,پراشک نگر,प्रकाशनगर
40,Begumpet,బేగంపేట్,,बेगमपेट
Loading

0 comments on commit f5fb0e2

Please sign in to comment.