From 36d5f22e15c93a1ea13278846a3579ccc113fcd4 Mon Sep 17 00:00:00 2001 From: Josef Petrak Date: Sat, 3 Dec 2011 22:12:45 +0100 Subject: [PATCH] Filtering non-passenger stations out --- .../name/jspetrak/stationdata/ProcessStationData.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/name/jspetrak/stationdata/ProcessStationData.java b/src/main/java/name/jspetrak/stationdata/ProcessStationData.java index 7b9b582..55d9851 100644 --- a/src/main/java/name/jspetrak/stationdata/ProcessStationData.java +++ b/src/main/java/name/jspetrak/stationdata/ProcessStationData.java @@ -14,6 +14,11 @@ import org.odftoolkit.odfdom.doc.table.OdfTable; import org.odftoolkit.odfdom.doc.table.OdfTableRow; +/** + * Processes all source ODS files into single RDF/XML file. + * + * @author Josef Petrak (me@jspetrak.name) + */ public class ProcessStationData { public static void main( String[] args ) throws Exception { Model model = ModelFactory.createDefaultModel(); @@ -37,9 +42,13 @@ public static void main( String[] args ) throws Exception { if (row.getRowIndex() > 0) { int code = Integer.valueOf(row.getCellByIndex(0).getStringValue()).intValue(); String name = row.getCellByIndex(1).getStringValue(); + int type = Integer.valueOf(row.getCellByIndex(9).getStringValue()).intValue(); int owner = Integer.valueOf(row.getCellByIndex(17).getStringValue()).intValue(); - createStation(model, code, name, owner); + // Filter out non-passenger railway stations + if (type == 1 | type == 3 | type == 7 | type == 61 | type == 62 | type == 63 | type == 65 | type == 82) { + createStation(model, code, name, owner); + } } }