Osmformat.HeaderBlock headerBlock = Osmformat.HeaderBlock.parseFrom(blobData); if (headerBlock.hasBbox()) return toBoundingBox(headerBlock.getBbox());
if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getBbox());
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, getBbox()); } for (int i = 0; i < requiredFeatures_.size(); i++) { output.writeString(4, requiredFeatures_.get(i)); } for (int i = 0; i < optionalFeatures_.size(); i++) { output.writeString(5, optionalFeatures_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeString(16, getWritingprogram()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeString(17, getSource()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt64(32, osmosisReplicationTimestamp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeInt64(33, osmosisReplicationSequenceNumber_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeString(34, getOsmosisReplicationBaseUrl()); } unknownFields.writeTo(output); }
if (!getBbox().isInitialized()) { return null;
@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); } }
/** * <code>optional .OSMPBF.HeaderBBox bbox = 1;</code> */ @java.lang.Override public org.openstreetmap.osmosis.osmbinary.Osmformat.HeaderBBox getBbox() { return instance.getBbox(); } /**