Package crosby.binary.file

Examples of crosby.binary.file.BlockInputStream


  }

 
  public static void main(String args[]) {
    try {
      BlockInputStream input = new BlockInputStream(new FileInputStream(args[0]),new TestBlockReader());
      input.process();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here


  private RailwayGraph _graph = new RailwayGraph();

  public void readOsmShapeData(File path) throws IOException {
    OsmPbfParserImpl parser = new OsmPbfParserImpl(_graph);
    BlockInputStream in = new BlockInputStream(new BufferedInputStream(
        new FileInputStream(path)), parser);
    in.process();
    in.close();
    _graph.addEdge(592400065L, 30744028L);
    _graph.pruneIslandNodes();
    _graph.pruneClusters(16000);
  }
View Full Code Here

    /** Open the given OSM PBF file and run this parser on it. */
    public void parse(String filename) {
        try {
            FileInputStream input = new FileInputStream(filename);
            new BlockInputStream(input, this).process();
            input.close();
        } catch (IOException e) {
            throw new RuntimeException("Error parsing OSM PBF.", e);
        }
    }
View Full Code Here

            BinaryOpenStreetMapParser parser = new BinaryOpenStreetMapParser(handler);

            FileInputStream input = new FileInputStream(_path);
            parser.setParseNodes(false);
            parser.setParseWays(false);
            (new BlockInputStream(input, parser)).process();
            handler.doneFirstPhaseRelations();

            input = new FileInputStream(_path);
            parser.setParseRelations(false);
            parser.setParseWays(true);
            (new BlockInputStream(input, parser)).process();
            handler.doneSecondPhaseWays();

            input = new FileInputStream(_path);
            parser.setParseNodes(true);
            parser.setParseWays(false);
            (new BlockInputStream(input, parser)).process();
            handler.doneThirdPhaseNodes();
        } catch (Exception ex) {
            throw new IllegalStateException("error loading OSM from path " + _path, ex);        }
    }
View Full Code Here

TOP

Related Classes of crosby.binary.file.BlockInputStream

Copyright © 2018 www.massapicom. 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.