Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for tts_stop_name in stops.txt. #224

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading