@@ -173,7 +173,6 @@ private FeedLoadResult convertFeed(String feedId, Integer version, FeedTx feedTx
173
173
updateTripsStatement .setString (1 , pattern .id );
174
174
updateTripsStatement .setString (2 , trip .gtfsTripId );
175
175
// FIXME: Do something with the return value? E.g., rollback if it hits more than one trip.
176
- // FIXME: Do this in batches?
177
176
updateTripsStatement .addBatch ();
178
177
batchSize += 1 ;
179
178
// If we've accumulated a lot of prepared statement calls, pass them on to the database backend.
@@ -185,10 +184,11 @@ private FeedLoadResult convertFeed(String feedId, Integer version, FeedTx feedTx
185
184
}
186
185
187
186
// Pattern stops table has not yet been created because pattern stops do not exist in
188
- // GTFSFeed. NOte, we want this table to be created regardless of whether patterns exist or not.
187
+ // GTFSFeed. Note, we want this table to be created regardless of whether patterns exist or not
188
+ // (which is why it is outside of the check for null pattern map).
189
189
Table .PATTERN_STOP .createSqlTable (connection , namespace , true );
190
190
191
- // Insert all trip patterns and pattern stops into database (tables have already been created FIXME pattern_stops has not yet been created ).
191
+ // Insert all trip patterns and pattern stops into database (tables have already been created).
192
192
if (feedTx .tripPatterns != null ) {
193
193
batchSize = 0 ;
194
194
// Handle inserting patterns
@@ -214,9 +214,8 @@ private FeedLoadResult convertFeed(String feedId, Integer version, FeedTx feedTx
214
214
insertPatternStatement .setString (6 , pattern .id );
215
215
insertPatternStatement .addBatch ();
216
216
batchSize += 1 ;
217
-
218
- int stopSequence = 1 ;
219
- // LOG.info("Inserting {} pattern stops for pattern {}", pattern.patternStops.size(), pattern.id);
217
+ // stop_sequence must be zero-based and incrementing to match stop_times values.
218
+ int stopSequence = 0 ;
220
219
for (TripPatternStop tripPatternStop : pattern .patternStops ) {
221
220
// TripPatternStop's stop ID needs to be mapped to GTFS stop ID.
222
221
// FIXME Possible NPE?
@@ -228,7 +227,6 @@ private FeedLoadResult convertFeed(String feedId, Integer version, FeedTx feedTx
228
227
insertPatternStopStatement .setInt (5 , tripPatternStop .defaultDwellTime );
229
228
insertPatternStopStatement .setInt (6 , 0 );
230
229
insertPatternStopStatement .setInt (7 , 0 );
231
- // FIXME: shapeDistTraveled could be null
232
230
if (tripPatternStop .shapeDistTraveled == null ) {
233
231
insertPatternStopStatement .setNull (8 , JDBCType .DOUBLE .getVendorTypeNumber ());
234
232
} else {
0 commit comments