public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("usage: bundle.xml output_path"); System.exit(-1); } List<String> paths = new ArrayList<String>(); paths.add(args[0]); ConfigurableApplicationContext context = ContainerLibrary.createContext(paths); GtfsDaoImpl store = new GtfsDaoImpl(); DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory(); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class, "stop_direction", "stopDirection"); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class, "block_sequence_id", "blockSequenceId"); GtfsReadingSupport.readGtfsIntoStore(context, store,schema); writeGtfs(new File(args[1]), store, schema); }
public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("usage: bundle.xml output_path"); System.exit(-1); } List<String> paths = new ArrayList<String>(); paths.add(args[0]); ConfigurableApplicationContext context = ContainerLibrary.createContext(paths); GtfsDaoImpl store = new GtfsDaoImpl(); DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory(); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class, "stop_direction", "stopDirection"); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class, "block_sequence_id", "blockSequenceId"); GtfsReadingSupport.readGtfsIntoStore(context, store,schema); writeGtfs(new File(args[1]), store, schema); }
public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("usage: bundle.xml output_path"); System.exit(-1); } List<String> paths = new ArrayList<String>(); paths.add(args[0]); ConfigurableApplicationContext context = ContainerLibrary.createContext(paths); GtfsDaoImpl store = new GtfsDaoImpl(); DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory(); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class, "stop_direction", "stopDirection"); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class, "block_sequence_id", "blockSequenceId"); GtfsReadingSupport.readGtfsIntoStore(context, store,schema); writeGtfs(new File(args[1]), store, schema); }
/** * Read the GTFS data into an internal data model * * @return the amount of time to read the GTFS data, in seconds as a decimal (0.22) * @throws IOException */ private double readGtfsData() throws IOException { _log.info("Reading GTFS data from " + mPathToGtfsFile + "..."); mGtfsData = new GtfsDaoImpl(); mReader = new GtfsReader(); mReader.setInputLocation(mPathToGtfsFile); mReader.setEntityStore(mGtfsData); long startGtfsRead = System.nanoTime(); mReader.run(); double readTime = getElapsedTime(startGtfsRead, System.nanoTime()); _log.info(mPathToGtfsFile.getName() + " read in " + getElapsedTimeString(readTime)); return readTime; }