Esempio n. 1
0
 private void flush() {
   logger.info(
       "flushing graph "
           + graph.toString()
           + ", details:"
           + graph.toDetailsString()
           + ", "
           + Helper.getMemInfo()
           + ")");
   graph.flush();
 }
Esempio n. 2
0
 private void printInfo() {
   logger.info(
       "version "
           + Constants.VERSION
           + "|"
           + Constants.BUILD_DATE
           + " ("
           + Constants.getVersions()
           + ")");
   logger.info("graph " + graph.toString() + ", details:" + graph.toDetailsString());
 }
Esempio n. 3
0
  protected OSMReader importOSM(String _osmFile) throws IOException {
    if (graph == null) throw new IllegalStateException("Load or init graph before import OSM data");

    setOSMFile(_osmFile);
    File osmTmpFile = new File(osmFile);
    if (!osmTmpFile.exists()) {
      throw new IllegalStateException(
          "Your specified OSM file does not exist:" + osmTmpFile.getAbsolutePath());
    }

    logger.info("start creating graph from " + osmFile);
    OSMReader reader =
        new OSMReader(graph, expectedCapacity)
            .setWorkerThreads(workerThreads)
            .setEncodingManager(encodingManager)
            .setWayPointMaxDistance(wayPointMaxDistance)
            .setEnableInstructions(enableInstructions);
    logger.info("using " + graph.toString() + ", memory:" + Helper.getMemInfo());
    reader.doOSM2Graph(osmTmpFile);
    return reader;
  }