Skip to content

Commit

Permalink
flighdata-skyalps-gtfs: really remove duplicates of calendar.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Jan 23, 2024
1 parent 394cf18 commit 521b4ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import com.opendatahub.enumClasses.service_operation;
public class CalendarValues implements Serializable {
private static final long serialVersionUID = 1L;
@NonNull
private String service_id; // to be taken from scode
@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,15 @@ public void calculateGtfs()

// remove duplicates from calendar values
// because well, who knows how the above works?
calendarValues = calendarValues.stream().distinct().collect(Collectors.toList());
Map<String, CalendarValues> calendarValuesMap = new HashMap<>();
for(CalendarValues value:calendarValues ){
calendarValuesMap.put(value.getService_id(), value);
}

GTFSWriteAgency.writeAgency(agencyValues);
GTFSWriteCalendar_Dates.writeCalendar_Dates(calendarDatesValues);
GTFSStop_Times.writeStop_Times(stoptimesvalues);
GTFSWriteCalendar.writeCalendar(calendarValues);
GTFSWriteCalendar.writeCalendar(new ArrayList<>(calendarValuesMap.values()));
GTFSWriteStops.writeStops(stopsvalueslist);
GTFSWriteRoutes.writeRoutes(routesvaluelist);
GTFSWriteTrips.writeTrips(tripsvalueslist);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;

import com.opendatahub.constantsClasses.Calendar;
Expand Down

0 comments on commit 521b4ef

Please sign in to comment.