Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OneBusAway/onebusaway-gtfs-modules
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.0
Choose a base ref
...
head repository: OneBusAway/onebusaway-gtfs-modules
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 18, 2024

  1. Copy the full SHA
    89d57f9 View commit details
  2. Copy the full SHA
    af63910 View commit details
  3. Copy the full SHA
    886e5ca View commit details

Commits on Dec 20, 2024

  1. format FareProduct amount as currency

    When exporting to CSV, FareProduct amount should use the appropriate number of decimal places based on the currency specified. Introduces FareAmountFieldMappingFactory to do so.
    sberkley committed Dec 20, 2024
    Copy the full SHA
    d7f98ab View commit details

Commits on Jan 3, 2025

  1. Copy the full SHA
    c8f8c9a View commit details

Commits on Jan 8, 2025

  1. Copy the full SHA
    317b0cc View commit details
  2. Copy the full SHA
    f2bd4b0 View commit details
  3. Merge pull request #318 from OneBusAway/renovate/commons-beanutils-co…

    …mmons-beanutils-1.x
    
    Update dependency commons-beanutils:commons-beanutils to v1.10.0
    leonardehrenfried authored Jan 8, 2025
    Copy the full SHA
    d34847a View commit details
  4. Merge pull request #319 from OneBusAway/renovate/org.json-json-202501…

    …07.x
    
    Update dependency org.json:json to v20250107
    leonardehrenfried authored Jan 8, 2025
    Copy the full SHA
    6694d7c View commit details

Commits on Jan 9, 2025

  1. Update FareAmountFieldMappingFactory.java

    explicitly cast fare amount from CSV to string, then float
    sberkley committed Jan 9, 2025
    Copy the full SHA
    39c849a View commit details
  2. Update FareAmountFieldMappingFactoryTest.java

    use string in CSV to object tests
    sberkley committed Jan 9, 2025
    Copy the full SHA
    db57d19 View commit details

Commits on Jan 10, 2025

  1. Update onebusaway-gtfs/src/test/java/org/onebusaway/gtfs/serializatio…

    …n/FareProductWriterTest.java
    leonardehrenfried authored Jan 10, 2025
    Copy the full SHA
    b423677 View commit details
  2. Merge pull request #320 from sberkley/currency_format

    Format currency amounts in fare_products.txt with 2 decimal digits
    leonardehrenfried authored Jan 10, 2025
    Copy the full SHA
    8eb7f39 View commit details
  3. Copy the full SHA
    bacd609 View commit details
  4. Copy the full SHA
    b238b03 View commit details
  5. Copy the full SHA
    2d87564 View commit details

Commits on Jan 11, 2025

  1. Copy the full SHA
    1ab674e View commit details

Commits on Jan 15, 2025

  1. Update Stop.java

    Do not require stops.txt to be present as it is not required for gtfs-flex data.
    sharhio authored Jan 15, 2025
    Copy the full SHA
    5bf9531 View commit details

