@Override public void parse(Osmformat.HeaderBlock block) { for (String s : block.getRequiredFeaturesList()) { if (s.equals("OsmSchema-V0.6")) { continue; // We can parse this. } if (s.equals("DenseNodes")) { continue; // We can parse this. } throw new OsmosisRuntimeException("File requires unknown feature: " + s); } if (block.hasBbox()) { String source = OsmosisConstants.VERSION; if (block.hasSource()) { source = block.getSource(); } double multiplier = .000000001; double rightf = block.getBbox().getRight() * multiplier; double leftf = block.getBbox().getLeft() * multiplier; double topf = block.getBbox().getTop() * multiplier; double bottomf = block.getBbox().getBottom() * multiplier; Bound bounds = new Bound(rightf, leftf, topf, bottomf, source); sink.process(new BoundContainer(bounds)); } }
@Override public BoundContainer apply(Osmformat.HeaderBlock header) { Bound bound; if (header.hasBbox()) { Osmformat.HeaderBBox bbox = header.getBbox(); bound = new Bound(bbox.getRight() * COORDINATE_SCALING_FACTOR, bbox.getLeft() * COORDINATE_SCALING_FACTOR, bbox.getTop() * COORDINATE_SCALING_FACTOR, bbox.getBottom() * COORDINATE_SCALING_FACTOR, header.getSource()); } else { bound = new Bound(header.getSource()); } return new BoundContainer(bound); } }
private static BoundingBox toBoundingBox(Osmformat.HeaderBBox bbox) { return new BoundingBox(new SimpleNavigationPosition(asCoordinate(bbox.getRight()), asCoordinate(bbox.getTop())), new SimpleNavigationPosition(asCoordinate(bbox.getLeft()), asCoordinate(bbox.getBottom()))); }
/** * <code>required sint64 right = 2;</code> */ @java.lang.Override public long getRight() { return instance.getRight(); } /**