Ejemplo n.º 1
0
 public GraphHopper importOrLoad() {
   if (!load(ghLocation)) {
     printInfo();
     importOSM(ghLocation, osmFile);
   } else {
     printInfo();
   }
   return this;
 }
Ejemplo n.º 2
0
  private GraphHopper importOSM(String graphHopperLocation, String osmFileStr) {
    if (encodingManager == null)
      throw new IllegalStateException("No encodingManager was specified");

    setGraphHopperLocation(graphHopperLocation);
    try {
      importOSM(osmFileStr);
    } catch (IOException ex) {
      throw new RuntimeException("Cannot parse OSM file " + osmFileStr, ex);
    }
    postProcessing();
    cleanUp();
    optimize();
    prepare();
    flush();
    initIndex();
    return this;
  }