From 31c6da25023a42cbaba2b479bed24d3d3bf7691f Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 27 Sep 2021 16:08:47 +0100 Subject: [PATCH 1/8] fix: import continuous_drop_off correctly --- .../com/conveyal/gtfs/model/StopTime.java | 2 +- .../conveyal/gtfs/loader/GtfsFlexTest.java | 82 +++ .../agency.txt | 2 + .../areas.txt | 1 + .../booking_rules.txt | 1 + .../calendar.txt | 2 + .../calendar_attributes.txt | 2 + .../calendar_dates.txt | 1 + .../directions.txt | 2 + .../fare_attributes.txt | 2 + .../fare_rider_categories.txt | 1 + .../fare_rules.txt | 1 + .../farezone_attributes.txt | 1 + .../feed_info.txt | 2 + .../frequencies.txt | 2 + .../linked_datasets.txt | 4 + .../location_groups.txt | 1 + .../rider_categories.txt | 1 + .../routes.txt | 2 + .../runcut.txt | 2 + .../shapes.txt | 615 ++++++++++++++++++ .../stop_attributes.txt | 9 + .../stop_times.txt | 10 + .../stops.txt | 9 + .../timetable_stop_order.txt | 1 + .../timetables.txt | 1 + .../transfers.txt | 1 + .../trips.txt | 2 + 28 files changed, 761 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/agency.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/areas.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/booking_rules.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_attributes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_dates.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/directions.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_attributes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rider_categories.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rules.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/farezone_attributes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/feed_info.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/frequencies.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/linked_datasets.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/location_groups.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/rider_categories.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/routes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/runcut.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/shapes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_attributes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_times.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stops.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetable_stop_order.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetables.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/transfers.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/trips.txt diff --git a/src/main/java/com/conveyal/gtfs/model/StopTime.java b/src/main/java/com/conveyal/gtfs/model/StopTime.java index 1a227a393..e286b3a84 100644 --- a/src/main/java/com/conveyal/gtfs/model/StopTime.java +++ b/src/main/java/com/conveyal/gtfs/model/StopTime.java @@ -90,7 +90,7 @@ public void loadOneRow() throws IOException { st.pickup_type = getIntField("pickup_type", false, 0, 3); // TODO add ranges as parameters st.drop_off_type = getIntField("drop_off_type", false, 0, 3); st.continuous_pickup = getIntField("continuous_pickup", true, 0, 3); - st.continuous_pickup = getIntField("continuous_drop_off", true, 0, 3); + st.continuous_drop_off = getIntField("continuous_drop_off", true, 0, 3); st.shape_dist_traveled = getDoubleField("shape_dist_traveled", false, 0D, Double.MAX_VALUE); // FIXME using both 0 and NaN for "missing", define DOUBLE_MISSING st.timepoint = getIntField("timepoint", false, 0, 1, INT_MISSING); st.feed = null; // this could circular-serialize the whole feed diff --git a/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java b/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java new file mode 100644 index 000000000..d76f1026c --- /dev/null +++ b/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java @@ -0,0 +1,82 @@ +package com.conveyal.gtfs.loader; + +import com.conveyal.gtfs.TestUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import javax.sql.DataSource; +import java.io.IOException; + +import static com.conveyal.gtfs.GTFS.load; +import static com.conveyal.gtfs.GTFS.validate; +import static com.conveyal.gtfs.TestUtils.assertThatSqlCountQueryYieldsExpectedCount; + +/** + * Load in a GTFS feed with GTFS flex features, and ensure all needed fields are imported correctly. + * TODO: update feed to use more features, and test for these. + */ +public class GtfsFlexTest { + private static String testDBName; + private static DataSource testDataSource; + private static String testNamespace; + + @BeforeAll + public static void setUpClass() throws IOException { + // Create a new database + testDBName = TestUtils.generateNewDB(); + String dbConnectionUrl = String.format("jdbc:postgresql://localhost/%s", testDBName); + testDataSource = TestUtils.createTestDataSource(dbConnectionUrl); + // load feed into db + String zipFileName = TestUtils.zipFolderFiles( + "real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions", + true); + FeedLoadResult feedLoadResult = load(zipFileName, testDataSource); + testNamespace = feedLoadResult.uniqueIdentifier; + validate(testNamespace, testDataSource); + } + + @Test + void canImportContinuousPickupAndDropoff() { + String cp_0 = generateStopTimeQuery( + testNamespace, + "continuous_pickup", + 0); + String cp_1 = generateStopTimeQuery( + testNamespace, + "continuous_pickup", + 1); + String cp_2 = generateStopTimeQuery( + testNamespace, + "continuous_pickup", + 2); + + String cd_0 = generateStopTimeQuery( + testNamespace, + "continuous_drop_off", + 0); + String cd_1 = generateStopTimeQuery( + testNamespace, + "continuous_drop_off", + 1); + String cd_2 = generateStopTimeQuery( + testNamespace, + "continuous_drop_off", + 2); + + + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cp_0, 3); + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cp_1, 5); + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cp_2, 1); + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cd_0, 2); + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cd_1, 5); + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cd_2, 2); + + } + + private String generateStopTimeQuery(String namespace, String field, int value) { + return String.format("select count(*) from %s.stop_times where %s = '%s'", + testNamespace, + field, + value); + } +} diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/agency.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/agency.txt new file mode 100644 index 000000000..6f3c2aa5e --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/agency.txt @@ -0,0 +1,2 @@ +agency_id,agency_url,agency_lang,agency_name,agency_phone,agency_timezone,agency_fare_url +501,http://ewpshuttle.org/,en,Washington Park Shuttle,503-319-0999,America/Los_Angeles,http://explorewashingtonpark.org/getting-here/#shuttle diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/areas.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/areas.txt new file mode 100644 index 000000000..cac45c7d0 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/areas.txt @@ -0,0 +1 @@ +area_id,wkt diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/booking_rules.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/booking_rules.txt new file mode 100644 index 000000000..c2a25eb91 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/booking_rules.txt @@ -0,0 +1 @@ +booking_rule_id,booking_type,prior_notice_duration_min,prior_notice_duration_max,prior_notice_start_day,prior_notice_start_time,prior_notice_last_day,prior_notice_last_time,prior_notice_service_id,message,pickup_message,drop_off_message,phone_number,info_url,booking_url diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar.txt new file mode 100644 index 000000000..1c1b8fdd1 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar.txt @@ -0,0 +1,2 @@ +service_id,service_name,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date +c_17784_b_29153_d_127,March-September (All days of week),1,1,1,1,1,1,1,20210320,20210930 diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_attributes.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_attributes.txt new file mode 100644 index 000000000..1fb806aea --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_attributes.txt @@ -0,0 +1,2 @@ +service_id,service_description +c_17784_b_29153_d_127,March-September (All days of week) diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_dates.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_dates.txt new file mode 100644 index 000000000..bb359e8aa --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/calendar_dates.txt @@ -0,0 +1 @@ +date,service_id,holiday_name,exception_type diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/directions.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/directions.txt new file mode 100644 index 000000000..0ba67e7cc --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/directions.txt @@ -0,0 +1,2 @@ +route_id,direction_id,direction +3433,0,Loop diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_attributes.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_attributes.txt new file mode 100644 index 000000000..6110aaaca --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_attributes.txt @@ -0,0 +1,2 @@ +agency_id,fare_id,price,currency_type,payment_method,transfers,transfer_duration +501,1552,0.00,USD,0,, diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rider_categories.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rider_categories.txt new file mode 100644 index 000000000..1dc8b07c8 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rider_categories.txt @@ -0,0 +1 @@ +fare_id,rider_category_id,price diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rules.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rules.txt new file mode 100644 index 000000000..c7f6b54a3 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/fare_rules.txt @@ -0,0 +1 @@ +fare_id,route_id,origin_id,destination_id,contains_id diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/farezone_attributes.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/farezone_attributes.txt new file mode 100644 index 000000000..aec46b499 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/farezone_attributes.txt @@ -0,0 +1 @@ +zone_id,zone_name diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/feed_info.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/feed_info.txt new file mode 100644 index 000000000..884123f8f --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/feed_info.txt @@ -0,0 +1,2 @@ +feed_publisher_url,feed_publisher_name,feed_lang,feed_version,feed_license,feed_contact_email,feed_contact_url,feed_start_date,feed_end_date,feed_id +http://www.trilliumtransit.com,"Trillium Solutions, Inc.",en,UTC: 27-May-2021 21:49,,support+test+washingtonparkshuttle-or-us@trilliumtransit.com,http://support.trilliumtransit.com,20210527,20210930,washingtonparkshuttle-or-us diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/frequencies.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/frequencies.txt new file mode 100644 index 000000000..8aa753e31 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/frequencies.txt @@ -0,0 +1,2 @@ +trip_id,start_time,end_time,headway_secs,exact_times +t_819605_b_29153_tn_frequencies_trip,09:30:00,18:45:01,900,0 diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/linked_datasets.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/linked_datasets.txt new file mode 100644 index 000000000..2d94e5f2f --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/linked_datasets.txt @@ -0,0 +1,4 @@ +url,trip_updates,vehicle_positions,service_alerts,authentication_type,authentication_info_url,api_key_parameter_name +http://gtfs-realtime.trilliumtransit.com/gtfs-realtime/feed/washingtonparkshuttle-or-us/service_alerts.proto,false,false,true,none,, +https://api.goswift.ly/real-time/washington-park/gtfs-rt-trip-updates?apiKey=TU_VP_API_KEY,true,false,false,header,https://api.goswift.ly/real-time/,AUTHORIZATION +https://api.goswift.ly/real-time/washington-park/gtfs-rt-vehicle-positions?apiKey=TU_VP_API_KEY,false,true,false,header,https://api.goswift.ly/real-time/,AUTHORIZATION diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/location_groups.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/location_groups.txt new file mode 100644 index 000000000..45845294f --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/location_groups.txt @@ -0,0 +1 @@ +location_group_id,location_id,location_group_name diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/rider_categories.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/rider_categories.txt new file mode 100644 index 000000000..ed01abe54 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/rider_categories.txt @@ -0,0 +1 @@ +rider_category_id,rider_category_description diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/routes.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/routes.txt new file mode 100644 index 000000000..fc1336918 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/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_sort_order,min_headway_minutes,eligibility_restricted,continuous_pickup,continuous_drop_off +501,3433,,Washington Park Shuttle,,3,https://explorewashingtonpark.org/getting-here/#,721b7d,ffffff,1,15,0,1,1 diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/runcut.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/runcut.txt new file mode 100644 index 000000000..7ba3c27bc --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/runcut.txt @@ -0,0 +1,2 @@ +runs_id,service_id,block_id,run_number,piece_number,start_trip_id,start_stop_id,end_trip_id,end_stop_id +100000,c_17784_b_29153_d_127,109732,1,1,t_819605_b_29153_tn_frequencies_trip,815440,t_819605_b_29153_tn_frequencies_trip,815440 diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/shapes.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/shapes.txt new file mode 100644 index 000000000..653f2e1cf --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/shapes.txt @@ -0,0 +1,615 @@ +shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled +p_7171,45.51044,-122.716545,1,0 +p_7171,45.510439,-122.716748,2,15.86354395 +p_7171,45.510433,-122.716922,3,29.47687714 +p_7171,45.510425,-122.717057,4,40.06367076 +p_7171,45.510411,-122.717229,5,53.59414405 +p_7171,45.510419,-122.717332,6,61.69190177 +p_7171,45.510404,-122.717444,7,70.60135648 +p_7171,45.510394,-122.717514,8,76.18318191 +p_7171,45.510403,-122.717654,9,87.16892988 +p_7171,45.510466,-122.717641,10,94.2441695 +p_7171,45.510531,-122.717636,11,101.47894166 +p_7171,45.510634,-122.717644,12,112.94359926 +p_7171,45.510916,-122.717652,13,144.29180932 +p_7171,45.511016,-122.717647,14,155.41285121 +p_7171,45.511114,-122.717638,15,166.32742595 +p_7171,45.511199,-122.717618,16,175.90287712 +p_7171,45.511365,-122.71757,17,194.72982794 +p_7171,45.511484,-122.717526,18,208.39530586 +p_7171,45.511596,-122.717472,19,221.5389479 +p_7171,45.511653,-122.717438,20,228.40859021 +p_7171,45.511712,-122.717403,21,235.513453 +p_7171,45.511765,-122.717367,22,242.04121838 +p_7171,45.511965,-122.717142,23,270.38238953 +p_7171,45.512067,-122.717026,24,284.89716951 +p_7171,45.512149,-122.716932,25,296.60235513 +p_7171,45.512241,-122.716875,26,307.75538499 +p_7171,45.51234,-122.71686,27,318.82067672 +p_7171,45.512412,-122.71687,28,326.86094713 +p_7171,45.512557,-122.716917,29,343.38969144 +p_7171,45.512621,-122.71693,30,350.57493613 +p_7171,45.512662,-122.716938,31,355.17442862 +p_7171,45.512934,-122.716988,32,385.65642506 +p_7171,45.513065,-122.716999,33,400.24135113 +p_7171,45.513142,-122.716994,34,408.80818388 +p_7171,45.513205,-122.716966,35,416.14398994 +p_7171,45.513261,-122.716918,36,423.41071243 +p_7171,45.513293,-122.716863,37,428.98915678 +p_7171,45.513329,-122.716769,38,437.35334996 +p_7171,45.513339,-122.716677,39,444.62760142 +p_7171,45.513338,-122.716601,40,450.56725148 +p_7171,45.513315,-122.716489,41,459.68457776 +p_7171,45.513252,-122.716366,42,471.57582998 +p_7171,45.513063,-122.71604,43,504.59321415 +p_7171,45.513003,-122.715895,44,517.74025936 +p_7171,45.51298,-122.715814,45,524.56632023 +p_7171,45.51297,-122.715731,46,531.14649008 +p_7171,45.512978,-122.715625,47,539.4769279 +p_7171,45.513011,-122.71555,48,546.39049471 +p_7171,45.513049,-122.715506,49,551.83640741 +p_7171,45.513116,-122.715478,50,559.59768081 +p_7171,45.51319,-122.715482,51,567.82811147 +p_7171,45.51327,-122.715556,52,578.43431191 +p_7171,45.513352,-122.715729,53,594.73765001 +p_7171,45.513425,-122.715867,54,608.2322822 +p_7171,45.513542,-122.716005,55,625.12522834 +p_7171,45.513651,-122.716094,56,639.09389587 +p_7171,45.51373,-122.716177,57,650.00967768 +p_7171,45.513802,-122.71626,58,660.31004591 +p_7171,45.513851,-122.716345,59,668.89910822 +p_7171,45.51391,-122.716453,60,679.58628417 +p_7171,45.514005,-122.716654,61,698.51130193 +p_7171,45.514085,-122.716851,62,716.28797269 +p_7171,45.514143,-122.717,63,729.59605029 +p_7171,45.514186,-122.717141,64,741.60544681 +p_7171,45.514207,-122.717216,65,747.91349928 +p_7171,45.514244,-122.717343,66,758.65537552 +p_7171,45.514294,-122.717485,67,771.06482843 +p_7171,45.514373,-122.717614,68,784.43251325 +p_7171,45.514435,-122.717683,69,793.18189282 +p_7171,45.514504,-122.717735,70,801.8605852 +p_7171,45.514626,-122.717819,71,816.92495895 +p_7171,45.514823,-122.717067,72,879.6311968 +p_7171,45.514878,-122.716906,73,893.61784245 +p_7171,45.51493,-122.716774,74,905.44081634 +p_7171,45.514992,-122.71664,75,917.97526709 +p_7171,45.515064,-122.716518,76,930.42149821 +p_7171,45.515115,-122.716446,77,938.40769703 +p_7171,45.515184,-122.716368,78,948.20338954 +p_7171,45.515261,-122.716294,79,958.53156224 +p_7171,45.515369,-122.716202,80,972.52282876 +p_7171,45.515482,-122.716136,81,986.09943003 +p_7171,45.515605,-122.71607,82,1000.71024534 +p_7171,45.515629,-122.716064,83,1003.4185359 +p_7171,45.515701,-122.716034,84,1011.75701221 +p_7171,45.515827,-122.716019,85,1025.80984724 +p_7171,45.516251,-122.715988,86,1072.99620737 +p_7171,45.516376,-122.715973,87,1086.93829123 +p_7171,45.516476,-122.71595,88,1098.19683315 +p_7171,45.51659,-122.715912,89,1111.21025194 +p_7171,45.516685,-122.715866,90,1122.36371854 +p_7171,45.516899,-122.715736,91,1148.22626339 +p_7171,45.516972,-122.715691,92,1157.06873088 +p_7171,45.517056,-122.715645,93,1167.07260774 +p_7171,45.517147,-122.715614,94,1177.47251604 +p_7171,45.517242,-122.715599,95,1188.095844 +p_7171,45.517307,-122.715591,96,1195.34705831 +p_7171,45.517399,-122.715591,97,1205.57211199 +p_7171,45.517479,-122.715599,98,1214.48540767 +p_7171,45.517555,-122.715614,99,1223.0131129 +p_7171,45.517616,-122.71563,100,1229.90706511 +p_7171,45.517689,-122.71566,101,1238.35223891 +p_7171,45.517838,-122.715714,102,1255.44141783 +p_7171,45.518017,-122.715782,103,1276.03306105 +p_7171,45.518085,-122.71579,104,1283.61651467 +p_7171,45.518208,-122.71579,105,1297.28696878 +p_7171,45.51825,-122.715782,106,1301.99659234 +p_7171,45.518303,-122.715759,107,1308.15513438 +p_7171,45.518356,-122.715729,108,1314.49488874 +p_7171,45.518398,-122.715698,109,1319.75383128 +p_7171,45.518471,-122.715637,110,1329.1635164 +p_7171,45.518574,-122.715538,111,1342.97944453 +p_7171,45.518681,-122.715424,112,1357.83744385 +p_7171,45.518902,-122.715195,113,1388.22563259 +p_7171,45.519135,-122.714958,114,1420.06105137 +p_7171,45.519169,-122.71492,115,1424.86672285 +p_7171,45.519196,-122.714874,116,1429.54883636 +p_7171,45.519218,-122.714828,117,1433.89576707 +p_7171,45.519234,-122.714767,118,1438.98272924 +p_7171,45.51926,-122.71463,119,1450.06993137 +p_7171,45.519276,-122.714577,120,1454.57657446 +p_7171,45.519291,-122.714539,121,1457.98160525 +p_7171,45.519302,-122.714508,122,1460.69473805 +p_7171,45.519329,-122.714478,123,1464.50249956 +p_7171,45.519459,-122.714394,124,1480.37168341 +p_7171,45.519497,-122.714363,125,1485.24030202 +p_7171,45.519531,-122.714325,126,1490.04596192 +p_7171,45.519554,-122.714294,127,1493.56744887 +p_7171,45.519573,-122.714264,128,1496.72232916 +p_7171,45.519596,-122.714203,129,1502.13057624 +p_7171,45.519608,-122.714149,130,1506.55542897 +p_7171,45.51965,-122.713943,131,1523.31364431 +p_7171,45.519665,-122.713898,132,1527.20476151 +p_7171,45.51968,-122.713852,133,1531.1666158 +p_7171,45.519695,-122.713814,134,1534.57162813 +p_7171,45.519718,-122.713776,135,1538.48944282 +p_7171,45.519741,-122.713745,136,1542.01092432 +p_7171,45.519775,-122.713707,137,1546.81657642 +p_7171,45.51984,-122.713638,138,1555.83059235 +p_7171,45.520218,-122.713264,139,1607.00510996 +p_7171,45.520359,-122.713112,140,1626.66762055 +p_7171,45.520409,-122.713066,141,1633.28562446 +p_7171,45.521042,-122.71244,142,1718.96884431 +p_7171,45.521072,-122.71241,143,1723.0445035 +p_7171,45.521095,-122.712379,144,1726.56594548 +p_7171,45.521126,-122.712326,145,1731.95271188 +p_7171,45.521145,-122.712288,146,1735.5960075 +p_7171,45.521229,-122.712082,147,1754.20227296 +p_7171,45.521526,-122.711319,148,1822.34329717 +p_7171,45.521847,-122.710495,149,1895.9454878 +p_7171,45.521881,-122.710396,150,1904.55387858 +p_7171,45.521896,-122.710342,151,1909.09022477 +p_7171,45.521904,-122.710289,152,1913.32538102 +p_7171,45.521904,-122.71022,153,1918.71619595 +p_7171,45.5219,-122.710144,154,1924.67052493 +p_7171,45.521797,-122.709641,155,1965.60222811 +p_7171,45.521786,-122.709595,156,1969.39836533 +p_7171,45.521774,-122.709557,157,1972.65303918 +p_7171,45.521759,-122.709526,158,1975.59331834 +p_7171,45.521736,-122.709488,159,1979.51105229 +p_7171,45.521713,-122.709457,160,1983.03247556 +p_7171,45.52169,-122.709435,161,1986.11286897 +p_7171,45.521667,-122.709419,162,1988.95841201 +p_7171,45.521637,-122.709396,163,1992.74606303 +p_7171,45.52161,-122.709389,164,1995.79632472 +p_7171,45.52158,-122.709381,165,1999.1886603 +p_7171,45.521553,-122.709381,166,2002.1894935 +p_7171,45.521523,-122.709389,167,2005.58182917 +p_7171,45.521488,-122.709396,168,2009.51005469 +p_7171,45.521461,-122.709412,169,2012.76084436 +p_7171,45.521439,-122.709435,170,2015.79525817 +p_7171,45.521412,-122.709457,171,2019.25348882 +p_7171,45.521389,-122.709488,172,2022.77492155 +p_7171,45.521374,-122.709518,173,2025.65119929 +p_7171,45.521358,-122.709549,174,2028.65590444 +p_7171,45.521347,-122.709579,175,2031.29944665 +p_7171,45.521339,-122.70961,176,2033.87947975 +p_7171,45.521336,-122.709641,177,2036.32430743 +p_7171,45.52132,-122.709793,178,2048.3322502 +p_7171,45.521313,-122.709854,179,2053.16117649 +p_7171,45.521305,-122.709915,180,2058.00925066 +p_7171,45.521294,-122.709961,181,2061.8054175 +p_7171,45.521267,-122.71006,182,2070.1018681 +p_7171,45.521248,-122.710129,183,2075.89158457 +p_7171,45.521221,-122.710205,184,2082.54457079 +p_7171,45.521183,-122.710289,185,2090.34890127 +p_7171,45.521149,-122.710365,186,2097.3871428 +p_7171,45.521118,-122.710411,187,2102.36580613 +p_7171,45.521076,-122.710472,188,2109.03688581 +p_7171,45.520969,-122.710594,189,2124.27755971 +p_7171,45.520844,-122.710739,190,2142.20375141 +p_7171,45.520779,-122.710808,191,2151.21771101 +p_7171,45.520741,-122.710838,192,2156.0479111 +p_7171,45.520714,-122.710854,193,2159.29870676 +p_7171,45.520676,-122.710869,194,2163.68168581 +p_7171,45.520645,-122.710876,195,2167.17022294 +p_7171,45.520592,-122.710876,196,2173.06074638 +p_7171,45.520569,-122.710869,197,2175.67486142 +p_7171,45.520542,-122.710861,198,2178.74009679 +p_7171,45.520523,-122.710854,199,2180.92146616 +p_7171,45.520496,-122.710838,200,2184.17226357 +p_7171,45.520462,-122.710808,201,2188.61898781 +p_7171,45.520374,-122.710724,202,2200.39734596 +p_7171,45.52034,-122.710701,203,2204.58168481 +p_7171,45.520309,-122.710693,204,2208.08332125 +p_7171,45.520279,-122.710686,205,2211.46213601 +p_7171,45.520256,-122.710678,206,2214.09370675 +p_7171,45.520222,-122.710686,207,2217.92387676 +p_7171,45.520187,-122.710693,208,2221.85210315 +p_7171,45.520153,-122.710709,209,2225.83233336 +p_7171,45.520126,-122.710732,210,2229.33007327 +p_7171,45.5201,-122.710762,211,2233.05085422 +p_7171,45.520077,-122.7108,212,2236.9686538 +p_7171,45.520058,-122.710831,213,2240.1819912 +p_7171,45.520035,-122.710876,214,2244.52892028 +p_7171,45.519947,-122.711189,215,2270.86702934 +p_7171,45.519924,-122.711266,216,2277.40364214 +p_7171,45.519905,-122.711319,217,2282.05191662 +p_7171,45.519878,-122.711365,218,2286.73399572 +p_7171,45.519859,-122.711395,219,2289.88886667 +p_7171,45.519833,-122.711433,220,2294.03193928 +p_7171,45.519821,-122.711449,221,2295.85991341 +p_7171,45.519802,-122.711464,222,2298.27502271 +p_7171,45.519787,-122.711479,223,2300.31286707 +p_7171,45.519764,-122.711494,224,2303.12498008 +p_7171,45.519737,-122.71151,225,2306.37578359 +p_7171,45.519718,-122.711525,226,2308.7908937 +p_7171,45.519695,-122.711533,227,2311.42246567 +p_7171,45.519646,-122.711555,228,2317.13324201 +p_7171,45.519588,-122.711586,229,2324.01948009 +p_7171,45.519547,-122.711609,230,2328.91783242 +p_7171,45.519505,-122.711639,231,2334.14122926 +p_7171,45.519478,-122.711662,232,2337.63897948 +p_7171,45.519451,-122.711693,233,2341.49532387 +p_7171,45.519424,-122.711731,234,2345.71668159 +p_7171,45.519394,-122.711792,235,2351.53321537 +p_7171,45.519356,-122.711899,236,2360.8995053 +p_7171,45.519314,-122.711998,237,2369.93388832 +p_7171,45.519295,-122.712044,238,2374.1023894 +p_7171,45.51926,-122.712097,239,2379.78388792 +p_7171,45.51923,-122.712135,240,2384.24843748 +p_7171,45.519184,-122.712189,241,2390.87706889 +p_7171,45.519135,-122.712234,242,2397.35936089 +p_7171,45.519051,-122.712273,243,2407.17997468 +p_7171,45.518986,-122.712296,244,2414.6243512 +p_7171,45.518948,-122.712311,245,2419.00733861 +p_7171,45.518898,-122.712326,246,2424.68667378 +p_7171,45.518818,-122.712326,247,2433.57802716 +p_7171,45.518784,-122.712311,248,2437.53442177 +p_7171,45.518757,-122.71228,249,2441.39078458 +p_7171,45.518719,-122.712219,250,2447.75885935 +p_7171,45.518707,-122.712173,251,2451.59241815 +p_7171,45.5187,-122.712128,252,2455.19341322 +p_7171,45.518696,-122.712082,253,2458.81488484 +p_7171,45.5187,-122.712029,254,2462.97968635 +p_7171,45.518707,-122.711983,255,2466.65700705 +p_7171,45.518719,-122.711952,256,2469.42202399 +p_7171,45.518734,-122.711929,257,2471.87328265 +p_7171,45.518761,-122.711891,258,2476.09466564 +p_7171,45.518837,-122.711807,259,2486.79150474 +p_7171,45.518967,-122.711655,260,2505.49439893 +p_7171,45.518997,-122.711617,261,2509.95895757 +p_7171,45.519028,-122.711555,262,2515.90342972 +p_7171,45.519054,-122.711502,263,2520.95298721 +p_7171,45.519081,-122.711441,264,2526.58504338 +p_7171,45.5191,-122.711395,265,2530.75355617 +p_7171,45.519123,-122.711327,266,2536.64948056 +p_7171,45.519184,-122.711151,267,2551.98108198 +p_7171,45.519241,-122.71096,268,2568.19319599 +p_7171,45.519264,-122.710884,269,2574.65803858 +p_7171,45.519306,-122.7108,270,2582.71181387 +p_7171,45.519333,-122.710754,271,2587.39392073 +p_7171,45.519352,-122.710716,272,2591.03729281 +p_7171,45.519379,-122.710678,273,2595.25865317 +p_7171,45.519421,-122.710617,274,2601.92983423 +p_7171,45.519493,-122.710533,275,2612.27916669 +p_7171,45.519588,-122.710434,276,2625.36776301 +p_7171,45.519627,-122.710388,277,2630.9984998 +p_7171,45.519661,-122.710342,278,2636.21352685 +p_7171,45.519699,-122.710266,279,2643.50024223 +p_7171,45.52063,-122.708496,280,2816.21654915 +p_7171,45.520866,-122.708046,281,2860.08095806 +p_7171,45.520985,-122.707802,282,2883.28314236 +p_7171,45.521435,-122.706947,283,2966.73154068 +p_7171,45.521481,-122.706856,284,2975.48856881 +p_7171,45.521503,-122.70681,285,2979.83537979 +p_7171,45.521526,-122.706749,286,2985.24348369 +p_7171,45.522366,-122.706757,287,3078.60483705 +p_7171,45.522568,-122.706749,288,3101.06421696 +p_7171,45.523335,-122.706741,289,3186.31242006 +p_7171,45.523479,-122.706741,290,3202.31686895 +p_7171,45.523518,-122.706688,291,3208.31130281 +p_7171,45.523552,-122.706642,292,3213.52616101 +p_7171,45.523579,-122.706589,293,3218.63986616 +p_7171,45.523598,-122.706535,294,3223.3576318 +p_7171,45.523609,-122.70649,295,3227.07978224 +p_7171,45.523621,-122.706429,296,3232.02853681 +p_7171,45.523628,-122.706367,297,3236.93439166 +p_7171,45.523628,-122.706299,298,3242.24691658 +p_7171,45.523624,-122.706017,299,3264.28275568 +p_7171,45.523617,-122.705536,300,3301.86911457 +p_7171,45.523617,-122.705482,301,3306.08788518 +p_7171,45.523613,-122.705444,302,3309.08975194 +p_7171,45.523602,-122.705414,303,3311.73321136 +p_7171,45.52359,-122.705383,304,3314.49804532 +p_7171,45.523579,-122.70536,305,3316.67139599 +p_7171,45.523563,-122.705345,306,3318.80108106 +p_7171,45.523544,-122.70533,307,3321.21615387 +p_7171,45.523525,-122.705322,308,3323.41840252 +p_7171,45.52335,-122.705322,309,3342.8682537 +p_7171,45.5230671203632,-122.70533272347,310,3374.3192232 +p_7171,45.5228916556978,-122.70533272347,311,3393.82071665 +p_7171,45.5227710234233,-122.705327505952,312,3407.23422344 +p_7171,45.5224347138975,-122.70533272347,313,3444.61455617 +p_7171,45.5220508799169,-122.705343158506,314,3487.28241543 +p_7171,45.5219485237465,-122.705343158506,315,3498.65848273 +p_7171,45.5218388562144,-122.705337940988,316,3510.85396348 +p_7171,45.5218073461283,-122.705317888776,317,3514.69049926 +p_7171,45.5217956438517,-122.705259430658,318,3519.43928871 +p_7171,45.5217858919528,-122.705173135341,319,3526.26792435 +p_7171,45.5217913335509,-122.704967497213,320,3542.34538132 +p_7171,45.5217949891416,-122.704581400883,321,3572.51301508 +p_7171,45.5217936934719,-122.704363072851,322,3589.57113453 +p_7171,45.52174,-122.704346,323,3595.68598792 +p_7171,45.521709,-122.704353,324,3599.17452407 +p_7171,45.521687,-122.704369,325,3601.92065771 +p_7171,45.521637,-122.704224,326,3614.53881543 +p_7171,45.521584,-122.704086,327,3626.82470285 +p_7171,45.521255,-122.703232,328,3702.90908132 +p_7171,45.521198,-122.703087,329,3715.88875502 +p_7171,45.52113,-122.702873,330,3734.23709972 +p_7171,45.521111,-122.702835,331,3737.88039598 +p_7171,45.521084,-122.702789,332,3742.56241655 +p_7171,45.521053,-122.702759,333,3746.72948989 +p_7171,45.521008,-122.702721,334,3752.54569606 +p_7171,45.520958,-122.70269,335,3758.60766115 +p_7171,45.520695,-122.702576,336,3789.16485921 +p_7171,45.520565,-122.702499,337,3804.81572959 +p_7171,45.520504,-122.702438,338,3813.10292813 +p_7171,45.520466,-122.702385,339,3819.01764731 +p_7171,45.520439,-122.702347,340,3823.23896787 +p_7171,45.520416,-122.702301,341,3827.64930965 +p_7171,45.520405,-122.702248,342,3831.96689547 +p_7171,45.520401,-122.702187,343,3836.75350497 +p_7171,45.520405,-122.702126,344,3841.54011447 +p_7171,45.520412,-122.702087,345,3844.68493044 +p_7171,45.520424,-122.702026,346,3849.63394475 +p_7171,45.520447,-122.701973,347,3854.50029507 +p_7171,45.520466,-122.70192,348,3859.14853422 +p_7171,45.520809,-122.701248,349,3924.0317457 +p_7171,45.520897,-122.701073,350,3940.84240677 +p_7171,45.521,-122.700912,351,3957.8504571 +p_7171,45.521072,-122.700813,352,3968.97979466 +p_7171,45.521099,-122.70079,353,3972.47751953 +p_7171,45.521122,-122.700768,354,3975.55792277 +p_7171,45.521152,-122.700745,355,3979.3455813 +p_7171,45.52124,-122.700745,356,3989.12607404 +p_7171,45.521309,-122.700737,357,3996.82029827 +p_7171,45.522053,-122.700737,358,4079.50992575 +p_7171,45.522106,-122.700745,359,4085.43351708 +p_7171,45.522129,-122.700752,360,4088.04762968 +p_7171,45.522156,-122.70076,361,4091.11286228 +p_7171,45.522198,-122.700783,362,4096.11474562 +p_7171,45.52224,-122.700836,363,4102.35459124 +p_7171,45.522259,-122.700897,364,4107.56724614 +p_7171,45.522263,-122.700974,365,4113.59944948 +p_7171,45.522259,-122.701035,366,4118.3859028 +p_7171,45.522243,-122.701126,367,4125.71450454 +p_7171,45.522213,-122.701233,368,4134.71453558 +p_7171,45.522144,-122.701393,369,4149.37979844 +p_7171,45.522049,-122.701576,370,4167.15324257 +p_7171,45.52195,-122.701744,371,4184.280543 +p_7171,45.521828,-122.701927,372,4203.98511954 +p_7171,45.521694,-122.702225,373,4231.6231318 +p_7171,45.521526,-122.702477,374,4258.75737275 +p_7171,45.521465,-122.702576,375,4269.04277157 +p_7171,45.521435,-122.702736,376,4281.98034505 +p_7171,45.52142,-122.702805,377,4287.62310121 +p_7171,45.521389,-122.702888,378,4294.96623502 +p_7171,45.521355,-122.702988,379,4303.64495268 +p_7171,45.521286,-122.70314,380,4317.78139154 +p_7171,45.521255,-122.703232,381,4325.7523227 +p_7171,45.521584,-122.704086,382,4401.83670117 +p_7171,45.521637,-122.704224,383,4414.12258859 +p_7171,45.521687,-122.704369,384,4426.74074631 +p_7171,45.521664,-122.70443,385,4432.14883826 +p_7171,45.521652,-122.704575,386,4443.55564951 +p_7171,45.521653,-122.704576,387,4443.69150435 +p_7171,45.521648,-122.704644,388,4449.03319996 +p_7171,45.521604,-122.704775,389,4460.37627527 +p_7171,45.52155,-122.704857,390,4469.15485182 +p_7171,45.521493,-122.704933,391,4477.83760842 +p_7171,45.521411,-122.704993,392,4488.08617005 +p_7171,45.52135,-122.70503,393,4495.45639704 +p_7171,45.521133,-122.705108,394,4520.33220559 +p_7171,45.520654,-122.705172,395,4573.80351146 +p_7171,45.520482,-122.705212,396,4593.17369777 +p_7171,45.520396,-122.705254,397,4603.27950059 +p_7171,45.52035,-122.705306,398,4609.80973206 +p_7171,45.520306,-122.705405,399,4618.96083117 +p_7171,45.52029,-122.705488,400,4625.68502057 +p_7171,45.520301,-122.705599,401,4634.44319719 +p_7171,45.520327,-122.705681,402,4641.47139432 +p_7171,45.520369,-122.70574,403,4648.03179624 +p_7171,45.520419,-122.705769,404,4654.03304812 +p_7171,45.520473,-122.705776,405,4660.05958063 +p_7171,45.520533,-122.705767,406,4666.76506813 +p_7171,45.52061,-122.705728,407,4675.84926921 +p_7171,45.520679,-122.705645,408,4685.89229519 +p_7171,45.52077,-122.70554,409,4698.91497337 +p_7171,45.520831,-122.705517,410,4705.92873793 +p_7171,45.520906,-122.705533,411,4714.35759752 +p_7171,45.520971,-122.705605,412,4723.51365544 +p_7171,45.520999,-122.705668,413,4729.33703392 +p_7171,45.521009,-122.705745,414,4735.45477057 +p_7171,45.521007,-122.705813,415,4740.77219017 +p_7171,45.520982,-122.705879,416,4746.62966222 +p_7171,45.520941,-122.705923,417,4752.33774813 +p_7171,45.520889,-122.705941,418,4758.28577314 +p_7171,45.520815,-122.705963,419,4766.68796919 +p_7171,45.520733,-122.70597,420,4775.81800449 +p_7171,45.520604,-122.705991,421,4790.24889047 +p_7171,45.520508,-122.706024,422,4801.22561402 +p_7171,45.520334,-122.706094,423,4821.32278251 +p_7171,45.520209,-122.70615,424,4835.88820019 +p_7171,45.51976,-122.706146,425,4885.79190951 +p_7171,45.519235,-122.706145,426,4944.14147494 +p_7171,45.519103,-122.706145,427,4958.81220882 +p_7171,45.518421,-122.70614,428,5034.61200182 +p_7171,45.518366,-122.706169,429,5041.13123806 +p_7171,45.518298,-122.70621,430,5049.3397763 +p_7171,45.518193,-122.706501,431,5074.8964153 +p_7171,45.518133,-122.706656,432,5088.72160303 +p_7171,45.518028,-122.706913,433,5111.94660437 +p_7171,45.517956,-122.707141,434,5131.47573568 +p_7171,45.517915,-122.707328,435,5146.78075054 +p_7171,45.517898,-122.707484,436,5159.11511479 +p_7171,45.517888,-122.70762,437,5169.79920936 +p_7171,45.517889,-122.707726,438,5178.08208594 +p_7171,45.517907,-122.707833,439,5186.67837647 +p_7171,45.517939,-122.707954,440,5196.77933964 +p_7171,45.517979,-122.708059,441,5206.11044049 +p_7171,45.518004,-122.708134,442,5212.59579172 +p_7171,45.518005,-122.70823,443,5220.09739746 +p_7171,45.517961,-122.708316,444,5228.40796524 +p_7171,45.517899,-122.708339,445,5235.52923869 +p_7171,45.51783,-122.70825,446,5245.88137029 +p_7171,45.517506,-122.707416,447,5320.33263952 +p_7171,45.517463,-122.707311,448,5329.82718261 +p_7171,45.51743,-122.707257,449,5335.41769339 +p_7171,45.517383,-122.707217,450,5341.50494112 +p_7171,45.517307,-122.707215,451,5349.95316996 +p_7171,45.517233,-122.707244,452,5358.48409339 +p_7171,45.517119,-122.707349,453,5373.57848324 +p_7171,45.51698,-122.70745,454,5390.92610725 +p_7171,45.516727,-122.707595,455,5421.24162619 +p_7171,45.516625,-122.707653,456,5433.45035489 +p_7171,45.516529,-122.707862,457,5452.95721428 +p_7171,45.516457,-122.708037,458,5468.8003395 +p_7171,45.516396,-122.708225,459,5484.97882633 +p_7171,45.516378,-122.708317,460,5492.44046894 +p_7171,45.516327,-122.708368,461,5499.36927669 +p_7171,45.516257,-122.708388,462,5507.30460185 +p_7171,45.516193,-122.70836,463,5514.74653406 +p_7171,45.51615,-122.708296,464,5521.66366051 +p_7171,45.516118,-122.708213,465,5529.06012271 +p_7171,45.515959,-122.707685,466,5573.94129857 +p_7171,45.515748,-122.707114,467,5624.34476498 +p_7171,45.515505,-122.706539,468,5676.7658427 +p_7171,45.515424,-122.70633,469,5695.41341926 +p_7171,45.515343,-122.706171,470,5710.75598506 +p_7171,45.515254,-122.706048,471,5724.54773774 +p_7171,45.515146,-122.705989,472,5737.40590858 +p_7171,45.515059,-122.706001,473,5747.12060488 +p_7171,45.514982,-122.706028,474,5755.93473491 +p_7171,45.514849,-122.706056,475,5770.87763302 +p_7171,45.514739,-122.70607,476,5783.15207895 +p_7171,45.514593,-122.706055,477,5799.42106144 +p_7171,45.514432,-122.705963,478,5818.70490592 +p_7171,45.514156,-122.705759,479,5853.27447043 +p_7171,45.513959,-122.705552,480,5880.49595178 +p_7171,45.513849,-122.705432,481,5895.90332126 +p_7171,45.51367,-122.705262,482,5919.82489113 +p_7171,45.513574,-122.705208,483,5931.29855648 +p_7171,45.513496,-122.705215,484,5939.98485651 +p_7171,45.513446,-122.705232,485,5945.69850887 +p_7171,45.513379,-122.705275,486,5953.86796254 +p_7171,45.513309,-122.70533,487,5962.75600478 +p_7171,45.513195,-122.705446,488,5978.33461128 +p_7171,45.51314,-122.705526,489,5987.07781783 +p_7171,45.513092,-122.70561,490,5995.53612815 +p_7171,45.513066,-122.705674,491,6001.3119285 +p_7171,45.513046,-122.705742,492,6007.07165884 +p_7171,45.513042,-122.705813,493,6012.63738339 +p_7171,45.513044,-122.705885,494,6018.26785398 +p_7171,45.513057,-122.705969,495,6024.98875601 +p_7171,45.513082,-122.706053,496,6032.11639485 +p_7171,45.513123,-122.706132,497,6039.78914917 +p_7171,45.513174,-122.706194,498,6047.24566989001 +p_7171,45.513281,-122.706275,499,6060.71727287001 +p_7171,45.513693,-122.706531,500,6110.68636992 +p_7171,45.513819,-122.706605,501,6125.8370532 +p_7171,45.514128,-122.706753,502,6162.07471155 +p_7171,45.51419,-122.7068,503,6169.88306264 +p_7171,45.51424,-122.706866,504,6177.46444082 +p_7171,45.514281,-122.70694,505,6184.82642569 +p_7171,45.51446,-122.707448,506,6229.22705361 +p_7171,45.514624,-122.707873,507,6267.10905215 +p_7171,45.514839,-122.708497,508,6321.40756636 +p_7171,45.515014,-122.708887,509,6357.55912575 +p_7171,45.515079,-122.709106,510,6376.13361961 +p_7171,45.515108,-122.709346,511,6395.16150898 +p_7171,45.515109,-122.709599,512,6414.93052226 +p_7171,45.515092,-122.709688,513,6422.1368309 +p_7171,45.515066,-122.709771,514,6429.23686942 +p_7171,45.515036,-122.70984,515,6435.57604919 +p_7171,45.514996,-122.709904,516,6442.2672283 +p_7171,45.514918,-122.709963,517,6452.0858702 +p_7171,45.514851,-122.709997,518,6459.99209097 +p_7171,45.514777,-122.71002,519,6468.41064984 +p_7171,45.514693,-122.71002,520,6477.74656412 +p_7171,45.514572,-122.709993,521,6491.35920471 +p_7171,45.514451,-122.709926,522,6505.79045007 +p_7171,45.514347,-122.709823,523,6519.87514705 +p_7171,45.514298,-122.709759,524,6527.2688501 +p_7171,45.51431,-122.709739,525,6529.32335652 +p_7171,45.513919,-122.709239,526,6587.76025354 +p_7171,45.513743,-122.709114,527,6609.62421005 +p_7171,45.513531,-122.709078,528,6633.35359963001 +p_7171,45.513137,-122.709074,529,6677.14458795001 +p_7171,45.512779,-122.708969,530,6717.77048068 +p_7171,45.512601,-122.708957,531,6737.57593025 +p_7171,45.512523,-122.708996,532,6746.76504201 +p_7171,45.512456,-122.709133,533,6759.80549969 +p_7171,45.51233,-122.709282,534,6778.01724366 +p_7171,45.512258,-122.709396,535,6789.99176807 +p_7171,45.512014,-122.710091,536,6850.69429705 +p_7171,45.511953,-122.71018,537,6860.40665958 +p_7171,45.511827,-122.710278,538,6876.36759041 +p_7171,45.511527,-122.710446,539,6912.20143896 +p_7171,45.511406,-122.710554,540,6928.0783282 +p_7171,45.511311,-122.710704,541,6943.85398493001 +p_7171,45.51126,-122.710892,542,6959.60034508001 +p_7171,45.511254,-122.710993,543,6967.52085827001 +p_7171,45.511277,-122.71126,544,6988.54091243 +p_7171,45.511417,-122.71188,545,7039.42650225 +p_7171,45.511445,-122.712075,546,7054.97876954 +p_7171,45.511455,-122.712194,547,7064.34387719 +p_7171,45.511459,-122.712289,548,7071.78068705 +p_7171,45.511452,-122.712383,549,7079.1671411 +p_7171,45.511438,-122.712457,550,7085.15535303 +p_7171,45.511407,-122.712566,551,7094.34331568 +p_7171,45.511297,-122.712771,552,7114.49472732001 +p_7171,45.511189,-122.712954,553,7133.16480304 +p_7171,45.511156,-122.713046,554,7141.23544769 +p_7171,45.511141,-122.713143,555,7148.99645422 +p_7171,45.511133,-122.713341,556,7164.49422624 +p_7171,45.511126,-122.713432,557,7171.64764103 +p_7171,45.511108,-122.713523,558,7179.03467703 +p_7171,45.510999,-122.714053,559,7222.18577762 +p_7171,45.510998,-122.714196,560,7233.36075719 +p_7171,45.511011,-122.714323,561,7243.3895224 +p_7171,45.511037,-122.714443,562,7253.20180992 +p_7171,45.511121,-122.714596,563,7268.37089863 +p_7171,45.511216,-122.714708,564,7282.0850615 +p_7171,45.511282,-122.714767,565,7290.74897025 +p_7171,45.5114,-122.714873,566,7306.26044073 +p_7171,45.511776,-122.715137,567,7352.86432807 +p_7171,45.511856,-122.715228,568,7364.24944163 +p_7171,45.511922,-122.715376,569,7377.94454077 +p_7171,45.512033,-122.715605,570,7399.67941368 +p_7171,45.512192,-122.715832,571,7424.71784017 +p_7171,45.512288,-122.715939,572,7438.27323083 +p_7171,45.512374,-122.716012,573,7449.40418005 +p_7171,45.512449,-122.716064,574,7458.67744379 +p_7171,45.512555,-122.716115,575,7471.11425693 +p_7171,45.512737,-122.71617,576,7491.79358628001 +p_7171,45.51282,-122.716215,577,7501.66581271001 +p_7171,45.51288,-122.716271,578,7509.64184639001 +p_7171,45.512935,-122.716353,579,7518.49748448001 +p_7171,45.51298,-122.716468,580,7528.78165113001 +p_7171,45.51302,-122.716615,581,7541.09854098001 +p_7171,45.513054,-122.716821,582,7557.63298713 +p_7171,45.513065,-122.716999,583,7571.59553254 +p_7171,45.512934,-122.716988,584,7586.18045861 +p_7171,45.512662,-122.716938,585,7616.66245505 +p_7171,45.512621,-122.71693,586,7621.26194754 +p_7171,45.512557,-122.716917,587,7628.44719223 +p_7171,45.512412,-122.71687,588,7644.97593654 +p_7171,45.512322,-122.716859,589,7655.0155609 +p_7171,45.512241,-122.716875,590,7664.10444846 +p_7171,45.512149,-122.716932,591,7675.25747832 +p_7171,45.512067,-122.717026,592,7686.96266394 +p_7171,45.511965,-122.717142,593,7701.47744392 +p_7171,45.511798,-122.717335,594,7725.39282308 +p_7171,45.511712,-122.717403,595,7736.32872024 +p_7171,45.511634,-122.717228,596,7752.51988071 +p_7171,45.511572,-122.717097,597,7764.85969561 +p_7171,45.511478,-122.71689,598,7784.11562427 +p_7171,45.511369,-122.716652,599,7806.31112533 +p_7171,45.511252,-122.716391,600,7830.49906101 +p_7171,45.511206,-122.716288,601,7840.03421321 +p_7171,45.511178,-122.716232,602,7845.40390529001 +p_7171,45.51112,-122.716138,603,7855.17676572001 +p_7171,45.511071,-122.716076,604,7862.46585938 +p_7171,45.511023,-122.716033,605,7868.77067329001 +p_7171,45.510981,-122.716012,606,7873.71867037001 +p_7171,45.510923,-122.715989,607,7880.41075685001 +p_7171,45.510786,-122.715991,608,7895.63798014001 +p_7171,45.510672,-122.71603,609,7908.66950896001 +p_7171,45.510544,-122.716062,610,7923.11375131001 +p_7171,45.510457,-122.716105,611,7933.35029118001 +p_7171,45.510423,-122.716197,612,7941.47212959001 +p_7171,45.51044,-122.71645,613,7961.33254620001 +p_7171,45.51044,-122.716545,614,7968.75618992001 diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_attributes.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_attributes.txt new file mode 100644 index 000000000..a3b76a10f --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_attributes.txt @@ -0,0 +1,9 @@ +stop_id,stop_city +819989,Portland +815446,Portland +815440,Portland +815447,Portland +815449,Portland +815442,Portland +815441,Portland +815448,Portland diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_times.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_times.txt new file mode 100644 index 000000000..832bac8d0 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stop_times.txt @@ -0,0 +1,10 @@ +trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,shape_dist_traveled,timepoint,start_service_area_id,end_service_area_id,start_service_area_radius,end_service_area_radius,continuous_pickup,continuous_drop_off,pickup_booking_rule_id,drop_off_booking_rule_id,min_arrival_time,max_departure_time,mean_duration_factor,mean_duration_offset,safe_duration_factor,safe_duration_offset +t_819605_b_29153_tn_frequencies_trip,09:30:00,09:30:00,815440,1,,0,0,0,1,,,,,1,2,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:32:00,09:32:00,815441,2,,0,0,318.820676708954,1,,,,,2,1,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:34:00,09:34:00,815442,3,,0,0,1000.71024531231,1,,,,,0,1,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,,,815446,4,,0,0,3968.97979463876,0,,,,,1,1,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:40:00,09:40:00,815447,5,,0,0,4443.55564952831,1,,,,,1,0,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:44:00,09:44:00,815448,6,,0,0,5041.13123807771,1,,,,,0,0,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:48:00,09:48:00,815449,7,,0,0,6527.26885012783,1,,,,,0,2,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:50:00,09:50:00,819989,8,,0,0,7644.97593655051,1,,,,,1,1,,,,,,,, +t_819605_b_29153_tn_frequencies_trip,09:53:00,09:53:00,815440,9,,0,0,7968.75618992001,1,,,,,1,1,,,,,,,, diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stops.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stops.txt new file mode 100644 index 000000000..799dd9127 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/stops.txt @@ -0,0 +1,9 @@ +stop_id,stop_code,platform_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,stop_timezone,position,direction,wheelchair_boarding +815440,1,,TriMet Washington Park MAX Station,"Oregon Zoo, Portland Children's Museum, World Forestry Center, 4T Trail",45.510506,-122.716546,,,0,,America/Los_Angeles,,,0 +815441,2,,Oregon Vietnam Veterans Memorial,"Vietnam Memorial, Hoyt Arboretum trails",45.51234,-122.716857,,,0,,America/Los_Angeles,,,0 +815442,3,,Hoyt Arboretum Visitor Center,"Hoyt Arboretum Visitor Center, Hoyt Arboretum trails",45.515604,-122.716053,,,0,,America/Los_Angeles,,,0 +815446,11,,Lewis & Clark,Pedestrian link to NW 23rd and downtown,45.5210803696698,-122.700742129279,,,0,,America/Los_Angeles,,,0 +815447,4,,Oregon Holocaust Memorial,"Holocaust Memorial, Restrooms, Coming of the White Man Statue",45.521694,-122.704581,,,0,,America/Los_Angeles,,,0 +815448,5,,International Rose Test Garden,,45.518375,-122.706183,,,0,,America/Los_Angeles,,,0 +815449,6,,Archery Range,"Archery Range, Wildwood Trail",45.514268,-122.709812,,,0,,America/Los_Angeles,,,0 +819989,7,,Oregon Vietnam Veterans Memorial,,45.512415,-122.716926,,,0,,America/Los_Angeles,,,0 diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetable_stop_order.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetable_stop_order.txt new file mode 100644 index 000000000..42c0a7ce5 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetable_stop_order.txt @@ -0,0 +1 @@ +timetable_id,stop_id,stop_sequence,stop_name,connected_routes diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetables.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetables.txt new file mode 100644 index 000000000..e626abc57 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/timetables.txt @@ -0,0 +1 @@ +timetable_id,route_id,direction_id,start_date,end_date,monday,tuesday,wednesday,thursday,friday,saturday,sunday,timetable_label,service_notes,direction_label,orientation diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/transfers.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/transfers.txt new file mode 100644 index 000000000..357103c47 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/transfers.txt @@ -0,0 +1 @@ +from_stop_id,to_stop_id,transfer_type,min_transfer_time diff --git a/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/trips.txt b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/trips.txt new file mode 100644 index 000000000..68040e54b --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/washington-park-shuttle-with-flex-additions/trips.txt @@ -0,0 +1,2 @@ +route_id,service_id,trip_id,trip_short_name,trip_headsign,direction_id,block_id,shape_id,bikes_allowed,wheelchair_accessible,trip_type,drt_max_travel_time,drt_avg_travel_time,drt_advance_book_min,drt_pickup_message,drt_drop_off_message,continuous_pickup_message,continuous_drop_off_message +3433,c_17784_b_29153_d_127,t_819605_b_29153_tn_frequencies_trip,,(loop),0,109732,p_7171,,,,,,,,,, From 31940f169f25f7866de5167303d08f71bbc57067 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Mon, 27 Sep 2021 21:42:09 -0400 Subject: [PATCH 2/8] fix(LineContext): Add (failing) test for querying missing fields. --- .../loader/ConditionallyRequiredTest2.java | 73 +++++++++++++++++++ .../conveyal/gtfs/loader/LineContextTest.java | 22 ++++++ .../tri-delta-fare-rules/agency.txt | 2 + .../tri-delta-fare-rules/calendar.txt | 2 + .../tri-delta-fare-rules/fare_attributes.txt | 2 + .../tri-delta-fare-rules/fare_rules.txt | 2 + .../tri-delta-fare-rules/routes.txt | 2 + .../tri-delta-fare-rules/shapes.txt | 3 + .../tri-delta-fare-rules/stop_times.txt | 6 ++ .../tri-delta-fare-rules/stops.txt | 6 ++ .../tri-delta-fare-rules/trips.txt | 2 + 11 files changed, 122 insertions(+) create mode 100644 src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java create mode 100644 src/test/java/com/conveyal/gtfs/loader/LineContextTest.java create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/agency.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/calendar.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_attributes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_rules.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/routes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/shapes.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stop_times.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stops.txt create mode 100644 src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/trips.txt diff --git a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java new file mode 100644 index 000000000..ef290195a --- /dev/null +++ b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java @@ -0,0 +1,73 @@ +package com.conveyal.gtfs.loader; + +import com.conveyal.gtfs.TestUtils; +import com.conveyal.gtfs.error.NewGTFSErrorType; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import javax.sql.DataSource; +import java.io.IOException; + +import static com.conveyal.gtfs.GTFS.load; +import static com.conveyal.gtfs.GTFS.validate; +import static com.conveyal.gtfs.TestUtils.assertThatSqlCountQueryYieldsExpectedCount; +import static com.conveyal.gtfs.error.NewGTFSErrorType.REFERENTIAL_INTEGRITY; + +/** + * Similar to ConditionallyRequiredTest + * except that it uses a different feed and checks a referential integrity error. + */ +// TODO: Refactor this class or extract common parts. +public class ConditionallyRequiredTest2 { + private static String testDBName; + private static DataSource testDataSource; + private static String testNamespace; + + @BeforeAll + public static void setUpClass() throws IOException { + // Create a new database + testDBName = TestUtils.generateNewDB(); + String dbConnectionUrl = String.format("jdbc:postgresql://localhost/%s", testDBName); + testDataSource = TestUtils.createTestDataSource(dbConnectionUrl); + // load feed into db + String zipFileName = TestUtils.zipFolderFiles( + "real-world-gtfs-feeds/tri-delta-fare-rules", + true); + FeedLoadResult feedLoadResult = load(zipFileName, testDataSource); + testNamespace = feedLoadResult.uniqueIdentifier; + validate(testNamespace, testDataSource); + } + + @AfterAll + public static void tearDownClass() { + TestUtils.dropDB(testDBName); + } + + @Test + void shouldNotTriggerRefIntegrityError() { + checkFeedHasZeroError( + REFERENTIAL_INTEGRITY, + "FareRule", + "2", + "1", + null + ); + } + + /** + * Check that the test feed has exactly one error for the provided values. + */ + private void checkFeedHasZeroError(NewGTFSErrorType errorType, String entityType, String lineNumber, String entityId, String badValue) { + String sql = String.format("select count(*) from %s.errors where error_type = '%s' and entity_type = '%s' and line_number = '%s'", + testNamespace, + errorType, + entityType, + lineNumber); + + if (entityId != null) sql += String.format(" and entity_id = '%s'", entityId); + if (badValue != null) sql += String.format(" and bad_value = '%s'", badValue); + + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, sql,0); + } +} diff --git a/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java b/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java new file mode 100644 index 000000000..617b25b41 --- /dev/null +++ b/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java @@ -0,0 +1,22 @@ +package com.conveyal.gtfs.loader; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNull; + +class LineContextTest { + /** + * Emulates querying a field in a GTFS record for which the column is absent in the source GTFS. + * Here we query the optional "contains_id" field that is missing in the "fare_rules" table. + */ + @Test + void shouldReturnNullForMissingField() { + // Line number, fare_id, route_id + // (Optional field "contains_id" is missing.) + String[] rowDataWithLineNumber = new String[] {"2", "1", "300"}; + Table table = Table.FARE_RULES; + LineContext lineContext = new LineContext(table, table.fields, rowDataWithLineNumber, 2); + + assertNull(lineContext.getValueForRow("contains_id")); + } +} diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/agency.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/agency.txt new file mode 100644 index 000000000..b492e4aed --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/agency.txt @@ -0,0 +1,2 @@ +agency_id,agency_name,agency_url,agency_phone,agency_timezone,agency_lang +1,"Tri Delta Transit","http://trideltatransit.com","(925) 754-4040","America/Los_Angeles","en" diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/calendar.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/calendar.txt new file mode 100644 index 000000000..3de7f3950 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/calendar.txt @@ -0,0 +1,2 @@ +service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date +1,1,1,1,1,1,1,1,20210828,20221231 diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_attributes.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_attributes.txt new file mode 100644 index 000000000..3db783ec3 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_attributes.txt @@ -0,0 +1,2 @@ +fare_id,price,currency_type,payment_method,transfers,transfer_duration,agency_id +"1",2.00,USD,0,0,,1 diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_rules.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_rules.txt new file mode 100644 index 000000000..33ebe9880 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/fare_rules.txt @@ -0,0 +1,2 @@ +fare_id,route_id +"1","300" diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/routes.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/routes.txt new file mode 100644 index 000000000..6c514bf35 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/routes.txt @@ -0,0 +1,2 @@ +route_id,agency_id,route_short_name,route_long_name,route_type,route_color,route_text_color,route_url +"300",1,"300","Brentwood Park & Ride / Antioch BART",3,800080,FFFFFF,"http://12.155.17.20/RTT/Public/Schedule.aspx?RouteNo=300" diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/shapes.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/shapes.txt new file mode 100644 index 000000000..c856989bd --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/shapes.txt @@ -0,0 +1,3 @@ +shape_id,shape_pt_lon,shape_pt_lat,shape_pt_sequence +27,-121.780946,37.996068,1 +27,-121.698770,37.933812,2 diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stop_times.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stop_times.txt new file mode 100644 index 000000000..b58d10a47 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stop_times.txt @@ -0,0 +1,6 @@ +trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,timepoint +1720,17:46:00,17:46:00,722,1,,1 +1720,17:59:00,17:59:00,33,2,,1 +1720,18:02:01,18:02:01,443,3,,0 +1720,18:20:06,18:20:06,421,4,,0 +1720,18:24:00,18:24:00,610,5,,1 diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stops.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stops.txt new file mode 100644 index 000000000..22887f687 --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/stops.txt @@ -0,0 +1,6 @@ +stop_id,stop_code,stop_name,stop_lat,stop_lon,stop_url,zone_id +33,813644,"Main St & Empire Ave",37.997839,-121.730492,"http://12.155.17.20/RTT/Public/RoutePositionET.aspx?PlatformTag=33", +421,810930,"Brentwood Blvd & Village Dr",37.941524,-121.696341,"http://12.155.17.20/RTT/Public/RoutePositionET.aspx?PlatformTag=421", +443,811043,"Main St & Norcross Ln",37.997716,-121.716376,"http://12.155.17.20/RTT/Public/RoutePositionET.aspx?PlatformTag=443", +610,811425,"Brentwood Park n Ride",37.933838,-121.698755,"http://12.155.17.20/RTT/Public/RoutePositionET.aspx?PlatformTag=610", +722,817754,"Antioch BART",37.995572,-121.778137,"http://12.155.17.20/RTT/Public/RoutePositionET.aspx?PlatformTag=722", diff --git a/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/trips.txt b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/trips.txt new file mode 100644 index 000000000..9c50e4f5a --- /dev/null +++ b/src/test/resources/real-world-gtfs-feeds/tri-delta-fare-rules/trips.txt @@ -0,0 +1,2 @@ +route_id,service_id,trip_id,trip_headsign,direction_id,block_id,shape_id +"300",1,1720,"Eastbound Brentwood Park & Ride",0,167,27 From 91340f5380894831807ad51fea9d8dbacf8e7a37 Mon Sep 17 00:00:00 2001 From: Robin Beer Date: Tue, 28 Sep 2021 11:36:25 +0100 Subject: [PATCH 3/8] refactor(Removed duplicate code): Removed duplicate code --- .../java/com/conveyal/gtfs/TestUtils.java | 27 +++++++ .../loader/ConditionallyRequiredTest.java | 77 +++++++++++++------ .../loader/ConditionallyRequiredTest2.java | 73 ------------------ 3 files changed, 79 insertions(+), 98 deletions(-) delete mode 100644 src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java diff --git a/src/test/java/com/conveyal/gtfs/TestUtils.java b/src/test/java/com/conveyal/gtfs/TestUtils.java index b58d0ee91..ca06de25d 100644 --- a/src/test/java/com/conveyal/gtfs/TestUtils.java +++ b/src/test/java/com/conveyal/gtfs/TestUtils.java @@ -1,5 +1,6 @@ package com.conveyal.gtfs; +import com.conveyal.gtfs.error.NewGTFSErrorType; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -185,4 +186,30 @@ public static void assertThatSqlCountQueryYieldsExpectedCount(DataSource dataSou ); } + /** + * Check that the test feed has expected number of errors for the provided values. + */ + public static void checkFeedHasExpectedNumberOfErrors( + String testNamespace, + DataSource testDataSource, + NewGTFSErrorType errorType, + String entityType, + String lineNumber, + String entityId, + String badValue, + int expectedNumberOfErrors + ) { + String sql = String.format("select count(*) from %s.errors where error_type = '%s' and entity_type = '%s' and line_number = '%s'", + testNamespace, + errorType, + entityType, + lineNumber); + + if (entityId != null) sql += String.format(" and entity_id = '%s'", entityId); + if (badValue != null) sql += String.format(" and bad_value = '%s'", badValue); + + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, sql, expectedNumberOfErrors); + } + + } diff --git a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java index 530f4499e..23a28fb93 100644 --- a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java +++ b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java @@ -15,34 +15,47 @@ import static com.conveyal.gtfs.GTFS.load; import static com.conveyal.gtfs.GTFS.validate; -import static com.conveyal.gtfs.TestUtils.assertThatSqlCountQueryYieldsExpectedCount; +import static com.conveyal.gtfs.TestUtils.checkFeedHasExpectedNumberOfErrors; import static com.conveyal.gtfs.error.NewGTFSErrorType.CONDITIONALLY_REQUIRED; import static com.conveyal.gtfs.error.NewGTFSErrorType.REFERENTIAL_INTEGRITY; import static com.conveyal.gtfs.error.NewGTFSErrorType.AGENCY_ID_REQUIRED_FOR_MULTI_AGENCY_FEEDS; public class ConditionallyRequiredTest { - private static String testDBName; - private static DataSource testDataSource; - private static String testNamespace; + private static String VTADBName; + private static DataSource VTADataSource; + private static String VTANamespace; + + private static String triDeltaDBName; + private static DataSource triDeltaDataSource; + private static String triDeltaNamespace; @BeforeAll public static void setUpClass() throws IOException { - // Create a new database - testDBName = TestUtils.generateNewDB(); - String dbConnectionUrl = String.format("jdbc:postgresql://localhost/%s", testDBName); - testDataSource = TestUtils.createTestDataSource(dbConnectionUrl); - // load feed into db - String zipFileName = TestUtils.zipFolderFiles( - "real-world-gtfs-feeds/VTA-gtfs-conditionally-required-checks", - true); - FeedLoadResult feedLoadResult = load(zipFileName, testDataSource); - testNamespace = feedLoadResult.uniqueIdentifier; - validate(testNamespace, testDataSource); + VTADBName = TestUtils.generateNewDB(); + VTADataSource = TestUtils.createTestDataSource(String.format("jdbc:postgresql://localhost/%s", VTADBName)); + VTANamespace = loadFeedAndValidate(VTADataSource, "real-world-gtfs-feeds/VTA-gtfs-conditionally-required-checks"); + + triDeltaDBName = TestUtils.generateNewDB(); + triDeltaDataSource = TestUtils.createTestDataSource(String.format("jdbc:postgresql://localhost/%s", triDeltaDBName)); + triDeltaNamespace = loadFeedAndValidate(triDeltaDataSource, "real-world-gtfs-feeds/tri-delta-fare-rules"); + } + + /** + * Load feed from zip file into a database and validate. + */ + private static String loadFeedAndValidate(DataSource dataSource, String zipFolderName) throws IOException { + String zipFileName = TestUtils.zipFolderFiles(zipFolderName, true); + FeedLoadResult feedLoadResult = load(zipFileName, dataSource); + String namespace = feedLoadResult.uniqueIdentifier; + validate(namespace, dataSource); + // return name space. + return namespace; } @AfterAll public static void tearDownClass() { - TestUtils.dropDB(testDBName); + TestUtils.dropDB(VTADBName); + TestUtils.dropDB(triDeltaDBName); } @Test @@ -142,19 +155,33 @@ public void fareAttributeTableMissingConditionallyRequiredAgencyId() { ); } + @Test + void shouldNotTriggerRefIntegrityError() { + checkFeedHasExpectedNumberOfErrors( + triDeltaNamespace, + triDeltaDataSource, + REFERENTIAL_INTEGRITY, + "FareRule", + "2", + "1", + null, + 0 + ); + } + /** - * Check that the test feed has exactly one error for the provided values. + * Check that a test feed has exactly one error for the provided values. */ private void checkFeedHasOneError(NewGTFSErrorType errorType, String entityType, String lineNumber, String entityId, String badValue) { - String sql = String.format("select count(*) from %s.errors where error_type = '%s' and entity_type = '%s' and line_number = '%s'", - testNamespace, + checkFeedHasExpectedNumberOfErrors( + VTANamespace, + VTADataSource, errorType, entityType, - lineNumber); - - if (entityId != null) sql += String.format(" and entity_id = '%s'", entityId); - if (badValue != null) sql += String.format(" and bad_value = '%s'", badValue); - - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, sql,1); + lineNumber, + entityId, + badValue, + 1 + ); } } diff --git a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java deleted file mode 100644 index ef290195a..000000000 --- a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest2.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.conveyal.gtfs.loader; - -import com.conveyal.gtfs.TestUtils; -import com.conveyal.gtfs.error.NewGTFSErrorType; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import javax.sql.DataSource; -import java.io.IOException; - -import static com.conveyal.gtfs.GTFS.load; -import static com.conveyal.gtfs.GTFS.validate; -import static com.conveyal.gtfs.TestUtils.assertThatSqlCountQueryYieldsExpectedCount; -import static com.conveyal.gtfs.error.NewGTFSErrorType.REFERENTIAL_INTEGRITY; - -/** - * Similar to ConditionallyRequiredTest - * except that it uses a different feed and checks a referential integrity error. - */ -// TODO: Refactor this class or extract common parts. -public class ConditionallyRequiredTest2 { - private static String testDBName; - private static DataSource testDataSource; - private static String testNamespace; - - @BeforeAll - public static void setUpClass() throws IOException { - // Create a new database - testDBName = TestUtils.generateNewDB(); - String dbConnectionUrl = String.format("jdbc:postgresql://localhost/%s", testDBName); - testDataSource = TestUtils.createTestDataSource(dbConnectionUrl); - // load feed into db - String zipFileName = TestUtils.zipFolderFiles( - "real-world-gtfs-feeds/tri-delta-fare-rules", - true); - FeedLoadResult feedLoadResult = load(zipFileName, testDataSource); - testNamespace = feedLoadResult.uniqueIdentifier; - validate(testNamespace, testDataSource); - } - - @AfterAll - public static void tearDownClass() { - TestUtils.dropDB(testDBName); - } - - @Test - void shouldNotTriggerRefIntegrityError() { - checkFeedHasZeroError( - REFERENTIAL_INTEGRITY, - "FareRule", - "2", - "1", - null - ); - } - - /** - * Check that the test feed has exactly one error for the provided values. - */ - private void checkFeedHasZeroError(NewGTFSErrorType errorType, String entityType, String lineNumber, String entityId, String badValue) { - String sql = String.format("select count(*) from %s.errors where error_type = '%s' and entity_type = '%s' and line_number = '%s'", - testNamespace, - errorType, - entityType, - lineNumber); - - if (entityId != null) sql += String.format(" and entity_id = '%s'", entityId); - if (badValue != null) sql += String.format(" and bad_value = '%s'", badValue); - - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, sql,0); - } -} From d715be09dfdcf79dbd2e565cbf958359e34eec6b Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Tue, 28 Sep 2021 13:25:34 +0100 Subject: [PATCH 4/8] test: clean test by moving to paramterized test --- .../conveyal/gtfs/loader/GtfsFlexTest.java | 63 +++++++------------ 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java b/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java index d76f1026c..bb0a48713 100644 --- a/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java +++ b/src/test/java/com/conveyal/gtfs/loader/GtfsFlexTest.java @@ -2,10 +2,13 @@ import com.conveyal.gtfs.TestUtils; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import javax.sql.DataSource; import java.io.IOException; +import java.util.stream.Stream; import static com.conveyal.gtfs.GTFS.load; import static com.conveyal.gtfs.GTFS.validate; @@ -35,48 +38,24 @@ public static void setUpClass() throws IOException { validate(testNamespace, testDataSource); } - @Test - void canImportContinuousPickupAndDropoff() { - String cp_0 = generateStopTimeQuery( - testNamespace, - "continuous_pickup", - 0); - String cp_1 = generateStopTimeQuery( - testNamespace, - "continuous_pickup", - 1); - String cp_2 = generateStopTimeQuery( - testNamespace, - "continuous_pickup", - 2); - - String cd_0 = generateStopTimeQuery( - testNamespace, - "continuous_drop_off", - 0); - String cd_1 = generateStopTimeQuery( - testNamespace, - "continuous_drop_off", - 1); - String cd_2 = generateStopTimeQuery( - testNamespace, - "continuous_drop_off", - 2); - - - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cp_0, 3); - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cp_1, 5); - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cp_2, 1); - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cd_0, 2); - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cd_1, 5); - assertThatSqlCountQueryYieldsExpectedCount(testDataSource, cd_2, 2); - - } - - private String generateStopTimeQuery(String namespace, String field, int value) { - return String.format("select count(*) from %s.stop_times where %s = '%s'", - testNamespace, + @ParameterizedTest + @MethodSource("createContinuousPickupAndDropOffChecks") + void continuousPickupAndDropOffTests(String namespace, String field, int value, int expectedCount) { + String query = String.format("select count(*) from %s.stop_times where %s = '%s'", + namespace, field, value); + assertThatSqlCountQueryYieldsExpectedCount(testDataSource, query, expectedCount); + } + + private static Stream createContinuousPickupAndDropOffChecks() { + return Stream.of( + Arguments.of(testNamespace, "continuous_pickup", 0, 3), + Arguments.of(testNamespace, "continuous_pickup", 1, 5), + Arguments.of(testNamespace, "continuous_pickup", 2, 1), + Arguments.of(testNamespace, "continuous_drop_off", 0, 2), + Arguments.of(testNamespace, "continuous_drop_off", 1, 5), + Arguments.of(testNamespace, "continuous_drop_off", 2, 2) + ); } } From 39a7842aeab8ba1a30d719769c1896779b521b3f Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Sep 2021 10:28:23 -0400 Subject: [PATCH 5/8] fix(LineContext): Return POSTGRES_NULL_TEXT if field not found. --- .../com/conveyal/gtfs/loader/LineContext.java | 9 ++++++++- .../conveyal/gtfs/loader/LineContextTest.java | 19 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/conveyal/gtfs/loader/LineContext.java b/src/main/java/com/conveyal/gtfs/loader/LineContext.java index 2ef0f1900..00acf0676 100644 --- a/src/main/java/com/conveyal/gtfs/loader/LineContext.java +++ b/src/main/java/com/conveyal/gtfs/loader/LineContext.java @@ -1,5 +1,7 @@ package com.conveyal.gtfs.loader; +import static com.conveyal.gtfs.loader.JdbcGtfsLoader.POSTGRES_NULL_TEXT; + /** * Wrapper class that provides access to row values and line context (e.g., line number) for a particular row of GTFS * data. @@ -31,10 +33,15 @@ public String getValueForRow(int columnIndex) { /** * Overloaded method to provide value for the current line for a particular field. + * @param fieldName The name of the GTFS field/column to retrieve + * @return The value for the field, if found, or POSTGRES_NULL_TEXT if the field is not found, + * consistent with cases where the value is null in the postgres database. */ public String getValueForRow(String fieldName) { int fieldIndex = Field.getFieldIndex(fields, fieldName); - return rowDataWithLineNumber[fieldIndex + 1]; + return fieldIndex >= 0 + ? rowDataWithLineNumber[fieldIndex + 1] + : POSTGRES_NULL_TEXT; } /** diff --git a/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java b/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java index 617b25b41..d24dd4ad2 100644 --- a/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java +++ b/src/test/java/com/conveyal/gtfs/loader/LineContextTest.java @@ -2,7 +2,12 @@ import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertNull; +import static com.conveyal.gtfs.loader.JdbcGtfsLoader.POSTGRES_NULL_TEXT; +import static com.conveyal.gtfs.loader.Requirement.OPTIONAL; +import static com.conveyal.gtfs.loader.Requirement.REQUIRED; +import static com.conveyal.gtfs.loader.Table.FARE_ATTRIBUTES; +import static com.conveyal.gtfs.loader.Table.ROUTES; +import static org.junit.jupiter.api.Assertions.assertEquals; class LineContextTest { /** @@ -10,13 +15,19 @@ class LineContextTest { * Here we query the optional "contains_id" field that is missing in the "fare_rules" table. */ @Test - void shouldReturnNullForMissingField() { + void shouldReturnPostgresNullTextForMissingField() { // Line number, fare_id, route_id // (Optional field "contains_id" is missing.) String[] rowDataWithLineNumber = new String[] {"2", "1", "300"}; Table table = Table.FARE_RULES; - LineContext lineContext = new LineContext(table, table.fields, rowDataWithLineNumber, 2); - assertNull(lineContext.getValueForRow("contains_id")); + // Here, only list fields that are loaded from the GTFS feed, as happens during execution. + Field[] fields = new Field[] { + new StringField("fare_id", REQUIRED).isReferenceTo(FARE_ATTRIBUTES), + new StringField("route_id", OPTIONAL).isReferenceTo(ROUTES), + }; + LineContext lineContext = new LineContext(table, fields, rowDataWithLineNumber, 2); + + assertEquals(POSTGRES_NULL_TEXT, lineContext.getValueForRow("contains_id")); } } From 59b70d2b6219507ca83068e0b42c012d59817772 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:34:54 -0400 Subject: [PATCH 6/8] refactor(ConditionallyRequiredTest): Fix sonarlint warnings, add comment for new ref integrity test. --- .../loader/ConditionallyRequiredTest.java | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java index 23a28fb93..38b3dbc3d 100644 --- a/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java +++ b/src/test/java/com/conveyal/gtfs/loader/ConditionallyRequiredTest.java @@ -59,7 +59,7 @@ public static void tearDownClass() { } @Test - public void stopTimeTableMissingConditionallyRequiredArrivalDepartureTimes() { + void stopTimeTableMissingConditionallyRequiredArrivalDepartureTimes() { checkFeedHasOneError( CONDITIONALLY_REQUIRED, "StopTime", @@ -71,7 +71,7 @@ public void stopTimeTableMissingConditionallyRequiredArrivalDepartureTimes() { @ParameterizedTest @MethodSource("createStopTableChecks") - public void stopTableConditionallyRequiredTests( + void stopTableConditionallyRequiredTests( NewGTFSErrorType errorType, String entityType, String lineNumber, @@ -95,7 +95,7 @@ private static Stream createStopTableChecks() { @ParameterizedTest @MethodSource("createTranslationTableChecks") - public void translationTableConditionallyRequiredTests( + void translationTableConditionallyRequiredTests( String entityType, String lineNumber, String entityId, @@ -113,7 +113,7 @@ private static Stream createTranslationTableChecks() { } @Test - public void agencyTableMissingConditionallyRequiredAgencyId() { + void agencyTableMissingConditionallyRequiredAgencyId() { checkFeedHasOneError( AGENCY_ID_REQUIRED_FOR_MULTI_AGENCY_FEEDS, "Agency", @@ -123,7 +123,7 @@ public void agencyTableMissingConditionallyRequiredAgencyId() { } @Test - public void tripTableMissingConditionallyRequiredShapeId() { + void tripTableMissingConditionallyRequiredShapeId() { checkFeedHasOneError( CONDITIONALLY_REQUIRED, "Trip", @@ -133,8 +133,27 @@ public void tripTableMissingConditionallyRequiredShapeId() { ); } + /** + * If an optional column is missing from an imported GTFS feed + * (e.g. if the "contains_id" column is missing from the "fare_rules" table), + * then, referential integrity errors should not be triggered. + */ + @Test + void shouldNotTriggerRefIntegrityErrorForMissingOptionalColumn() { + checkFeedHasExpectedNumberOfErrors( + triDeltaNamespace, + triDeltaDataSource, + REFERENTIAL_INTEGRITY, + "FareRule", + "2", + "1", + null, + 0 + ); + } + @Test - public void routeTableMissingConditionallyRequiredAgencyId() { + void routeTableMissingConditionallyRequiredAgencyId() { checkFeedHasOneError( AGENCY_ID_REQUIRED_FOR_MULTI_AGENCY_FEEDS, "Route", @@ -145,7 +164,7 @@ public void routeTableMissingConditionallyRequiredAgencyId() { } @Test - public void fareAttributeTableMissingConditionallyRequiredAgencyId() { + void fareAttributeTableMissingConditionallyRequiredAgencyId() { checkFeedHasOneError( AGENCY_ID_REQUIRED_FOR_MULTI_AGENCY_FEEDS, "FareAttribute", @@ -155,20 +174,6 @@ public void fareAttributeTableMissingConditionallyRequiredAgencyId() { ); } - @Test - void shouldNotTriggerRefIntegrityError() { - checkFeedHasExpectedNumberOfErrors( - triDeltaNamespace, - triDeltaDataSource, - REFERENTIAL_INTEGRITY, - "FareRule", - "2", - "1", - null, - 0 - ); - } - /** * Check that a test feed has exactly one error for the provided values. */ From 57ffec526f83646c694ea54e84794dbd464aa08d Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:45:24 -0400 Subject: [PATCH 7/8] ci(maven.yml): Update to node 14 for using semantic-release. --- .github/workflows/maven.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d30bb6689..9cdc9e195 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,11 +29,11 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - # Install node 12 for running maven-semantic-release. - - name: Use Node.js 12.x + # Install node 14+ for running maven-semantic-release. + - name: Use Node.js 14.x uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 14.x - name: Install maven-semantic-release # FIXME: Enable cache for node packages (add package.json?) run: | From 0364e4623857fb6a7fde40e6a21683e8a7cd5c36 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Wed, 29 Sep 2021 08:49:39 -0400 Subject: [PATCH 8/8] test(mtc-long-fields): Add required agency_id to fare_attributes (muklti-agency feed --- .../resources/fake-agency-mtc-long-fields/fare_attributes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/resources/fake-agency-mtc-long-fields/fare_attributes.txt b/src/test/resources/fake-agency-mtc-long-fields/fare_attributes.txt index 3173d016d..bbfec317d 100755 --- a/src/test/resources/fake-agency-mtc-long-fields/fare_attributes.txt +++ b/src/test/resources/fake-agency-mtc-long-fields/fare_attributes.txt @@ -1,2 +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 +fare_id,agency_id,price,currency_type,payment_method,transfers,transfer_duration +route_based_fare,1,1.23,USD,0,0,0 \ No newline at end of file