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); }
}