Commits on Jan 17, 2025

  1. Update dependency org.mockito:mockito-core to v5.15.2 (#323)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 17, 2025
    Copy the full SHA
    314caf2 View commit details

Commits on Jan 21, 2025

  1. test and documentation

    sharhio committed Jan 21, 2025
    Copy the full SHA
    6acf009 View commit details
  2. Merge pull request #322 from sharhio/patch-1

    Because of GTFS-Flex `stops.txt` is no longer a required file
    leonardehrenfried authored Jan 21, 2025
    Copy the full SHA
    b103902 View commit details
  3. Copy the full SHA
    a9b9ae0 View commit details
  4. Copy the full SHA
    2e1065c View commit details
  5. Copy the full SHA
    0a8c06d View commit details

Commits on Jan 22, 2025

  1. Merge pull request #325 from OneBusAway/renovate/com.mysql-mysql-conn…

    …ector-j-9.x
    
    Update dependency com.mysql:mysql-connector-j to v9.2.0
    leonardehrenfried authored Jan 22, 2025
    Copy the full SHA
    29f19bc View commit details

Commits on Jan 23, 2025

  1. Update dependency org.sonatype.central:central-publishing-maven-plugi…

    …n to v0.7.0 (#326)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 23, 2025
    Copy the full SHA
    96acaf1 View commit details
  2. Copy the full SHA
    3a39416 View commit details

Commits on Jan 24, 2025

  1. Fix typo

    leonardehrenfried authored Jan 24, 2025
    Copy the full SHA
    0fc4eca View commit details
  2. Merge pull request #327 from sebastianknopf/324-docs-retain-feed_info

    improved documentation for retaining feed_info.txt
    leonardehrenfried authored Jan 24, 2025
    Copy the full SHA
    5ee59d9 View commit details

Commits on Jan 29, 2025

  1. Add isDefatulFareCategory to RiderCategories

    Enum that specifies if a rider category should be treated as the default (e.g. full adult fare) vs a category with special eligibility.
    sberkley committed Jan 29, 2025
    Copy the full SHA
    20e1d46 View commit details
  2. Update FaresV2ReaderTest.java

    test that unspecified is treated as 0
    sberkley committed Jan 29, 2025
    Copy the full SHA
    0c96467 View commit details

Commits on Jan 31, 2025

  1. Merge pull request #309 from OneBusAway/remove-camsys-repo

    Transformer: remove dependency on camsys-apps repository, `onebusaway-cloud-api`
    leonardehrenfried authored Jan 31, 2025
    Copy the full SHA
    91835b8 View commit details

Commits on Feb 3, 2025

  1. Copy the full SHA
    6e48397 View commit details
  2. Copy the full SHA
    288fbbb View commit details

Commits on Feb 12, 2025

  1. Update RiderCategory.java

    add experimental and deprecated annotations to RiderCategories fields
    sberkley committed Feb 12, 2025
    Copy the full SHA
    32042f2 View commit details

Commits on Feb 13, 2025

  1. Merge pull request #328 from sberkley/rider_categories

    Support finalized RiderCategories spec
    leonardehrenfried authored Feb 13, 2025
    Copy the full SHA
    e481a6d View commit details
  2. Copy the full SHA
    0b589ad View commit details
  3. Copy the full SHA
    e179b15 View commit details
  4. Copy the full SHA
    9685a89 View commit details
  5. Merge pull request #330 from OneBusAway/renovate/commons-beanutils-co…

    …mmons-beanutils-1.x
    
    Update dependency commons-beanutils:commons-beanutils to v1.10.1
    leonardehrenfried authored Feb 13, 2025
    Copy the full SHA
    d249bef View commit details
Showing with 627 additions and 422 deletions.
  1. +4 −3 .github/release.yml
  2. +9 −0 docs/onebusaway-gtfs-transformer-cli.md
  3. +1 −1 onebusaway-collections/pom.xml
  4. +3 −3 onebusaway-csv-entities/pom.xml
  5. +12 −1 ...way-csv-entities/src/main/java/org/onebusaway/csv_entities/schema/DecimalFieldMappingFactory.java
  6. +1 −1 onebusaway-gtfs-hibernate-cli/pom.xml
  7. +2 −2 onebusaway-gtfs-hibernate/pom.xml
  8. +1 −1 onebusaway-gtfs-merge-cli/pom.xml
  9. +1 −1 onebusaway-gtfs-merge/pom.xml
  10. +1 −1 onebusaway-gtfs-transformer-cli/pom.xml
  11. +2 −36 onebusaway-gtfs-transformer/pom.xml
  12. +0 −3 ...away-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/factory/TransformFactory.java
  13. +0 −7 ...-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/AnomalyCheckFutureTripCounts.java
  14. +0 −7 ...ay-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/CheckForFutureService.java
  15. +0 −7 ...fs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/CheckForPlausibleStopTimes.java
  16. +0 −5 ...tfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/CompareToReferenceService.java
  17. +0 −10 onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/CountAndTest.java
  18. +3 −25 onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/CountAndTestBus.java
  19. +0 −10 ...saway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/CountAndTestSubway.java
  20. +0 −10 ...gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/ExtrapolateRidershipData.java
  21. +0 −19 ...way-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/MTAEntrancesStrategy.java
  22. +0 −10 ...ansformer/src/main/java/org/onebusaway/gtfs_transformer/impl/MTAStationAccessibilityStrategy.java
  23. +0 −4 onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdById.java
  24. +0 −13 ...ansformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdFromControlStrategy.java
  25. +0 −16 ...ay-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopIdsFromFile.java
  26. +1 −8 ...y-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/UpdateStopTimesForTime.java
  27. +0 −7 onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/ValidateGTFS.java
  28. +0 −11 ...gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/VerifyFutureRouteService.java
  29. +0 −11 ...y-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/VerifyReferenceService.java
  30. +0 −5 ...away-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/updates/VerifyBusService.java
  31. +0 −170 ...ay-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/updates/VerifyRouteService.java
  32. +1 −1 onebusaway-gtfs/pom.xml
  33. +2 −1 onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/FareProduct.java
  34. +26 −2 onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/RiderCategory.java
  35. +4 −1 onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/model/Stop.java
  36. +83 −0 ...-gtfs/src/main/java/org/onebusaway/gtfs/serialization/mappings/FareAmountFieldMappingFactory.java
  37. +121 −0 onebusaway-gtfs/src/test/java/org/onebusaway/gtfs/model/RiderCategoryTest.java
  38. +121 −0 onebusaway-gtfs/src/test/java/org/onebusaway/gtfs/serialization/FareProductWriterTest.java
  39. +21 −0 onebusaway-gtfs/src/test/java/org/onebusaway/gtfs/serialization/FaresV2ReaderTest.java
  40. +39 −0 onebusaway-gtfs/src/test/java/org/onebusaway/gtfs/serialization/GtfsReaderTest.java
  41. +157 −0 ...s/src/test/java/org/onebusaway/gtfs/serialization/mappings/FareAmountFieldMappingFactoryTest.java
  42. +6 −5 onebusaway-gtfs/src/test/resources/org/onebusaway/gtfs/mdot-metro-fares-v2/rider_categories.txt
  43. +4 −4 pom.xml
  44. +1 −0 renovate.json5
7 changes: 4 additions & 3 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -6,9 +6,10 @@ changelog:
- title: Bugfixes
labels:
- bug
- title: Non-breaking changes
labels:
- "*"
- title: Dependency upgrades
labels:
- dependencies
- title: Non-breaking changes
labels:
- "*"

9 changes: 9 additions & 0 deletions docs/onebusaway-gtfs-transformer-cli.md
Original file line number Diff line number Diff line change
@@ -263,6 +263,15 @@ example:
{"op":"retain","match":{"file":"routes.txt", "route_short_name":"B15"}, "retainBlocks":false}
```

If you retain for example some route using the snippet above, every entity which is not referenced by this route or any other entity in relation to this route
will also be removed. This includes reference-less information like feed_info.txt. To keep the optional feed_info.txt, simply retain the file like any other entity
type, but without an ID:
```
{"op":"retain", "match":{"file":"feed_info.txt"}}
```

This ensures, that a file is also retained regardless of any reference to the data in this file.

#### Remove an Entity

You can remove a specific entity from a feed.
2 changes: 1 addition & 1 deletion onebusaway-collections/pom.xml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
<parent>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs-modules</artifactId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

6 changes: 3 additions & 3 deletions onebusaway-csv-entities/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs-modules</artifactId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@@ -19,7 +19,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<version>1.10.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.14.2</version>
<version>5.15.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Currency;
import java.util.Locale;
import java.util.Map;

@@ -37,6 +38,8 @@ public class DecimalFieldMappingFactory implements FieldMappingFactory {

private Locale _locale = Locale.US;

private Currency _currency;

public DecimalFieldMappingFactory() {

}
@@ -50,6 +53,10 @@ public DecimalFieldMappingFactory(String format, Locale locale) {
_locale = locale;
}

public DecimalFieldMappingFactory(Currency currency) {
_currency = currency;
}

@Override
public FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory,
Class<?> entityType, String csvFieldName, String objFieldName,
@@ -63,7 +70,11 @@ public FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory,

private NumberFormat getFormat(Class<?> entityType, String objFieldName) {
String format = determineFormat(entityType, objFieldName);
if (_locale == null) {
if (_currency != null) {
NumberFormat currFormatter = NumberFormat.getCurrencyInstance(Locale.US);
currFormatter.setCurrency(_currency);
return currFormatter;
} else if (_locale == null) {
return new DecimalFormat(format);
} else {
return new DecimalFormat(format, new DecimalFormatSymbols(_locale));
2 changes: 1 addition & 1 deletion onebusaway-gtfs-hibernate-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs-modules</artifactId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onebusaway-gtfs-hibernate-cli</artifactId>
4 changes: 2 additions & 2 deletions onebusaway-gtfs-hibernate/pom.xml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<parent>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs-modules</artifactId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@@ -35,7 +35,7 @@
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>9.1.0</version>
<version>9.2.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
2 changes: 1 addition & 1 deletion onebusaway-gtfs-merge-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<artifactId>onebusaway-gtfs-modules</artifactId>
<groupId>org.onebusaway</groupId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>onebusaway-gtfs-merge-cli</artifactId>
2 changes: 1 addition & 1 deletion onebusaway-gtfs-merge/pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<parent>
<artifactId>onebusaway-gtfs-modules</artifactId>
<groupId>org.onebusaway</groupId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>onebusaway-gtfs-merge</artifactId>
2 changes: 1 addition & 1 deletion onebusaway-gtfs-transformer-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<parent>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs-modules</artifactId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<dependencies>
38 changes: 2 additions & 36 deletions onebusaway-gtfs-transformer/pom.xml
Original file line number Diff line number Diff line change
@@ -9,21 +9,9 @@
<parent>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-gtfs-modules</artifactId>
<version>5.0.0</version>
<version>6.1.1-SNAPSHOT</version>
</parent>

<repositories>
<repository>
<id>central2</id>
<name>Check central first to avoid a lot of not found warnings</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>releases-camsys-public-repo</id>
<url>https://repo.camsys-apps.com/releases/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.onebusaway</groupId>
@@ -38,7 +26,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20241224</version>
<version>20250107</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
@@ -55,28 +43,6 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-cloud-api</artifactId>
<version>${onebusaway.cloud.version}</version>
</dependency>
<dependency>
<groupId>org.onebusaway</groupId>
<artifactId>onebusaway-cloud-noop</artifactId>
<version>${onebusaway.cloud.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
Original file line number Diff line number Diff line change
@@ -255,9 +255,6 @@ else if (opType.equals("count_and_test_bus")) {
else if (opType.equals("count_and_test_subway")) {
handleTransformOperation(line, json, new CountAndTestSubway());
}
else if (opType.equals("verify_route_service")) {
handleTransformOperation(line, json, new VerifyRouteService());
}
else if (opType.equals("verify_bus_service")) {
handleTransformOperation(line, json, new VerifyBusService());
}
Original file line number Diff line number Diff line change
@@ -17,8 +17,6 @@

package org.onebusaway.gtfs_transformer.impl;

import org.onebusaway.cloud.api.ExternalServices;
import org.onebusaway.cloud.api.ExternalServicesBridgeFactory;
import org.onebusaway.csv_entities.CSVLibrary;
import org.onebusaway.csv_entities.CSVListener;
import org.onebusaway.csv_entities.schema.annotations.CsvField;
@@ -110,8 +108,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao){
}


ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices();

String[] days = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","Holiday"};


@@ -145,9 +141,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao){
_log.info(dateDay + " has " + tripCount + " trips, and we are ignoring this possible anomoly");
} else {
_log.info(dateDay + " has " + tripCount + " trips, this may indicate a problem.");
if (!silentMode) {
es.publishMessage(CloudContextService.getTopic(), dateDay.toString() + " has " + tripCount + " trips, this may indicate a problem.");
}
}
}
dayCounter ++;
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@
*/
package org.onebusaway.gtfs_transformer.impl;

import org.onebusaway.cloud.api.ExternalServices;
import org.onebusaway.cloud.api.ExternalServicesBridgeFactory;
import org.onebusaway.csv_entities.schema.annotations.CsvField;
import org.onebusaway.gtfs.model.*;
import org.onebusaway.gtfs.model.calendar.ServiceDate;
@@ -59,7 +57,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
Date dayAfterNext = helper.removeTime(helper.addDays(new Date(), 3));

String feed = CloudContextService.getLikelyFeedName(dao);
ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices();
String agency = dao.getAllAgencies().iterator().next().getId();
String agencyName = dao.getAllAgencies().iterator().next().getName();

@@ -69,10 +66,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
tripsDayAfterNext = hasServiceForDate(dao, dayAfterNext);

_log.info("Feed for metrics: {}, agency id: {}", feed, agencyName);
es.publishMetric(CloudContextService.getNamespace(), "TripsToday", "feed", feed, tripsToday);
es.publishMetric(CloudContextService.getNamespace(), "TripsTomorrow", "feed", feed, tripsTomorrow);
es.publishMetric(CloudContextService.getNamespace(), "TripsIn2Days", "feed", feed, tripsNextDay);
es.publishMetric(CloudContextService.getNamespace(), "TripsIn3Days", "feed", feed, tripsDayAfterNext);

_log.info("TripsToday: {}, feed: {}, namespace: {}", tripsToday, feed, CloudContextService.getNamespace());
_log.info("TripsTomorrow: {}, feed: {}, namespace: {}", tripsTomorrow, feed, CloudContextService.getNamespace());
Original file line number Diff line number Diff line change
@@ -15,11 +15,8 @@
*/
package org.onebusaway.gtfs_transformer.impl;

import org.onebusaway.cloud.api.ExternalServices;
import org.onebusaway.cloud.api.ExternalServicesBridgeFactory;
import org.onebusaway.gtfs.model.*;
import org.onebusaway.gtfs.services.GtfsMutableRelationalDao;
import org.onebusaway.gtfs_transformer.services.CloudContextService;
import org.onebusaway.gtfs_transformer.services.GtfsTransformStrategy;
import org.onebusaway.gtfs_transformer.services.TransformContext;
import org.slf4j.Logger;
@@ -41,8 +38,6 @@ public String getName() {

@Override
public void run(TransformContext context, GtfsMutableRelationalDao dao) {
String feed = CloudContextService.getLikelyFeedName(dao);
ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices();
RemoveEntityLibrary removeEntityLibrary = new RemoveEntityLibrary();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
Set<Trip> stopsWarn = new HashSet<Trip>();
@@ -101,14 +96,12 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
stopsWarn.size() + ".\n Here are the trips and stops: " + collectedWarnString.substring(2);
_log.info(collectedWarnString);
}
es.publishMetric(CloudContextService.getNamespace(), "TripsWith1-3HrTransitTime", "feed", feed, stopsWarn.size());
if (stopsRemove.size() > 0) {
collectedRemoveString = "Total number of trips with transit times of greater than three hours: " +
stopsRemove.size() + ".\n These trips are being removed. \nTrips being removed: " +
collectedRemoveString.substring(2);
_log.info(collectedRemoveString);
}
es.publishMetric(CloudContextService.getNamespace(), "TripsWithRemovedForTransitTime", "feed", feed, stopsRemove.size());
for (Trip trip: stopsRemove){
removeEntityLibrary.removeTrip(dao, trip);
}
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@
*/
package org.onebusaway.gtfs_transformer.impl;

import org.onebusaway.cloud.api.ExternalServices;
import org.onebusaway.cloud.api.ExternalServicesBridgeFactory;
import org.onebusaway.csv_entities.schema.annotations.CsvField;
import org.onebusaway.gtfs.model.*;
import org.onebusaway.gtfs.model.calendar.ServiceDate;
@@ -64,7 +62,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao gtfsDao) {
defaultAgencyId = CloudContextService.getLikelyFeedName(gtfsDao);
String summaryTopic = CloudContextService.getTopic() + "-atis-summary";
String detailTopic = CloudContextService.getTopic() + "-atis-detail";
ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices();

String summaryHeader = "depot,unmatched_gtfs_trips,unmatched_reference_trips\n";
String detailHeader = "depot,unmatched_gtfs_trip_ds,unmatched_reference_trip_ids\n";
@@ -126,8 +123,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao gtfsDao) {
String time = lpad(cal.get(Calendar.HOUR_OF_DAY), 2) + ":" + lpad(cal.get(Calendar.MINUTE),2 );
String baseurl = s3BasePath
+ "/" + year + "/" + month + "/" + day + "/" + time + "-";
es.putFile(baseurl + "summary.csv", summaryFilename);
es.putFile(baseurl + "detail.csv", detailFilename);


_log.error("{} Unmatched Summary", getName());
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@
*/
package org.onebusaway.gtfs_transformer.impl;

import org.onebusaway.cloud.api.ExternalServices;
import org.onebusaway.cloud.api.ExternalServicesBridgeFactory;
import org.onebusaway.gtfs.model.*;
import org.onebusaway.gtfs.model.calendar.ServiceDate;
import org.onebusaway.gtfs.services.GtfsMutableRelationalDao;
@@ -154,15 +152,13 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
dao.getAllTrips().size(), curSerTrips, dao.getAllStops().size(),
dao.getAllStopTimes().size(), countSt, countNoSt, countNoHs);

ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices();
String feed = CloudContextService.getLikelyFeedName(dao);

HashSet<String> ids = new HashSet<String>();
for (Stop stop : dao.getAllStops()) {
//check for duplicate stop ids.
if (ids.contains(stop.getId().getId())) {
_log.error("Duplicate stop ids! Agency {} stop id {}", agency, stop.getId().getId());
es.publishMultiDimensionalMetric(CloudContextService.getNamespace(),"DuplicateStopIds", new String[]{"feed","stopId"}, new String[] {feed,stop.getId().toString()},1);
throw new IllegalStateException(
"There are duplicate stop ids!");
}
@@ -172,11 +168,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
}


es.publishMetric(CloudContextService.getNamespace(),"TripsInServiceToday","feed", feed,curSerTrips);
es.publishMetric(CloudContextService.getNamespace(),"TripsInServiceTomorrow","feed", feed,tomSerTrips);



if (curSerTrips + tomSerTrips < 1) {
throw new IllegalStateException(
"There is no current service!!");
@@ -185,7 +176,6 @@ public void run(TransformContext context, GtfsMutableRelationalDao dao) {
if (countNoHs > 0) {
_log.error("There are trips with no headsign");
}
es.publishMetric(CloudContextService.getNamespace(), "TripsWithoutHeadsigns", "feed", feed, countNoHs);
}

private Date removeTime(Date date) {
Loading