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

route_name_type #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Route.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public final class Route extends IdentityBean<AgencyAndId> {
@CsvField(optional = true, defaultValue = "0")
private int bikesAllowed = 0;

@CsvField(optional = true)
private String typeName;

public Route() {

}
Expand Down Expand Up @@ -119,6 +122,14 @@ public void setType(int type) {
this.type = type;
}

public String getTypeName() {
return typeName;
}

public void setTypeName(String typeName) {
this.typeName = typeName;
}

public String getUrl() {
return url;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public void testAllFields() throws IOException {
"S1,Stop,47.0,-122.0,description,123,N,1,1234,http://agency.gov/stop,1,Z");
gtfs.putLines(
"routes.txt",
"agency_id,route_id,route_short_name,route_long_name,route_type,route_desc,route_color,route_text_color,"
"agency_id,route_id,route_short_name,route_long_name,route_type,route_type_name,route_desc,route_color,route_text_color,"
+ "route_bikes_allowed,route_url",
"1,R1,10,The Ten,3,route desc,FF0000,0000FF,1,http://agency.gov/route");
"1,R1,10,The Ten,3,\"Magic Schoolbus\",route desc,FF0000,0000FF,1,http://agency.gov/route");
gtfs.putLines(
"trips.txt",
"route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,route_short_name,"
Expand Down Expand Up @@ -151,6 +151,7 @@ public void testAllFields() throws IOException {
assertEquals("10", route.getShortName());
assertEquals("The Ten", route.getLongName());
assertEquals(3, route.getType());
assertEquals("Magic Schoolbus", route.getTypeName());
assertEquals("route desc", route.getDesc());
assertEquals("FF0000", route.getColor());
assertEquals("0000FF", route.getTextColor());
Expand Down