Skip to content

Commit

Permalink
Merge pull request #224 from OneBusAway/OTD-529-add-oba-support-for-t…
Browse files Browse the repository at this point in the history
…ts_stop_nam

Added support for tts_stop_name in stops.txt.
  • Loading branch information
sheldonabrown authored Sep 26, 2023
2 parents a4aba37 + e474459 commit 51068f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<property name="vehicleType" />
<property name="wheelchairBoarding" />
<property name="platformCode" />
<property name="ttsStopName"/>
<many-to-one name="level">
<column name="level_agencyId" length="50" />
<column name="level_id" />
Expand Down
11 changes: 11 additions & 0 deletions onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Stop.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public final class Stop extends IdentityBean<AgencyAndId> implements StopLocatio
@CsvField(optional = true, name = "regional_fare_card", defaultValue = "0")
private int regionalFareCardAccepted;

@CsvField(optional = true, name = "tts_stop_name")
private String ttsStopName;

public Stop() {

Expand All @@ -120,6 +122,7 @@ public Stop(Stop obj) {
this.level = obj.level;
this.mtaStopId = obj.mtaStopId;
this.regionalFareCardAccepted = obj.regionalFareCardAccepted;
this.ttsStopName = obj.ttsStopName;
}

public AgencyAndId getId() {
Expand Down Expand Up @@ -290,4 +293,12 @@ public int getRegionalFareCardAccepted() {
public void setRegionalFareCardAccepted(int regionalFareCardAccepted) {
this.regionalFareCardAccepted = regionalFareCardAccepted;
}

public String getTtsStopName() {
return ttsStopName;
}

public void setTtsStopName(String ttsStopName) {
this.ttsStopName = ttsStopName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public void testAllFields() throws IOException {
gtfs.putLines(
"stops.txt",
"stop_id,stop_name,stop_lat,stop_lon,stop_desc,stop_code,stop_direction,location_type,parent_station,"
+ "stop_url,wheelchair_boarding,zone_id,stop_timezone,vehicle_type,platform_code,level_id",
"S1,Stop,47.0,-122.0,description,123,N,1,1234,http://agency.gov/stop,1,Z,America/New_York,2,9 3/4,L1");
+ "stop_url,wheelchair_boarding,zone_id,stop_timezone,vehicle_type,platform_code,level_id,tts_stop_name",
"S1,Stop,47.0,-122.0,description,123,N,1,1234,http://agency.gov/stop,1,Z,America/New_York,2,9 3/4,L1,southwest one hundred twenty fifth & longhorn");
gtfs.putLines(
"routes.txt",
"agency_id,route_id,route_short_name,route_long_name,route_type,route_desc,route_color,route_text_color,"
Expand Down Expand Up @@ -184,6 +184,8 @@ public void testAllFields() throws IOException {
assertEquals(2, stop.getVehicleType());
assertEquals("9 3/4", stop.getPlatformCode());
assertEquals(level, stop.getLevel());
assertEquals("southwest one hundred twenty fifth & longhorn",stop.getTtsStopName());


Route route = dao.getRouteForId(new AgencyAndId("1", "R1"));
assertEquals(new AgencyAndId("1", "R1"), route.getId());
Expand Down

0 comments on commit 51068f3

Please sign in to comment.