@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)); } }
/** * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code> */ @java.lang.SuppressWarnings({"ReferenceEquality"}) private void mergeBbox(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox value) { if (value == null) { throw new NullPointerException(); } if (bbox_ != null && bbox_ != org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.getDefaultInstance()) { bbox_ = org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox.newBuilder(bbox_).mergeFrom(value).buildPartial(); } else { bbox_ = value; } bitField0_ |= 0x00000001; } /**
switch (method) { case NEW_MUTABLE_INSTANCE: { return new org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox(); if (!hasLeft()) { return null; if (!hasRight()) { return null; if (!hasTop()) { return null; if (!hasBottom()) { return null; org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox other = (org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox) arg1; left_ = visitor.visitLong( hasLeft(), left_, other.hasLeft(), other.left_); right_ = visitor.visitLong( hasRight(), right_, other.hasRight(), other.right_); top_ = visitor.visitLong( hasTop(), top_, other.hasTop(), other.top_); bottom_ = visitor.visitLong( hasBottom(), bottom_, other.hasBottom(), other.bottom_);
private void processBounds(Bound entity) { Osmformat.HeaderBlock.Builder headerblock = Osmformat.HeaderBlock .newBuilder(); Osmformat.HeaderBBox.Builder bbox = Osmformat.HeaderBBox.newBuilder(); bbox.setLeft(mapRawDegrees(entity.getLeft())); bbox.setBottom(mapRawDegrees(entity.getBottom())); bbox.setRight(mapRawDegrees(entity.getRight())); bbox.setTop(mapRawDegrees(entity.getTop())); headerblock.setBbox(bbox); if (entity.getOrigin() != null) { headerblock.setSource(entity.getOrigin()); } finishHeader(headerblock); }
@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); } }
public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox prototype) {
public static Builder newBuilder(org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox prototype) { return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); }
/** * <code>required sint64 right = 2;</code> */ @java.lang.Override public long getRight() { return instance.getRight(); } /**
/** * <code>required sint64 bottom = 4;</code> */ @java.lang.Override public long getBottom() { return instance.getBottom(); } /**
/** * <code>required sint64 left = 1;</code> */ @java.lang.Override public long getLeft() { return instance.getLeft(); } /**
/** * <code>required sint64 top = 3;</code> */ @java.lang.Override public long getTop() { return instance.getTop(); } /**