Пример #1
0
 public GraphHopper importOrLoad() {
   if (!load(ghLocation)) {
     printInfo();
     importOSM(ghLocation, osmFile);
   } else {
     printInfo();
   }
   return this;
 }
Пример #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;
  }