diff --git a/pom.xml b/pom.xml index bd9ef11e8..b525edaba 100644 --- a/pom.xml +++ b/pom.xml @@ -271,8 +271,8 @@ com.github.ibi-group gtfs-lib - - 5e24a64c4266c5cc9866eaa4b11a1231270a2498 + 2bd924c6e5f5244a279c9d94298c14c0b3d47b35 + diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/MergeFeedsJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/MergeFeedsJob.java index ab683b090..284ecdbda 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/MergeFeedsJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/MergeFeedsJob.java @@ -18,8 +18,12 @@ import com.conveyal.datatools.manager.persistence.Persistence; import com.conveyal.datatools.manager.utils.ErrorUtils; import com.conveyal.gtfs.loader.Feed; +import com.conveyal.gtfs.loader.JdbcGtfsExporter; import com.conveyal.gtfs.loader.Table; +import com.conveyal.gtfs.model.Location; +import com.conveyal.gtfs.model.LocationShape; import com.conveyal.gtfs.model.StopTime; +import com.conveyal.gtfs.util.GeoJsonUtil; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Lists; @@ -38,13 +42,17 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; +import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import static com.conveyal.datatools.manager.jobs.feedmerge.MergeFeedsType.SERVICE_PERIOD; import static com.conveyal.datatools.manager.jobs.feedmerge.MergeFeedsType.REGIONAL; import static com.conveyal.datatools.manager.jobs.feedmerge.MergeStrategy.CHECK_STOP_TIMES; import static com.conveyal.datatools.manager.models.FeedRetrievalMethod.REGIONAL_MERGE; -import static com.conveyal.datatools.manager.utils.MergeFeedUtils.*; +import static com.conveyal.datatools.manager.utils.MergeFeedUtils.getMergedVersion; +import static com.conveyal.datatools.manager.utils.MergeFeedUtils.stopTimesMatchSimplified; +import static com.conveyal.datatools.manager.utils.StringUtils.getCleanName; +import static com.conveyal.gtfs.loader.Table.LOCATION_GEO_JSON_FILE_NAME; /** * This job handles merging two or more feed versions according to logic specific to the specified merge type. @@ -204,6 +212,8 @@ public void jobLogic() { } } + mergeLocations(out); + // Loop over GTFS tables and merge each feed one table at a time. for (int i = 0; i < numberOfTables; i++) { Table table = tablesToMerge.get(i); @@ -225,7 +235,7 @@ public void jobLogic() { status.fail(message, e); } finally { try { - feedMergeContext.close(); + if (feedMergeContext != null) feedMergeContext.close(); } catch (IOException e) { logAndReportToBugsnag(e, "Error closing FeedMergeContext object"); } @@ -245,6 +255,39 @@ public void jobLogic() { } } + /** + * Merge locations.geojson files. These files are not compatible with the CSV merging strategy. Instead, the + * location.geojson file is flattened into locations and locations shapes. The location id is then updated with the + * scope id to keep feed locations unique, converted back into geojson and written to the zip file. + * + * Locations must be processed prior to other CSV files so the location ids are available for foreign reference + * checks. + */ + void mergeLocations(ZipOutputStream out) throws IOException { + Set mergedLocations = new HashSet<>(); + Set mergedLocationShapes = new HashSet<>(); + for (FeedToMerge feed : feedMergeContext.feedsToMerge) { + ZipEntry locationGeoJsonFile = feed.zipFile.getEntry(LOCATION_GEO_JSON_FILE_NAME); + if (locationGeoJsonFile != null) { + String idScope = getCleanName(feed.version.parentFeedSource().name) + feed.version.version; + List locations = GeoJsonUtil.getLocationsFromGeoJson(feed.zipFile, locationGeoJsonFile, null); + for (Location location : locations) { + location.location_id = String.join(":", idScope, location.location_id); + mergedLocations.add(location); + feedMergeContext.locationIds.add(location.location_id); + } + List locationShapes = GeoJsonUtil.getLocationShapesFromGeoJson(feed.zipFile, locationGeoJsonFile, null); + for (LocationShape locationShape : locationShapes) { + locationShape.location_id = String.join(":", idScope, locationShape.location_id); + mergedLocationShapes.add(locationShape); + } + } + } + if (!mergedLocations.isEmpty()) { + JdbcGtfsExporter.writeLocationsToFile(out, new ArrayList<>(mergedLocations), new ArrayList<>(mergedLocationShapes)); + } + } + /** * Obtains trip ids whose entries in the stop_times table differ between the active and future feed. */ @@ -281,6 +324,10 @@ private boolean shouldSkipTable(String tableName) { LOG.warn("Skipping editor-only table {}.", tableName); return true; } + if (tableName.equals(Table.LOCATIONS.name) || tableName.equals(Table.LOCATION_SHAPES.name)) { + LOG.warn("{} detected. Skipping traditional merge in favour of bespoke merge.", LOCATION_GEO_JSON_FILE_NAME); + return true; + } return false; } diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/FeedMergeContext.java b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/FeedMergeContext.java index 371112026..da5974856 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/FeedMergeContext.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/FeedMergeContext.java @@ -9,6 +9,7 @@ import java.io.Closeable; import java.io.IOException; import java.time.LocalDate; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -23,6 +24,8 @@ public class FeedMergeContext implements Closeable { public final boolean tripIdsMatch; public final LocalDate futureFirstCalendarStartDate; public final Set sharedTripIds; + public Set locationIds = new HashSet<>(); + public FeedMergeContext(Set feedVersions, Auth0UserProfile owner) throws IOException { feedsToMerge = MergeFeedUtils.collectAndSortFeeds(feedVersions, owner); diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeFeedsResult.java b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeFeedsResult.java index 881c78051..46f980d09 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeFeedsResult.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeFeedsResult.java @@ -36,6 +36,12 @@ public class MergeFeedsResult implements Serializable { */ public Set calendarDatesServiceIds = new HashSet<>(); + /** + * Track various table ids for resolving foreign references. + */ + public Set stopIds = new HashSet<>(); + public Set stopAreaIds = new HashSet<>(); + /** * Track the set of route IDs to end up in the merged feed in order to determine which route_attributes * records should be retained in the merged result. diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java index e77a1c47d..15d9a77c2 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/MergeLineContext.java @@ -229,6 +229,7 @@ public boolean iterateOverRows() throws IOException { public void startNewRow() throws IOException { keyValue = csvReader.get(keyFieldIndex); + setForeignReferenceKeyValues(); // Get the spec fields to export List specFields = table.specFields(); // Filter the spec fields on the set of fields found in all feeds to be merged. @@ -238,8 +239,24 @@ public void startNewRow() throws IOException { } /** - * Determine which reference table to use. If there is only one reference use this. If there are multiple references - * determine the context and then the correct reference table to use. + * Build a list of table key id values to be used in foreign key field look-ups. + */ + private void setForeignReferenceKeyValues() { + switch (table.name) { + case "stops": + mergeFeedsResult.stopIds.add(getIdWithScope(keyValue)); + break; + case "stop_areas": + mergeFeedsResult.stopAreaIds.add(getIdWithScope(keyValue)); + break; + default: + // nothing. + } + } + + /** + * Determine which reference table to use. If there is only one reference use this. If there are multiple + * references, determine the context and then the correct reference table to use. */ private Table getReferenceTable(FieldContext fieldContext, Field field) { if (field.referenceTables.size() == 1) { @@ -255,8 +272,17 @@ private Table getReferenceTable(FieldContext fieldContext, Field field) { getTableScopedValue(Table.CALENDAR_DATES, fieldContext.getValue()) ); case STOP_TIMES_STOP_ID_KEY: + return ReferenceTableDiscovery.getStopTimeStopIdReferenceTable( + fieldContext.getValueToWrite(), + mergeFeedsResult, + feedMergeContext.locationIds + ); case STOP_AREA_STOP_ID_KEY: - // Include other cases as multiple references are added e.g. flex!. + return ReferenceTableDiscovery.getStopAreaAreaIdReferenceTable( + fieldContext.getValueToWrite(), + mergeFeedsResult, + feedMergeContext.locationIds + ); default: return null; } diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java index bf96de3cb..00e5f9afe 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/feedmerge/ReferenceTableDiscovery.java @@ -3,6 +3,7 @@ import com.conveyal.gtfs.loader.Field; import com.conveyal.gtfs.loader.Table; +import java.util.Set; import java.util.stream.Collectors; import static com.conveyal.datatools.manager.jobs.feedmerge.MergeLineContext.SERVICE_ID; @@ -11,6 +12,9 @@ public class ReferenceTableDiscovery { public static final String REF_TABLE_SEPARATOR = "#~#"; + /** + * Tables that have two or more foreign references. + */ public enum ReferenceTableKey { TRIP_SERVICE_ID_KEY( @@ -106,4 +110,38 @@ public static Table getTripServiceIdReferenceTable( } return null; } + + /** + * Define the reference table for a stop area's area id. This will either be a stop or location. + */ + public static Table getStopAreaAreaIdReferenceTable( + String fieldValue, + MergeFeedsResult mergeFeedsResult, + Set locationIds + ) { + if (mergeFeedsResult.stopIds.contains(fieldValue)) { + return Table.STOPS; + } else if (locationIds.contains(fieldValue)) { + return Table.LOCATIONS; + } + return null; + } + + /** + * Define the reference table for a stop time's stop id. This will either be a stop, location or stop area. + */ + public static Table getStopTimeStopIdReferenceTable( + String fieldValue, + MergeFeedsResult mergeFeedsResult, + Set locationIds + ) { + if (mergeFeedsResult.stopIds.contains(fieldValue)) { + return Table.STOPS; + } else if (locationIds.contains(fieldValue)) { + return Table.LOCATIONS; + } else if (mergeFeedsResult.stopAreaIds.contains(fieldValue)) { + return Table.STOP_AREAS; + } + return null; + } } diff --git a/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java b/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java index 0940f6f9d..6e660e556 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java +++ b/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java @@ -423,7 +423,6 @@ public void validateMobility(MonitorableJob.Status status) { // Wait for the file to be entirely copied into the directory. // 5 seconds + ~1 second per 10mb Thread.sleep(5000 + (this.fileSize / 10000)); - File gtfsZip = this.retrieveGtfsFile(); // Namespace based folders avoid clash for validation being run on multiple versions of a feed. // TODO: do we know that there will always be a namespace? String validatorOutputDirectory = "/tmp/datatools_gtfs/" + this.namespace + "/"; @@ -431,7 +430,7 @@ public void validateMobility(MonitorableJob.Status status) { status.update("MobilityData Analysis...", 20); // Set up MobilityData validator. ValidationRunnerConfig.Builder builder = ValidationRunnerConfig.builder(); - builder.setGtfsSource(gtfsZip.toURI()); + builder.setGtfsSource(this.retrieveGtfsFile().toURI()); builder.setOutputDirectory(Path.of(validatorOutputDirectory)); ValidationRunnerConfig mbValidatorConfig = builder.build(); @@ -443,8 +442,10 @@ public void validateMobility(MonitorableJob.Status status) { status.update("MobilityData Analysis...", 80); // Read generated report and save to Mongo. String json; - try (FileReader fr = new FileReader(validatorOutputDirectory + "report.json")) { - BufferedReader in = new BufferedReader(fr); + try ( + FileReader fr = new FileReader(validatorOutputDirectory + "report.json"); + BufferedReader in = new BufferedReader(fr) + ) { json = in.lines().collect(Collectors.joining(System.lineSeparator())); } diff --git a/src/test/java/com/conveyal/datatools/manager/jobs/FlexMergeFeedsJobTest.java b/src/test/java/com/conveyal/datatools/manager/jobs/FlexMergeFeedsJobTest.java new file mode 100644 index 000000000..eb021c3b2 --- /dev/null +++ b/src/test/java/com/conveyal/datatools/manager/jobs/FlexMergeFeedsJobTest.java @@ -0,0 +1,148 @@ +package com.conveyal.datatools.manager.jobs; + +import com.conveyal.datatools.DatatoolsTest; +import com.conveyal.datatools.TestUtils; +import com.conveyal.datatools.UnitTest; +import com.conveyal.datatools.manager.auth.Auth0Connection; +import com.conveyal.datatools.manager.auth.Auth0UserProfile; +import com.conveyal.datatools.manager.jobs.feedmerge.MergeFeedsType; +import com.conveyal.datatools.manager.models.FeedSource; +import com.conveyal.datatools.manager.models.FeedVersion; +import com.conveyal.datatools.manager.models.Project; +import com.conveyal.datatools.manager.persistence.Persistence; +import com.conveyal.gtfs.error.NewGTFSErrorType; +import com.conveyal.gtfs.loader.FeedLoadResult; +import com.conveyal.gtfs.loader.Table; +import com.conveyal.gtfs.loader.TableLoadResult; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.sql.SQLException; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +import static com.conveyal.datatools.TestUtils.assertThatFeedHasNoErrorsOfType; +import static com.conveyal.datatools.TestUtils.createFeedVersion; +import static com.conveyal.datatools.TestUtils.createFeedVersionFromGtfsZip; +import static com.conveyal.datatools.TestUtils.zipFolderFiles; +import static com.conveyal.datatools.manager.models.FeedRetrievalMethod.MANUALLY_UPLOADED; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +/** + * Tests for the various {@link MergeFeedsJob} merge types. + */ +public class FlexMergeFeedsJobTest extends UnitTest { + private static final Logger LOG = LoggerFactory.getLogger(FlexMergeFeedsJobTest.class); + private static final Auth0UserProfile user = Auth0UserProfile.createTestAdminUser(); + private static FeedVersion fakeAgencyWithFlexVersion1; + private static FeedVersion fakeAgencyWithFlexVersion2; + private static Project project; + + /** + * Prepare and start a testing-specific web server + */ + @BeforeAll + public static void setUp() throws IOException { + // start server if it isn't already running + DatatoolsTest.setUp(); + Auth0Connection.setAuthDisabled(true); + + // Create a project, feed sources, and feed versions to merge. + project = new Project(); + project.name = String.format("Test %s", new Date()); + Persistence.projects.create(project); + + FeedSource flexAgencyA = new FeedSource("FLEX-AGENCY-A", project.id, MANUALLY_UPLOADED); + Persistence.feedSources.create(flexAgencyA); + fakeAgencyWithFlexVersion1 = TestUtils.createFeedVersion(flexAgencyA, TestUtils.zipFolderFiles("fake-agency-with-flex-version-1")); + + FeedSource flexAgencyB = new FeedSource("FLEX-AGENCY-B", project.id, MANUALLY_UPLOADED); + Persistence.feedSources.create(flexAgencyB); + fakeAgencyWithFlexVersion2 = TestUtils.createFeedVersion(flexAgencyB, TestUtils.zipFolderFiles("fake-agency-with-flex-version-2")); + } + + /** + * Delete project on tear down (feed sources/versions will also be deleted). + */ + @AfterAll + public static void tearDown() { + if (project != null) { + project.delete(); + } + Auth0Connection.setAuthDisabled(Auth0Connection.getDefaultAuthDisabled()); + } + + /** + * Ensures that a regional feed merge will produce a feed that includes all entities from each feed. + */ + @Test + void canMergeRegional() throws SQLException { + // Set up list of feed versions to merge. + Set versions = new HashSet<>(); + versions.add(fakeAgencyWithFlexVersion1); + versions.add(fakeAgencyWithFlexVersion2); + FeedVersion mergedVersion = regionallyMergeVersions(versions); + + FeedLoadResult r1 = fakeAgencyWithFlexVersion1.feedLoadResult; + FeedLoadResult r2 = fakeAgencyWithFlexVersion2.feedLoadResult; + FeedLoadResult merged = mergedVersion.feedLoadResult; + + // Ensure the feed has the row counts we expect. + assertRowCount(r1.agency, r2.agency, merged.agency, "Agency"); + assertRowCount(r1.area, r2.area, merged.area, "Area"); + assertRowCount(r1.attributions, r2.attributions, merged.attributions, "Attributions"); + assertRowCount(r1.bookingRules, r2.bookingRules, merged.bookingRules, "Booking rules"); + assertRowCount(r1.calendar, r2.calendar, merged.calendar, "Calendar"); + assertRowCount(r1.calendarDates, r2.calendarDates, merged.calendarDates, "Calendar dates"); + assertRowCount(r1.fareAttributes, r2.fareAttributes, merged.fareAttributes, "Fare attributes"); + assertRowCount(r1.fareRules, r2.fareRules, merged.fareRules, "Fare rules"); + assertRowCount(r1.frequencies, r2.frequencies, merged.frequencies, "Frequencies"); + assertRowCount(r1.locations, r2.locations, merged.locations, "Locations"); + assertRowCount(r1.locationShapes, r2.locationShapes, merged.locationShapes, "Location shapes"); + assertRowCount(r1.routes, r2.routes, merged.routes, "Routes"); + assertRowCount(r1.shapes, r2.shapes, merged.shapes, "Shapes"); + assertRowCount(r1.stops, r2.stops, merged.stops, "Stops"); + assertRowCount(r1.stopAreas, r2.stopAreas, merged.stopAreas, "Stop areas"); + assertRowCount(r1.stopTimes, r2.stopTimes, merged.stopTimes, "Stop times"); + assertRowCount(r1.trips, r2.trips, merged.trips, "Trips"); + assertRowCount(r1.translations, r2.translations, merged.translations, "Translations"); + + // Ensure there are no referential integrity errors, duplicate ID, or wrong number of fields errors. + assertThatFeedHasNoErrorsOfType( + mergedVersion.namespace, + NewGTFSErrorType.REFERENTIAL_INTEGRITY.toString(), + NewGTFSErrorType.DUPLICATE_ID.toString(), + NewGTFSErrorType.WRONG_NUMBER_OF_FIELDS.toString() + ); + } + + /** + * Merges a set of FeedVersions and then creates a new FeedSource and FeedVersion of the merged feed. + */ + private FeedVersion regionallyMergeVersions(Set versions) { + MergeFeedsJob mergeFeedsJob = new MergeFeedsJob(user, versions, project.id, MergeFeedsType.REGIONAL); + // Run the job in this thread (we're not concerned about concurrency here). + mergeFeedsJob.run(); + LOG.info("Regional merged file: {}", mergeFeedsJob.mergedVersion.retrieveGtfsFile().getAbsolutePath()); + return mergeFeedsJob.mergedVersion; + } + + /** + * Helper method to confirm that the sum of the two feed table rows match the merged feed table rows. + */ + private void assertRowCount(TableLoadResult feedOne, TableLoadResult feedTwo, TableLoadResult feedMerged, String entity) { + assertEquals( + feedOne.rowCount + feedTwo.rowCount, + feedMerged.rowCount, + String.format("%s count for merged feed should equal the sum for the versions merged.", entity) + ); + } +} diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/agency.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/agency.txt new file mode 100644 index 000000000..a916ce91b --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/agency.txt @@ -0,0 +1,2 @@ +agency_id,agency_name,agency_url,agency_lang,agency_phone,agency_email,agency_timezone,agency_fare_url,agency_branding_url +1,Fake Transit,,,,,America/Los_Angeles,, diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/areas.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/areas.txt new file mode 100644 index 000000000..3f8aefce7 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/areas.txt @@ -0,0 +1,4 @@ +area_id,area_name +1,"Area referencing a stop" +2,"Area referencing a location" +3,"Multi areas" \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/attributions.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/attributions.txt new file mode 100644 index 000000000..2e082242d --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/attributions.txt @@ -0,0 +1,2 @@ +attribution_id,agency_id,route_id,trip_id,organization_name,is_producer,is_operator,is_authority,attribution_url,attribution_email,attribution_phone +1,1,,,Fake Transit,1,,,https://faketransit.example.com,customer.service@faketransit.example.com, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/booking_rules.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/booking_rules.txt new file mode 100644 index 000000000..36a5af626 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/booking_rules.txt @@ -0,0 +1,2 @@ +booking_rule_id,booking_type,prior_notice_duration_min,prior_notice_duration_max,prior_notice_last_day,prior_notice_last_time,prior_notice_start_day,prior_notice_start_time,prior_notice_service_id,message,pickup_message,drop_off_message,phone_number,info_url,booking_url +Booking 1,1,30,60,1,17:00:00,7,00:00:00,"04100312-8fe1-46a5-a9f2-556f39478f57","This is a message","This is a pickup message","This is a drop off message","123456789","http://info.example.com","http://booking.example.com" \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/calendar.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/calendar.txt new file mode 100644 index 000000000..4c9b7fd13 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/calendar.txt @@ -0,0 +1,2 @@ +service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date +04100312-8fe1-46a5-a9f2-556f39478f57,1,1,1,1,1,1,1,20170915,20170917 diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/calendar_dates.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/calendar_dates.txt new file mode 100644 index 000000000..403ee2bbe --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/calendar_dates.txt @@ -0,0 +1,2 @@ +service_id,date,exception_type +04100312-8fe1-46a5-a9f2-556f39478f57,20170916,2 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/fare_attributes.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/fare_attributes.txt new file mode 100644 index 000000000..3173d016d --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/fare_attributes.txt @@ -0,0 +1,2 @@ +fare_id,price,currency_type,payment_method,transfers,transfer_duration +route_based_fare,1.23,USD,0,0,0 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/fare_rules.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/fare_rules.txt new file mode 100644 index 000000000..05d2aadf8 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/fare_rules.txt @@ -0,0 +1,2 @@ +fare_id,route_id,origin_id,destination_id,contains_id +route_based_fare,1,,, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/feed_info.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/feed_info.txt new file mode 100644 index 000000000..0912e2ac5 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/feed_info.txt @@ -0,0 +1,2 @@ +feed_id,feed_publisher_name,feed_publisher_url,feed_lang,feed_version +fake_transit,Conveyal,http://publisher.example.com,en,1.0 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/frequencies.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/frequencies.txt new file mode 100644 index 000000000..9baceff3a --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/frequencies.txt @@ -0,0 +1,2 @@ +trip_id,start_time,end_time,headway_secs,exact_times +frequency-trip,08:00:00,09:00:00,1800,0 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/locations.geojson b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/locations.geojson new file mode 100644 index 000000000..efae1fe8c --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/locations.geojson @@ -0,0 +1,201 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "id": "area_1469-2", + "properties": { + "stop_name": "Templeboy to Ballisodare", + "stop_desc": "Templeboy to Ballisodare Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [[40.0, 40.0], [20.0, 45.0], [45.0, 30.0], [40.0, 40.0]] + ], + [ + [[20.0, 35.0], [10.0, 30.0], [10.0, 10.0], [30.0, 5.0], [45.0, 20.0], [20.0, 35.0]], + [[30.0, 20.0], [20.0, 15.0], [20.0, 25.0], [30.0, 20.0]] + ] + ] + } + }, + { + "id": "area_1469-1", + "properties": { + "stop_name": "Dromore West to Templeboy", + "stop_desc": "Dromore West to Templeboy Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -8.810391429999981, + 54.255823500000076 + ], + [ + -8.82575511999994, + 54.252263440000036 + ], + [ + -8.832192419999956, + 54.25331645000006 + ], + [ + -8.835968969999954, + 54.25456999000005 + ], + [ + -8.841462139999976, + 54.25472041000006 + ], + [ + -8.846955299999934, + 54.257578340000066 + ], + [ + -8.854250909999962, + 54.26148887000005 + ], + [ + -8.855624199999966, + 54.26359438000003 + ], + [ + -8.860516549999943, + 54.26173953000006 + ], + [ + -8.865494729999966, + 54.261789660000034 + ], + [ + -8.86849879999994, + 54.26414581000006 + ], + [ + -8.871159549999959, + 54.26569979000004 + ], + [ + -8.87991427999998, + 54.26700308000005 + ], + [ + -8.882403369999963, + 54.26785521000005 + ], + [ + -8.890128139999945, + 54.27041150000008 + ], + [ + -8.89776706999993, + 54.27326834000007 + ], + [ + -8.905320169999982, + 54.26194006000003 + ], + [ + -8.904075619999958, + 54.25258586000007 + ], + [ + -8.922486309999954, + 54.24664695000007 + ], + [ + -8.930468559999952, + 54.24223346000008 + ], + [ + -8.935532569999964, + 54.23235155000003 + ], + [ + -8.919868469999926, + 54.22369314000008 + ], + [ + -8.913688659999934, + 54.21887572000003 + ], + [ + -8.902015689999928, + 54.21566380000007 + ], + [ + -8.893775939999955, + 54.21486078000004 + ], + [ + -8.87729644999996, + 54.212853160000066 + ], + [ + -8.85807036999995, + 54.212853160000066 + ], + [ + -8.838844299999948, + 54.216868300000044 + ], + [ + -8.827171329999942, + 54.21807277000005 + ], + [ + -8.82305144999998, + 54.21847425000004 + ], + [ + -8.822305720999964, + 54.218947282000045 + ], + [ + -8.808914424999955, + 54.21954913800005 + ], + [ + -8.810391429999981, + 54.255823500000076 + ] + ] + ] + } + }, + { + "id": "area_246", + "properties": { + "stop_name": "Moville to Letterkenny", + "stop_desc": "Moville to Letterkenny Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [[10.0, 10.0], [20.0, 20.0], [10.0, 40.0]], + [[40.0, 40.0], [30.0, 30.0], [40.0, 20.0], [30.0, 10.0]] + ] + } + }, + { + "id": "area_251", + "properties": { + "stop_name": "Muff to Moville", + "stop_desc": "Muff to Moville Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [30.0, 10.0], [10.0, 30.0], [40.0, 40.0] + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/routes.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/routes.txt new file mode 100644 index 000000000..35ea7aa67 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/routes.txt @@ -0,0 +1,2 @@ +agency_id,route_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color,route_branding_url +1,1,1,Route 1,,3,,7CE6E7,FFFFFF, diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/shapes.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/shapes.txt new file mode 100644 index 000000000..3f2e3fd13 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/shapes.txt @@ -0,0 +1,8 @@ +shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled +5820f377-f947-4728-ac29-ac0102cbc34e,37.0612132,-122.0074332,1,0.0000000 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0611720,-122.0075000,2,7.4997067 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0613590,-122.0076830,3,33.8739075 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0608780,-122.0082780,4,109.0402932 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0603590,-122.0088280,5,184.6078298 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0597610,-122.0093540,6,265.8053023 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0590660,-122.0099190,7,357.8617018 diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stop_areas.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stop_areas.txt new file mode 100644 index 000000000..3f900c131 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stop_areas.txt @@ -0,0 +1,4 @@ +area_id,stop_id +1,123 +2,area_1469-1 +3,123 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stop_times.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stop_times.txt new file mode 100644 index 000000000..f82e627d8 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stop_times.txt @@ -0,0 +1,7 @@ +trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,continuous_pickup,continuous_drop_off,shape_dist_traveled,timepoint,pickup_booking_rule_id,drop_off_booking_rule_id,start_pickup_drop_off_window,end_pickup_drop_off_window,mean_duration_factor,mean_duration_offset,safe_duration_factor,safe_duration_offset +a30277f8-e50a-4a85-9141-b1e0da9d429d,07:00:00,07:00:00,4u6g,1,Test stop headsign,0,0,1,1,0.0000000,1,"1","1",07:00:00,07:00:00,1,60,1,60 +a30277f8-e50a-4a85-9141-b1e0da9d429d,07:01:00,07:01:00,johv,2,Test stop headsign 2,0,0,1,1,341.4491961,1,"1","1",07:01:00,07:01:00,1,60,1,60 +frequency-trip,08:00:00,08:00:00,4u6g,1,Test stop headsign frequency trip,0,0,1,1,0.0000000,1,"1","1",07:02:00,07:02:00,1,60,1,60 +frequency-trip,08:29:00,08:29:00,1234,2,Test stop headsign frequency trip,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00,1,60,1,60 +frequency-trip,08:31:00,08:31:00,area_251,3,,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00,1,60,1,60 +frequency-trip,,,3,4,,1,1,1,1,341.4491961,1,"1","1",07:04:00,07:05:00,1,60,1,60 diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stops.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stops.txt new file mode 100644 index 000000000..9d56ffab3 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/stops.txt @@ -0,0 +1,6 @@ +stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,stop_timezone,wheelchair_boarding +4u6g,,Butler Ln,Heading north,37.0612132,-122.0074332,,,0,,, +johv,,Scotts Valley Dr & Victor Sq,,37.0590172,-122.0096058,,,0,,, +123,,Parent Station,,37.0666,-122.0777,,,1,,, +1234,,Child Stop,,37.06662,-122.07772,,,0,123,, +1234567,,Unused stop,,37.06668,-122.07781,,,0,123,, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/translations.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/translations.txt new file mode 100644 index 000000000..8e48c9733 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/translations.txt @@ -0,0 +1,2 @@ +table_name,field_name,language,translation,record_id,record_sub_id,field_value +stops,stop_desc,FR,Direction nord,4u6g,, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/trips.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/trips.txt new file mode 100644 index 000000000..eab14b86d --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-1/trips.txt @@ -0,0 +1,3 @@ +route_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,bikes_allowed,wheelchair_accessible,service_id +1,a30277f8-e50a-4a85-9141-b1e0da9d429d,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57 +1,frequency-trip,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/agency.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/agency.txt new file mode 100644 index 000000000..a916ce91b --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/agency.txt @@ -0,0 +1,2 @@ +agency_id,agency_name,agency_url,agency_lang,agency_phone,agency_email,agency_timezone,agency_fare_url,agency_branding_url +1,Fake Transit,,,,,America/Los_Angeles,, diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/areas.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/areas.txt new file mode 100644 index 000000000..3f8aefce7 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/areas.txt @@ -0,0 +1,4 @@ +area_id,area_name +1,"Area referencing a stop" +2,"Area referencing a location" +3,"Multi areas" \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/attributions.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/attributions.txt new file mode 100644 index 000000000..2e082242d --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/attributions.txt @@ -0,0 +1,2 @@ +attribution_id,agency_id,route_id,trip_id,organization_name,is_producer,is_operator,is_authority,attribution_url,attribution_email,attribution_phone +1,1,,,Fake Transit,1,,,https://faketransit.example.com,customer.service@faketransit.example.com, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/booking_rules.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/booking_rules.txt new file mode 100644 index 000000000..36a5af626 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/booking_rules.txt @@ -0,0 +1,2 @@ +booking_rule_id,booking_type,prior_notice_duration_min,prior_notice_duration_max,prior_notice_last_day,prior_notice_last_time,prior_notice_start_day,prior_notice_start_time,prior_notice_service_id,message,pickup_message,drop_off_message,phone_number,info_url,booking_url +Booking 1,1,30,60,1,17:00:00,7,00:00:00,"04100312-8fe1-46a5-a9f2-556f39478f57","This is a message","This is a pickup message","This is a drop off message","123456789","http://info.example.com","http://booking.example.com" \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/calendar.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/calendar.txt new file mode 100644 index 000000000..4c9b7fd13 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/calendar.txt @@ -0,0 +1,2 @@ +service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date +04100312-8fe1-46a5-a9f2-556f39478f57,1,1,1,1,1,1,1,20170915,20170917 diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/calendar_dates.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/calendar_dates.txt new file mode 100644 index 000000000..403ee2bbe --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/calendar_dates.txt @@ -0,0 +1,2 @@ +service_id,date,exception_type +04100312-8fe1-46a5-a9f2-556f39478f57,20170916,2 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/fare_attributes.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/fare_attributes.txt new file mode 100644 index 000000000..3173d016d --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/fare_attributes.txt @@ -0,0 +1,2 @@ +fare_id,price,currency_type,payment_method,transfers,transfer_duration +route_based_fare,1.23,USD,0,0,0 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/fare_rules.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/fare_rules.txt new file mode 100644 index 000000000..05d2aadf8 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/fare_rules.txt @@ -0,0 +1,2 @@ +fare_id,route_id,origin_id,destination_id,contains_id +route_based_fare,1,,, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/feed_info.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/feed_info.txt new file mode 100644 index 000000000..0912e2ac5 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/feed_info.txt @@ -0,0 +1,2 @@ +feed_id,feed_publisher_name,feed_publisher_url,feed_lang,feed_version +fake_transit,Conveyal,http://publisher.example.com,en,1.0 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/frequencies.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/frequencies.txt new file mode 100644 index 000000000..9baceff3a --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/frequencies.txt @@ -0,0 +1,2 @@ +trip_id,start_time,end_time,headway_secs,exact_times +frequency-trip,08:00:00,09:00:00,1800,0 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/locations.geojson b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/locations.geojson new file mode 100644 index 000000000..efae1fe8c --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/locations.geojson @@ -0,0 +1,201 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "id": "area_1469-2", + "properties": { + "stop_name": "Templeboy to Ballisodare", + "stop_desc": "Templeboy to Ballisodare Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [[40.0, 40.0], [20.0, 45.0], [45.0, 30.0], [40.0, 40.0]] + ], + [ + [[20.0, 35.0], [10.0, 30.0], [10.0, 10.0], [30.0, 5.0], [45.0, 20.0], [20.0, 35.0]], + [[30.0, 20.0], [20.0, 15.0], [20.0, 25.0], [30.0, 20.0]] + ] + ] + } + }, + { + "id": "area_1469-1", + "properties": { + "stop_name": "Dromore West to Templeboy", + "stop_desc": "Dromore West to Templeboy Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -8.810391429999981, + 54.255823500000076 + ], + [ + -8.82575511999994, + 54.252263440000036 + ], + [ + -8.832192419999956, + 54.25331645000006 + ], + [ + -8.835968969999954, + 54.25456999000005 + ], + [ + -8.841462139999976, + 54.25472041000006 + ], + [ + -8.846955299999934, + 54.257578340000066 + ], + [ + -8.854250909999962, + 54.26148887000005 + ], + [ + -8.855624199999966, + 54.26359438000003 + ], + [ + -8.860516549999943, + 54.26173953000006 + ], + [ + -8.865494729999966, + 54.261789660000034 + ], + [ + -8.86849879999994, + 54.26414581000006 + ], + [ + -8.871159549999959, + 54.26569979000004 + ], + [ + -8.87991427999998, + 54.26700308000005 + ], + [ + -8.882403369999963, + 54.26785521000005 + ], + [ + -8.890128139999945, + 54.27041150000008 + ], + [ + -8.89776706999993, + 54.27326834000007 + ], + [ + -8.905320169999982, + 54.26194006000003 + ], + [ + -8.904075619999958, + 54.25258586000007 + ], + [ + -8.922486309999954, + 54.24664695000007 + ], + [ + -8.930468559999952, + 54.24223346000008 + ], + [ + -8.935532569999964, + 54.23235155000003 + ], + [ + -8.919868469999926, + 54.22369314000008 + ], + [ + -8.913688659999934, + 54.21887572000003 + ], + [ + -8.902015689999928, + 54.21566380000007 + ], + [ + -8.893775939999955, + 54.21486078000004 + ], + [ + -8.87729644999996, + 54.212853160000066 + ], + [ + -8.85807036999995, + 54.212853160000066 + ], + [ + -8.838844299999948, + 54.216868300000044 + ], + [ + -8.827171329999942, + 54.21807277000005 + ], + [ + -8.82305144999998, + 54.21847425000004 + ], + [ + -8.822305720999964, + 54.218947282000045 + ], + [ + -8.808914424999955, + 54.21954913800005 + ], + [ + -8.810391429999981, + 54.255823500000076 + ] + ] + ] + } + }, + { + "id": "area_246", + "properties": { + "stop_name": "Moville to Letterkenny", + "stop_desc": "Moville to Letterkenny Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [[10.0, 10.0], [20.0, 20.0], [10.0, 40.0]], + [[40.0, 40.0], [30.0, 30.0], [40.0, 20.0], [30.0, 10.0]] + ] + } + }, + { + "id": "area_251", + "properties": { + "stop_name": "Muff to Moville", + "stop_desc": "Muff to Moville Door-to-door pickup area" + }, + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [30.0, 10.0], [10.0, 30.0], [40.0, 40.0] + ] + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/routes.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/routes.txt new file mode 100644 index 000000000..35ea7aa67 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/routes.txt @@ -0,0 +1,2 @@ +agency_id,route_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color,route_branding_url +1,1,1,Route 1,,3,,7CE6E7,FFFFFF, diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/shapes.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/shapes.txt new file mode 100644 index 000000000..3f2e3fd13 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/shapes.txt @@ -0,0 +1,8 @@ +shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled +5820f377-f947-4728-ac29-ac0102cbc34e,37.0612132,-122.0074332,1,0.0000000 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0611720,-122.0075000,2,7.4997067 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0613590,-122.0076830,3,33.8739075 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0608780,-122.0082780,4,109.0402932 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0603590,-122.0088280,5,184.6078298 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0597610,-122.0093540,6,265.8053023 +5820f377-f947-4728-ac29-ac0102cbc34e,37.0590660,-122.0099190,7,357.8617018 diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stop_areas.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stop_areas.txt new file mode 100644 index 000000000..3f900c131 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stop_areas.txt @@ -0,0 +1,4 @@ +area_id,stop_id +1,123 +2,area_1469-1 +3,123 \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stop_times.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stop_times.txt new file mode 100644 index 000000000..f82e627d8 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stop_times.txt @@ -0,0 +1,7 @@ +trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,continuous_pickup,continuous_drop_off,shape_dist_traveled,timepoint,pickup_booking_rule_id,drop_off_booking_rule_id,start_pickup_drop_off_window,end_pickup_drop_off_window,mean_duration_factor,mean_duration_offset,safe_duration_factor,safe_duration_offset +a30277f8-e50a-4a85-9141-b1e0da9d429d,07:00:00,07:00:00,4u6g,1,Test stop headsign,0,0,1,1,0.0000000,1,"1","1",07:00:00,07:00:00,1,60,1,60 +a30277f8-e50a-4a85-9141-b1e0da9d429d,07:01:00,07:01:00,johv,2,Test stop headsign 2,0,0,1,1,341.4491961,1,"1","1",07:01:00,07:01:00,1,60,1,60 +frequency-trip,08:00:00,08:00:00,4u6g,1,Test stop headsign frequency trip,0,0,1,1,0.0000000,1,"1","1",07:02:00,07:02:00,1,60,1,60 +frequency-trip,08:29:00,08:29:00,1234,2,Test stop headsign frequency trip,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00,1,60,1,60 +frequency-trip,08:31:00,08:31:00,area_251,3,,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00,1,60,1,60 +frequency-trip,,,3,4,,1,1,1,1,341.4491961,1,"1","1",07:04:00,07:05:00,1,60,1,60 diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stops.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stops.txt new file mode 100644 index 000000000..9d56ffab3 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/stops.txt @@ -0,0 +1,6 @@ +stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,stop_timezone,wheelchair_boarding +4u6g,,Butler Ln,Heading north,37.0612132,-122.0074332,,,0,,, +johv,,Scotts Valley Dr & Victor Sq,,37.0590172,-122.0096058,,,0,,, +123,,Parent Station,,37.0666,-122.0777,,,1,,, +1234,,Child Stop,,37.06662,-122.07772,,,0,123,, +1234567,,Unused stop,,37.06668,-122.07781,,,0,123,, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/translations.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/translations.txt new file mode 100644 index 000000000..8e48c9733 --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/translations.txt @@ -0,0 +1,2 @@ +table_name,field_name,language,translation,record_id,record_sub_id,field_value +stops,stop_desc,FR,Direction nord,4u6g,, \ No newline at end of file diff --git a/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/trips.txt b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/trips.txt new file mode 100644 index 000000000..eab14b86d --- /dev/null +++ b/src/test/resources/com/conveyal/datatools/gtfs/fake-agency-with-flex-version-2/trips.txt @@ -0,0 +1,3 @@ +route_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,bikes_allowed,wheelchair_accessible,service_id +1,a30277f8-e50a-4a85-9141-b1e0da9d429d,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57 +1,frequency-trip,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57 \ No newline at end of file