diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f5e599d6..b23a44a42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,10 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 8 + java-version: 11 - name: Cache Maven dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -27,4 +27,4 @@ jobs: ${{ runner.os }}-maven- - name: Test project with Maven - run: mvn --no-transfer-progress test verify + run: mvn --no-transfer-progress test install diff --git a/onebusaway-gtfs-hibernate-cli/pom.xml b/onebusaway-gtfs-hibernate-cli/pom.xml index 1f2a933b6..664a1bd7f 100644 --- a/onebusaway-gtfs-hibernate-cli/pom.xml +++ b/onebusaway-gtfs-hibernate-cli/pom.xml @@ -3,7 +3,7 @@ org.onebusaway onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT onebusaway-gtfs-hibernate-cli onebusaway-gtfs-hibernate-cli diff --git a/onebusaway-gtfs-hibernate/pom.xml b/onebusaway-gtfs-hibernate/pom.xml index 230542a50..9fea959b3 100644 --- a/onebusaway-gtfs-hibernate/pom.xml +++ b/onebusaway-gtfs-hibernate/pom.xml @@ -9,7 +9,7 @@ org.onebusaway onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT diff --git a/onebusaway-gtfs-hibernate/src/main/java/org/onebusaway/gtfs/impl/HibernateGtfsRelationalDaoImpl.java b/onebusaway-gtfs-hibernate/src/main/java/org/onebusaway/gtfs/impl/HibernateGtfsRelationalDaoImpl.java index d1fccb3b3..57ab53227 100644 --- a/onebusaway-gtfs-hibernate/src/main/java/org/onebusaway/gtfs/impl/HibernateGtfsRelationalDaoImpl.java +++ b/onebusaway-gtfs-hibernate/src/main/java/org/onebusaway/gtfs/impl/HibernateGtfsRelationalDaoImpl.java @@ -118,6 +118,16 @@ public List getAllRoutes() { return _ops.find("FROM Route route"); } + @Override + public List getAllRouteStops() { + return _ops.find("FROM RouteStop routeStop"); + } + + @Override + public List getAllRouteShapes() { + return _ops.find("FROM RouteShape routeShape"); + } + @Override public List getAllStops() { return _ops.find("FROM Stop"); diff --git a/onebusaway-gtfs-merge-cli/pom.xml b/onebusaway-gtfs-merge-cli/pom.xml index 018b40b61..c3de27d8f 100644 --- a/onebusaway-gtfs-merge-cli/pom.xml +++ b/onebusaway-gtfs-merge-cli/pom.xml @@ -3,7 +3,7 @@ onebusaway-gtfs-modules org.onebusaway - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT .. onebusaway-gtfs-merge-cli diff --git a/onebusaway-gtfs-merge/pom.xml b/onebusaway-gtfs-merge/pom.xml index 9d66d414b..f5c20072c 100644 --- a/onebusaway-gtfs-merge/pom.xml +++ b/onebusaway-gtfs-merge/pom.xml @@ -3,7 +3,7 @@ onebusaway-gtfs-modules org.onebusaway - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT .. onebusaway-gtfs-merge diff --git a/onebusaway-gtfs-transformer-cli-aws/pom.xml b/onebusaway-gtfs-transformer-cli-aws/pom.xml index 82b3903b4..f14322d5b 100644 --- a/onebusaway-gtfs-transformer-cli-aws/pom.xml +++ b/onebusaway-gtfs-transformer-cli-aws/pom.xml @@ -9,7 +9,7 @@ org.onebusaway onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT diff --git a/onebusaway-gtfs-transformer-cli/pom.xml b/onebusaway-gtfs-transformer-cli/pom.xml index 0df039591..c4cb035a1 100644 --- a/onebusaway-gtfs-transformer-cli/pom.xml +++ b/onebusaway-gtfs-transformer-cli/pom.xml @@ -9,7 +9,7 @@ org.onebusaway onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT diff --git a/onebusaway-gtfs-transformer/pom.xml b/onebusaway-gtfs-transformer/pom.xml index 1a532093d..979c0e3bb 100644 --- a/onebusaway-gtfs-transformer/pom.xml +++ b/onebusaway-gtfs-transformer/pom.xml @@ -9,14 +9,14 @@ org.onebusaway onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT org.onebusaway onebusaway-gtfs - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT org.onebusaway @@ -83,8 +83,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + 11 + 11 diff --git a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/AddExtensionFile.java b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/AddExtensionFile.java new file mode 100644 index 000000000..c4b387d00 --- /dev/null +++ b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/AddExtensionFile.java @@ -0,0 +1,78 @@ +/** + * Copyright (C) 2023 Cambridge Systematics, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onebusaway.gtfs_transformer.impl; + +import org.onebusaway.csv_entities.schema.annotations.CsvField; +import org.onebusaway.gtfs.services.GtfsMutableRelationalDao; +import org.onebusaway.gtfs_transformer.services.GtfsTransformStrategy; +import org.onebusaway.gtfs_transformer.services.TransformContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +/** + * Insert a GTFS extension into a GTFS file via a transformation. + * See the unit test for example usage. + */ + +public class AddExtensionFile implements GtfsTransformStrategy { + private static Logger _log = LoggerFactory.getLogger(AddExtensionFile.class); + + + @CsvField(optional = false) + private String extensionFilename; + @CsvField(optional = false) + private String extensionName; + @Override + public String getName() { + return this.getClass().getName(); + } + + public void setExtensionFilename(String extensionFilename) { + this.extensionFilename = extensionFilename; + } + public void setExtensionName(String extensionName) { + this.extensionName = extensionName; + } + + @Override + public void run(TransformContext context, GtfsMutableRelationalDao dao) { + // lookup the file + if (extensionFilename == null) + throw new IllegalStateException("missing required param extensionFilename"); + if (extensionName == null) + throw new IllegalStateException("missing required param extensionName"); + _log.info("AddExtensionFile entered with {} to {}", extensionName, extensionFilename); + File extension = new File(extensionFilename); + if (!extension.exists()) { + throw new IllegalStateException("attempt to add non-existant extension file:" + extension.getName()); + } + String content = null; + try { + content = Files.readString(extension.toPath()); + } catch (IOException e) { + throw new IllegalStateException(e); + } + if (content == null) + throw new IllegalStateException("no content for specified file " + extensionFilename); + + _log.info("AddExtensionFile copying {} to {}", extensionName, extensionFilename); + dao.addMetadata(extensionName, content); + } +} diff --git a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/FeedInfoFromAgencyStrategy.java b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/FeedInfoFromAgencyStrategy.java index 754c09dfb..c45516638 100644 --- a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/FeedInfoFromAgencyStrategy.java +++ b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/FeedInfoFromAgencyStrategy.java @@ -31,6 +31,7 @@ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; +import java.util.stream.Collectors; public class FeedInfoFromAgencyStrategy implements GtfsTransformStrategy { @@ -77,9 +78,13 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) { } private FeedInfo getFeedInfoFromAgency(GtfsMutableRelationalDao dao, Agency agency) { - FeedInfo info = dao.getFeedInfoForId(agencyId); - if (info == null) { - info = new FeedInfo(); + // cannot just use dao.getFeedInfoFromAgencyForId if it needs to be compatable with "update" SimpleModificationStrategy + FeedInfo info = dao.getAllFeedInfos().stream(). + filter(feed->feed.getId().equals(agencyId)) + .collect(Collectors.toMap(feed->feed.getId(), feed -> feed)) + .get(agency.getId()); + if (info==null) { + info = new FeedInfo(); } info.setId(agencyId); info.setPublisherName(agency.getName()); diff --git a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdFromControlStrategy.java b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdFromControlStrategy.java index e64d5d161..004bd7160 100644 --- a/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdFromControlStrategy.java +++ b/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdFromControlStrategy.java @@ -163,7 +163,11 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) { for (AgencyAndId id : stopsToRemove) { Stop stop = dao.getStopForId(id); //removeEntityLibrary.removeStop(dao, stop); - dao.removeEntity(stop); + if (stop != null) { + dao.removeEntity(stop); + } else { + _log.info("expecting stop {} but it was not found", id); + } } } diff --git a/onebusaway-gtfs-transformer/src/test/java/org/onebusaway/gtfs_transformer/impl/AddExtensionFileTest.java b/onebusaway-gtfs-transformer/src/test/java/org/onebusaway/gtfs_transformer/impl/AddExtensionFileTest.java new file mode 100644 index 000000000..c4e816503 --- /dev/null +++ b/onebusaway-gtfs-transformer/src/test/java/org/onebusaway/gtfs_transformer/impl/AddExtensionFileTest.java @@ -0,0 +1,98 @@ +/** + * Copyright (C) 2023 Cambridge Systematics, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onebusaway.gtfs_transformer.impl; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onebusaway.gtfs.impl.FileSupport; +import org.onebusaway.gtfs.impl.GtfsRelationalDaoImpl; +import org.onebusaway.gtfs.serialization.GtfsWriter; +import org.onebusaway.gtfs.services.GtfsRelationalDao; +import org.onebusaway.gtfs_transformer.AbstractTestSupport; +import org.onebusaway.gtfs_transformer.services.TransformContext; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.Assert.*; + +/** + * test we can insert an extension into a GTFS file via a transformation. + */ +public class AddExtensionFileTest extends AbstractTestSupport { + + private static final String TXT_STRING = "route_id,stop_id,direction_id,name\n"; + private FileSupport _support = new FileSupport(); + private GtfsRelationalDaoImpl dao = new GtfsRelationalDaoImpl(); + private AddExtensionFile test = new AddExtensionFile(); + private TransformContext context = new TransformContext(); + private GtfsWriter writer = new GtfsWriter(); + + @Before + public void setup() { + _gtfs.putAgencies(1); + _gtfs.putStops(1); + _gtfs.putRoutes(1); + _gtfs.putTrips(1, "r0", "sid0"); + _gtfs.putStopTimes("t0", "s0"); + + } + @After + public void teardown() { + _support.cleanup(); + } + + @Test + public void run() throws IOException { + File extensionFile = File.createTempFile("subwayRouteStop-", ".csv"); + if (extensionFile.exists()) + extensionFile.deleteOnExit(); + + String extensionFilename = extensionFile.getAbsolutePath();; + BufferedWriter bwriter = new BufferedWriter(new FileWriter(extensionFilename)); + bwriter.write(TXT_STRING); + bwriter.close(); + + String extensionName = "route_stop.txt"; + test.setExtensionFilename(extensionFilename); + test.setExtensionName(extensionName); + + test.run(context, dao); + + File tmpFileDirectory = File.createTempFile("AddExtensionFileTest-", "-tmp"); + if (tmpFileDirectory.exists()) + _support.deleteFileRecursively(tmpFileDirectory); + tmpFileDirectory.mkdirs(); + _support.markForDeletion(tmpFileDirectory); + writer.setOutputLocation(tmpFileDirectory); + writer.run(dao); + writer.close(); + + String modLocation = tmpFileDirectory.getAbsolutePath() + File.separator + extensionName; + File expectedFile = new File(modLocation); + // verify file is there + assertTrue("expected extension to be present!", expectedFile.exists()); + assertTrue("expected extension to be a file!", expectedFile.isFile()); + String actualText = Files.readString(Path.of(modLocation)); + assertEquals(TXT_STRING, actualText); + + } +} \ No newline at end of file diff --git a/onebusaway-gtfs/pom.xml b/onebusaway-gtfs/pom.xml index d97cbea2d..b4ba20883 100644 --- a/onebusaway-gtfs/pom.xml +++ b/onebusaway-gtfs/pom.xml @@ -9,7 +9,7 @@ org.onebusaway onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDaoImpl.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDaoImpl.java index 386719ddd..32b17c3a8 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDaoImpl.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDaoImpl.java @@ -25,6 +25,7 @@ public class GtfsDaoImpl extends GenericDaoImpl implements GtfsMutableDao { + public static final String[] OPTIONAL_FILE_NAMES = {"modifications.txt"}; private StopTimeArray stopTimes = new StopTimeArray(); private ShapePointArray shapePoints = new ShapePointArray(); @@ -33,10 +34,19 @@ public class GtfsDaoImpl extends GenericDaoImpl implements GtfsMutableDao { private boolean packShapePoints = false; - private String[] _optionalMetadataFilenames = {"modifications.txt"}; + private List _optionalMetadataFilenames = null; private Map metadataByFilename = new HashMap<>(); + public GtfsDaoImpl() { + _optionalMetadataFilenames = new ArrayList<>(); + if (OPTIONAL_FILE_NAMES != null) { + for (String optionalFileName : OPTIONAL_FILE_NAMES) { + _optionalMetadataFilenames.add(optionalFileName); + } + } + } + public boolean isPackStopTimes() { return packStopTimes; } @@ -102,6 +112,14 @@ public Collection getAllRoutes() { return getAllEntitiesForType(Route.class); } + public Collection getAllRouteStops() { + return getAllEntitiesForType(RouteStop.class); + } + + public Collection getAllRouteShapes() { + return getAllEntitiesForType(RouteShape.class); + } + public Collection getAllShapePoints() { if (packShapePoints) { return shapePoints; @@ -373,7 +391,7 @@ public void close() { @Override public List getOptionalMetadataFilenames() { - return Arrays.asList(_optionalMetadataFilenames); + return _optionalMetadataFilenames; } @Override public boolean hasMetadata(String filename) { @@ -386,6 +404,8 @@ public String getMetadata(String filename) { @Override public void addMetadata(String filename, String content) { metadataByFilename.put(filename, content); + if (!_optionalMetadataFilenames.contains(filename)) + _optionalMetadataFilenames.add(filename); } diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDataServiceImpl.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDataServiceImpl.java index d0111e17c..431fa53cc 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDataServiceImpl.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/impl/GtfsDataServiceImpl.java @@ -229,6 +229,15 @@ public Collection getAllRoutes() { return _dao.getAllRoutes(); } + @Override + public Collection getAllRouteStops() { + return _dao.getAllRouteStops(); + } + + @Override + public Collection getAllRouteShapes() { + return _dao.getAllRouteShapes(); + } @Override public Route getRouteForId(AgencyAndId id) { return _dao.getRouteForId(id); diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Route.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Route.java index 0912b7fef..b2451d6c9 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Route.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Route.java @@ -56,7 +56,7 @@ public final class Route extends IdentityBean { @CsvField(name = "network_id", optional = true) private String networkId; - @CsvField(name = "eligibility_restricted", optional = true) + @CsvField(name = "eligibility_restricted", optional = true, defaultValue = "-999") private int eligibilityRestricted = MISSING_VALUE; @Deprecated diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RouteShape.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RouteShape.java new file mode 100644 index 000000000..62c2c30dd --- /dev/null +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RouteShape.java @@ -0,0 +1,83 @@ +/** + * Copyright (C) 2023 Cambridge Systematics, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onebusaway.gtfs.model; + +import org.onebusaway.csv_entities.schema.annotations.CsvField; +import org.onebusaway.csv_entities.schema.annotations.CsvFields; + +/** + * experimental support for canonical/idealized route shapes such + * as a map's representation of service + */ +@CsvFields(filename = "route_shape.txt", required = false) +public final class RouteShape extends IdentityBean { + private static final long serialVersionUID = 1L; + + @CsvField(ignore = true) + private int id; + + @CsvField + private String routeId; + @CsvField(optional = true) + private String directionId; + @CsvField + private String type; + @CsvField + private String encodedShape; + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public String getDirectionId() { + return directionId; + } + + public void setDirectionId(String directionId) { + this.directionId = directionId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getEncodedShape() { + return encodedShape; + } + + public void setEncodedShape(String encodedShape) { + this.encodedShape = encodedShape; + } + + @Override + public Integer getId() { + return id; + } + + @Override + public void setId(Integer id) { + this.id = id; + } + +} diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RouteStop.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RouteStop.java new file mode 100644 index 000000000..44ac241ab --- /dev/null +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RouteStop.java @@ -0,0 +1,98 @@ +/** + * Copyright (C) 2023 Cambridge Systematics, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onebusaway.gtfs.model; + +import org.onebusaway.csv_entities.schema.annotations.CsvField; +import org.onebusaway.csv_entities.schema.annotations.CsvFields; + +/** + * experimental support for canonical/idealized route stops such + * as a strip map's representation of service + */ +@CsvFields(filename = "route_stop.txt", required = false) +public final class RouteStop extends IdentityBean { + + private static final long serialVersionUID = 1L; + + @CsvField(ignore = true) + private int id; + + @CsvField(name = "route_id") + private String routeId; + + @CsvField(name = "stop_id") + private String stopId; + + @CsvField(name = "stop_sequence") + private int stopSequence; + + @CsvField(optional = true, defaultValue = "") + private String directionId; + + @CsvField(optional = true, defaultValue = "") + private String name; + + public String getRouteId() { + return routeId; + } + + public void setRouteId(String routeId) { + this.routeId = routeId; + } + + public String getStopId() { + return stopId; + } + + public void setStopId(String stopId) { + this.stopId = stopId; + } + + public int getStopSequence() { + return stopSequence; + } + + public void setStopSequence(int stopSequence) { + this.stopSequence = stopSequence; + } + + public String getDirectionId() { + return directionId; + } + + public void setDirectionId(String directionId) { + this.directionId = directionId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public Integer getId() { + return id; + } + + @Override + public void setId(Integer id) { + this.id = id; + } + +} diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsEntitySchemaFactory.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsEntitySchemaFactory.java index af6545c17..5271f5ef1 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsEntitySchemaFactory.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsEntitySchemaFactory.java @@ -42,6 +42,8 @@ public static List> getEntityClasses() { entityClasses.add(BookingRule.class); entityClasses.add(ShapePoint.class); entityClasses.add(Route.class); + entityClasses.add(RouteStop.class); + entityClasses.add(RouteShape.class); entityClasses.add(Level.class); entityClasses.add(Stop.class); entityClasses.add(StopArea.class); diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsReader.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsReader.java index c2e8ded01..1f090740e 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsReader.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/GtfsReader.java @@ -69,6 +69,8 @@ public GtfsReader() { _entityClasses.add(Area.class); _entityClasses.add(BookingRule.class); _entityClasses.add(Route.class); + _entityClasses.add(RouteStop.class); + _entityClasses.add(RouteShape.class); _entityClasses.add(Level.class); _entityClasses.add(Stop.class); _entityClasses.add(Location.class); diff --git a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/services/GtfsDao.java b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/services/GtfsDao.java index 0d1e80658..1ba330d8c 100644 --- a/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/services/GtfsDao.java +++ b/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/services/GtfsDao.java @@ -132,6 +132,10 @@ public interface GtfsDao extends GenericDao { public Collection getAllRoutes(); + public Collection getAllRouteStops(); + + public Collection getAllRouteShapes(); + public Route getRouteForId(AgencyAndId id); /**** diff --git a/pom.xml b/pom.xml index c7303e32e..5d48116a8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,11 @@ org.onebusaway onebusaway - 1.2.8 + 1.2.9 onebusaway-gtfs-modules - 1.3.119-MBTA-SNAPSHOT + 1.4.4-MBTA-SNAPSHOT pom onebusaway-gtfs-modules @@ -15,7 +15,7 @@ https://github.com/mbta/onebusaway-gtfs-modules/wiki/ - 1.1.6 + 1.1.7 1.2.8 2.0.6 mbta/onebusaway-gtfs-modules @@ -25,7 +25,7 @@ scm:git:https://github.com/mbta/onebusaway-gtfs-modules.git scm:git:ssh://git@github.com/mbta/onebusaway-gtfs-modules.git https://github.com/mbta/onebusaway-gtfs-modules - onebusaway-gtfs-modules-1.3.119 + HEAD @@ -177,8 +177,8 @@ maven-compiler-plugin 3.10.1 - 1.8 - 1.8 + 11 + 11