Package org.onebusaway.gtfs.serialization

Examples of org.onebusaway.gtfs.serialization.GtfsReader.addEntityHandler()


        reader.setInputSource(gtfsBundle.getCsvInputSource());
        reader.setEntityStore(store);
        reader.setInternStrings(true);

        if (LOG.isDebugEnabled())
            reader.addEntityHandler(counter);

        if (gtfsBundle.getDefaultBikesAllowed())
            reader.addEntityHandler(new EntityBikeability(true));

        for (Class<?> entityClass : reader.getEntityClasses()) {
View Full Code Here


        if (LOG.isDebugEnabled())
            reader.addEntityHandler(counter);

        if (gtfsBundle.getDefaultBikesAllowed())
            reader.addEntityHandler(new EntityBikeability(true));

        for (Class<?> entityClass : reader.getEntityClasses()) {
            LOG.info("reading entities: " + entityClass.getName());
            reader.readEntities(entityClass);
            store.flush();
View Full Code Here

    GtfsReader reader = new GtfsReader();
    reader.setDefaultAgencyId("1");
    reader.getEntityClasses().retainAll(Arrays.asList(Stop.class));
    reader.setInputLocation(new File(args[0]));
    reader.addEntityHandler(new EntityHandlerImpl(bounds));
    reader.run();
  }

  private static class EntityHandlerImpl implements EntityHandler {
View Full Code Here

   
    GtfsReader reader = new GtfsReader();
    reader.setDefaultAgencyId("1");
    reader.getEntityClasses().retainAll(Arrays.asList(Stop.class));
    reader.setInputLocation(new File(args[0]));
    reader.addEntityHandler(new EntityHandlerImpl(points));
    reader.run();
  }

  private static Geometry readPoints(String arg) throws NumberFormatException, IOException {
   
View Full Code Here

      StopToPolygonEntityHandler handler = new StopToPolygonEntityHandler(2500);

      for (GtfsBundle bundle : bundles) {
        System.err.println(bundle.getPath());
        GtfsReader reader = new GtfsReader();
        reader.addEntityHandler(handler);
        reader.setInputLocation(bundle.getPath());
        if (bundle.getDefaultAgencyId() != null)
          reader.setDefaultAgencyId(bundle.getDefaultAgencyId());
        reader.readEntities(Stop.class);
      }
View Full Code Here

      reader.setInputLocation(bundle.getPath());
      for (Map.Entry<String, String> entry : bundle.getAgencyIdMappings().entrySet())
        reader.addAgencyIdMapping(entry.getKey(), entry.getValue());
      reader.getEntityClasses().retainAll(
          Arrays.asList(Agency.class, Stop.class));
      reader.addEntityHandler(handler);
      reader.run();
    }

    Set<AgencyAndId> ids = handler.getIds();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.