CSV files added

This commit is contained in:
AngeHerman 2024-04-28 14:07:18 +02:00
parent 5fbc584fab
commit ac06353b9d
3 changed files with 73825 additions and 4 deletions

71869
arret_idfm.csv Normal file

File diff suppressed because it is too large Load diff

View file

@ -41,6 +41,8 @@ public class IDFMNetworkExtractor {
*/ */
private static final String STOPS_FILE_URL = "https://data.iledefrance-mobilites.fr/api/explore/v2.1/catalog/datasets/arrets-lignes/exports/csv?lang=fr&timezone=Europe%2FBerlin&use_labels=true&delimiter=%3B"; private static final String STOPS_FILE_URL = "https://data.iledefrance-mobilites.fr/api/explore/v2.1/catalog/datasets/arrets-lignes/exports/csv?lang=fr&timezone=Europe%2FBerlin&use_labels=true&delimiter=%3B";
private static final String TRACE_FILE_DOWNLOADED_NAME = "./trace_idfm.csv";
private static final String STOPS_FILE_DOWNLOADED_NAME = "./arret_idfm.csv";
/** /**
* the index in the CSV of a Trace's ID * the index in the CSV of a Trace's ID
*/ */
@ -111,7 +113,7 @@ public class IDFMNetworkExtractor {
Map<String, TraceEntry> traces = new HashMap<>(); Map<String, TraceEntry> traces = new HashMap<>();
try { try {
CSVTools.readCSVFromURL(TRACE_FILE_URL, CSVTools.readCSVFromFile(TRACE_FILE_DOWNLOADED_NAME,
(String[] line) -> addLine(line, traces)); (String[] line) -> addLine(line, traces));
} catch (IOException e) { } catch (IOException e) {
LOGGER.log(Level.SEVERE, "Error while reading the line paths", e); LOGGER.log(Level.SEVERE, "Error while reading the line paths", e);
@ -119,7 +121,7 @@ public class IDFMNetworkExtractor {
List<StopEntry> stops = new ArrayList<>(traces.size() * GUESS_STOPS_BY_LINE); List<StopEntry> stops = new ArrayList<>(traces.size() * GUESS_STOPS_BY_LINE);
try { try {
CSVTools.readCSVFromURL(STOPS_FILE_URL, CSVTools.readCSVFromFile(STOPS_FILE_DOWNLOADED_NAME,
(String[] line) -> addStop(line, traces, stops)); (String[] line) -> addStop(line, traces, stops));
} catch (IOException e) { } catch (IOException e) {
LOGGER.log(Level.SEVERE, "Error while reading the stops", e); LOGGER.log(Level.SEVERE, "Error while reading the stops", e);
@ -252,7 +254,7 @@ public class IDFMNetworkExtractor {
Map<String, TraceEntry> traces = new HashMap<>(); Map<String, TraceEntry> traces = new HashMap<>();
try { try {
CSVTools.readCSVFromURL(TRACE_FILE_URL, CSVTools.readCSVFromFile(TRACE_FILE_DOWNLOADED_NAME,
(String[] line) -> addLine(line, traces)); (String[] line) -> addLine(line, traces));
} catch (IOException e) { } catch (IOException e) {
LOGGER.log(Level.SEVERE, "Error while reading the line paths", e); LOGGER.log(Level.SEVERE, "Error while reading the line paths", e);
@ -260,7 +262,7 @@ public class IDFMNetworkExtractor {
List<StopEntry> stops = new ArrayList<>(traces.size() * GUESS_STOPS_BY_LINE); List<StopEntry> stops = new ArrayList<>(traces.size() * GUESS_STOPS_BY_LINE);
try { try {
CSVTools.readCSVFromURL(STOPS_FILE_URL, CSVTools.readCSVFromFile(STOPS_FILE_DOWNLOADED_NAME,
(String[] line) -> addStop(line, traces, stops)); (String[] line) -> addStop(line, traces, stops));
} catch (IOException e) { } catch (IOException e) {
LOGGER.log(Level.SEVERE, "Error while reading the stops", e); LOGGER.log(Level.SEVERE, "Error while reading the stops", e);

1950
trace_idfm.csv Normal file

File diff suppressed because one or more lines are too long