// Generated by the protocol buffer compiler.  DO NOT EDIT!

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "osmformat.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
// @@protoc_insertion_point(includes)

namespace OSMPBF {

void protobuf_ShutdownFile_osmformat_2eproto() {
  delete HeaderBlock::default_instance_;
  delete HeaderBBox::default_instance_;
  delete PrimitiveBlock::default_instance_;
  delete PrimitiveGroup::default_instance_;
  delete StringTable::default_instance_;
  delete Info::default_instance_;
  delete DenseInfo::default_instance_;
  delete ChangeSet::default_instance_;
  delete Node::default_instance_;
  delete DenseNodes::default_instance_;
  delete Way::default_instance_;
  delete Relation::default_instance_;
}

void protobuf_AddDesc_osmformat_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  HeaderBlock::default_instance_ = new HeaderBlock();
  HeaderBBox::default_instance_ = new HeaderBBox();
  PrimitiveBlock::default_instance_ = new PrimitiveBlock();
  PrimitiveGroup::default_instance_ = new PrimitiveGroup();
  StringTable::default_instance_ = new StringTable();
  Info::default_instance_ = new Info();
  DenseInfo::default_instance_ = new DenseInfo();
  ChangeSet::default_instance_ = new ChangeSet();
  Node::default_instance_ = new Node();
  DenseNodes::default_instance_ = new DenseNodes();
  Way::default_instance_ = new Way();
  Relation::default_instance_ = new Relation();
  HeaderBlock::default_instance_->InitAsDefaultInstance();
  HeaderBBox::default_instance_->InitAsDefaultInstance();
  PrimitiveBlock::default_instance_->InitAsDefaultInstance();
  PrimitiveGroup::default_instance_->InitAsDefaultInstance();
  StringTable::default_instance_->InitAsDefaultInstance();
  Info::default_instance_->InitAsDefaultInstance();
  DenseInfo::default_instance_->InitAsDefaultInstance();
  ChangeSet::default_instance_->InitAsDefaultInstance();
  Node::default_instance_->InitAsDefaultInstance();
  DenseNodes::default_instance_->InitAsDefaultInstance();
  Way::default_instance_->InitAsDefaultInstance();
  Relation::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_osmformat_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_osmformat_2eproto {
  StaticDescriptorInitializer_osmformat_2eproto() {
    protobuf_AddDesc_osmformat_2eproto();
  }
} static_descriptor_initializer_osmformat_2eproto_;


// ===================================================================

#ifndef _MSC_VER
const int HeaderBlock::kBboxFieldNumber;
const int HeaderBlock::kRequiredFeaturesFieldNumber;
const int HeaderBlock::kOptionalFeaturesFieldNumber;
const int HeaderBlock::kWritingprogramFieldNumber;
const int HeaderBlock::kSourceFieldNumber;
#endif  // !_MSC_VER

HeaderBlock::HeaderBlock()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void HeaderBlock::InitAsDefaultInstance() {
  bbox_ = const_cast< ::OSMPBF::HeaderBBox*>(&::OSMPBF::HeaderBBox::default_instance());
}

HeaderBlock::HeaderBlock(const HeaderBlock& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void HeaderBlock::SharedCtor() {
  _cached_size_ = 0;
  bbox_ = NULL;
  writingprogram_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
  source_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

HeaderBlock::~HeaderBlock() {
  SharedDtor();
}

void HeaderBlock::SharedDtor() {
  if (writingprogram_ != &::google::protobuf::internal::kEmptyString) {
    delete writingprogram_;
  }
  if (source_ != &::google::protobuf::internal::kEmptyString) {
    delete source_;
  }
  if (this != default_instance_) {
    delete bbox_;
  }
}

void HeaderBlock::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const HeaderBlock& HeaderBlock::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

HeaderBlock* HeaderBlock::default_instance_ = NULL;

HeaderBlock* HeaderBlock::New() const {
  return new HeaderBlock;
}

void HeaderBlock::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_bbox()) {
      if (bbox_ != NULL) bbox_->::OSMPBF::HeaderBBox::Clear();
    }
    if (has_writingprogram()) {
      if (writingprogram_ != &::google::protobuf::internal::kEmptyString) {
        writingprogram_->clear();
      }
    }
    if (has_source()) {
      if (source_ != &::google::protobuf::internal::kEmptyString) {
        source_->clear();
      }
    }
  }
  required_features_.Clear();
  optional_features_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool HeaderBlock::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional .OSMPBF.HeaderBBox bbox = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_bbox()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_required_features;
        break;
      }
      
      // repeated string required_features = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_required_features:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_required_features()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_required_features;
        if (input->ExpectTag(42)) goto parse_optional_features;
        break;
      }
      
      // repeated string optional_features = 5;
      case 5: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_optional_features:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_optional_features()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(42)) goto parse_optional_features;
        if (input->ExpectTag(130)) goto parse_writingprogram;
        break;
      }
      
      // optional string writingprogram = 16;
      case 16: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_writingprogram:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_writingprogram()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(138)) goto parse_source;
        break;
      }
      
      // optional string source = 17;
      case 17: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_source:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_source()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void HeaderBlock::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional .OSMPBF.HeaderBBox bbox = 1;
  if (has_bbox()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      1, this->bbox(), output);
  }
  
  // repeated string required_features = 4;
  for (int i = 0; i < this->required_features_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteString(
      4, this->required_features(i), output);
  }
  
  // repeated string optional_features = 5;
  for (int i = 0; i < this->optional_features_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteString(
      5, this->optional_features(i), output);
  }
  
  // optional string writingprogram = 16;
  if (has_writingprogram()) {
    ::google::protobuf::internal::WireFormatLite::WriteString(
      16, this->writingprogram(), output);
  }
  
  // optional string source = 17;
  if (has_source()) {
    ::google::protobuf::internal::WireFormatLite::WriteString(
      17, this->source(), output);
  }
  
}

int HeaderBlock::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional .OSMPBF.HeaderBBox bbox = 1;
    if (has_bbox()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->bbox());
    }
    
    // optional string writingprogram = 16;
    if (has_writingprogram()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->writingprogram());
    }
    
    // optional string source = 17;
    if (has_source()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->source());
    }
    
  }
  // repeated string required_features = 4;
  total_size += 1 * this->required_features_size();
  for (int i = 0; i < this->required_features_size(); i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->required_features(i));
  }
  
  // repeated string optional_features = 5;
  total_size += 1 * this->optional_features_size();
  for (int i = 0; i < this->optional_features_size(); i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->optional_features(i));
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void HeaderBlock::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const HeaderBlock*>(&from));
}

void HeaderBlock::MergeFrom(const HeaderBlock& from) {
  GOOGLE_CHECK_NE(&from, this);
  required_features_.MergeFrom(from.required_features_);
  optional_features_.MergeFrom(from.optional_features_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_bbox()) {
      mutable_bbox()->::OSMPBF::HeaderBBox::MergeFrom(from.bbox());
    }
    if (from.has_writingprogram()) {
      set_writingprogram(from.writingprogram());
    }
    if (from.has_source()) {
      set_source(from.source());
    }
  }
}

void HeaderBlock::CopyFrom(const HeaderBlock& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool HeaderBlock::IsInitialized() const {
  
  if (has_bbox()) {
    if (!this->bbox().IsInitialized()) return false;
  }
  return true;
}

void HeaderBlock::Swap(HeaderBlock* other) {
  if (other != this) {
    std::swap(bbox_, other->bbox_);
    required_features_.Swap(&other->required_features_);
    optional_features_.Swap(&other->optional_features_);
    std::swap(writingprogram_, other->writingprogram_);
    std::swap(source_, other->source_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string HeaderBlock::GetTypeName() const {
  return "OSMPBF.HeaderBlock";
}


// ===================================================================

#ifndef _MSC_VER
const int HeaderBBox::kLeftFieldNumber;
const int HeaderBBox::kRightFieldNumber;
const int HeaderBBox::kTopFieldNumber;
const int HeaderBBox::kBottomFieldNumber;
#endif  // !_MSC_VER

HeaderBBox::HeaderBBox()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void HeaderBBox::InitAsDefaultInstance() {
}

HeaderBBox::HeaderBBox(const HeaderBBox& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void HeaderBBox::SharedCtor() {
  _cached_size_ = 0;
  left_ = GOOGLE_LONGLONG(0);
  right_ = GOOGLE_LONGLONG(0);
  top_ = GOOGLE_LONGLONG(0);
  bottom_ = GOOGLE_LONGLONG(0);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

HeaderBBox::~HeaderBBox() {
  SharedDtor();
}

void HeaderBBox::SharedDtor() {
  if (this != default_instance_) {
  }
}

void HeaderBBox::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const HeaderBBox& HeaderBBox::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

HeaderBBox* HeaderBBox::default_instance_ = NULL;

HeaderBBox* HeaderBBox::New() const {
  return new HeaderBBox;
}

void HeaderBBox::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    left_ = GOOGLE_LONGLONG(0);
    right_ = GOOGLE_LONGLONG(0);
    top_ = GOOGLE_LONGLONG(0);
    bottom_ = GOOGLE_LONGLONG(0);
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool HeaderBBox::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required sint64 left = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &left_)));
          set_has_left();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_right;
        break;
      }
      
      // required sint64 right = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_right:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &right_)));
          set_has_right();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(24)) goto parse_top;
        break;
      }
      
      // required sint64 top = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_top:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &top_)));
          set_has_top();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(32)) goto parse_bottom;
        break;
      }
      
      // required sint64 bottom = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_bottom:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &bottom_)));
          set_has_bottom();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void HeaderBBox::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required sint64 left = 1;
  if (has_left()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(1, this->left(), output);
  }
  
  // required sint64 right = 2;
  if (has_right()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(2, this->right(), output);
  }
  
  // required sint64 top = 3;
  if (has_top()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(3, this->top(), output);
  }
  
  // required sint64 bottom = 4;
  if (has_bottom()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(4, this->bottom(), output);
  }
  
}

int HeaderBBox::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required sint64 left = 1;
    if (has_left()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->left());
    }
    
    // required sint64 right = 2;
    if (has_right()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->right());
    }
    
    // required sint64 top = 3;
    if (has_top()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->top());
    }
    
    // required sint64 bottom = 4;
    if (has_bottom()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->bottom());
    }
    
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void HeaderBBox::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const HeaderBBox*>(&from));
}

void HeaderBBox::MergeFrom(const HeaderBBox& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_left()) {
      set_left(from.left());
    }
    if (from.has_right()) {
      set_right(from.right());
    }
    if (from.has_top()) {
      set_top(from.top());
    }
    if (from.has_bottom()) {
      set_bottom(from.bottom());
    }
  }
}

void HeaderBBox::CopyFrom(const HeaderBBox& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool HeaderBBox::IsInitialized() const {
  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
  
  return true;
}

void HeaderBBox::Swap(HeaderBBox* other) {
  if (other != this) {
    std::swap(left_, other->left_);
    std::swap(right_, other->right_);
    std::swap(top_, other->top_);
    std::swap(bottom_, other->bottom_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string HeaderBBox::GetTypeName() const {
  return "OSMPBF.HeaderBBox";
}


// ===================================================================

#ifndef _MSC_VER
const int PrimitiveBlock::kStringtableFieldNumber;
const int PrimitiveBlock::kPrimitivegroupFieldNumber;
const int PrimitiveBlock::kGranularityFieldNumber;
const int PrimitiveBlock::kLatOffsetFieldNumber;
const int PrimitiveBlock::kLonOffsetFieldNumber;
const int PrimitiveBlock::kDateGranularityFieldNumber;
#endif  // !_MSC_VER

PrimitiveBlock::PrimitiveBlock()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void PrimitiveBlock::InitAsDefaultInstance() {
  stringtable_ = const_cast< ::OSMPBF::StringTable*>(&::OSMPBF::StringTable::default_instance());
}

PrimitiveBlock::PrimitiveBlock(const PrimitiveBlock& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void PrimitiveBlock::SharedCtor() {
  _cached_size_ = 0;
  stringtable_ = NULL;
  granularity_ = 100;
  lat_offset_ = GOOGLE_LONGLONG(0);
  lon_offset_ = GOOGLE_LONGLONG(0);
  date_granularity_ = 1000;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PrimitiveBlock::~PrimitiveBlock() {
  SharedDtor();
}

void PrimitiveBlock::SharedDtor() {
  if (this != default_instance_) {
    delete stringtable_;
  }
}

void PrimitiveBlock::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const PrimitiveBlock& PrimitiveBlock::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

PrimitiveBlock* PrimitiveBlock::default_instance_ = NULL;

PrimitiveBlock* PrimitiveBlock::New() const {
  return new PrimitiveBlock;
}

void PrimitiveBlock::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_stringtable()) {
      if (stringtable_ != NULL) stringtable_->::OSMPBF::StringTable::Clear();
    }
    granularity_ = 100;
    lat_offset_ = GOOGLE_LONGLONG(0);
    lon_offset_ = GOOGLE_LONGLONG(0);
    date_granularity_ = 1000;
  }
  primitivegroup_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool PrimitiveBlock::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required .OSMPBF.StringTable stringtable = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_stringtable()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_primitivegroup;
        break;
      }
      
      // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_primitivegroup:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_primitivegroup()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_primitivegroup;
        if (input->ExpectTag(136)) goto parse_granularity;
        break;
      }
      
      // optional int32 granularity = 17 [default = 100];
      case 17: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_granularity:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &granularity_)));
          set_has_granularity();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(144)) goto parse_date_granularity;
        break;
      }
      
      // optional int32 date_granularity = 18 [default = 1000];
      case 18: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_date_granularity:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &date_granularity_)));
          set_has_date_granularity();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(152)) goto parse_lat_offset;
        break;
      }
      
      // optional int64 lat_offset = 19 [default = 0];
      case 19: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_lat_offset:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &lat_offset_)));
          set_has_lat_offset();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(160)) goto parse_lon_offset;
        break;
      }
      
      // optional int64 lon_offset = 20 [default = 0];
      case 20: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_lon_offset:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &lon_offset_)));
          set_has_lon_offset();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void PrimitiveBlock::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required .OSMPBF.StringTable stringtable = 1;
  if (has_stringtable()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      1, this->stringtable(), output);
  }
  
  // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;
  for (int i = 0; i < this->primitivegroup_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      2, this->primitivegroup(i), output);
  }
  
  // optional int32 granularity = 17 [default = 100];
  if (has_granularity()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->granularity(), output);
  }
  
  // optional int32 date_granularity = 18 [default = 1000];
  if (has_date_granularity()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->date_granularity(), output);
  }
  
  // optional int64 lat_offset = 19 [default = 0];
  if (has_lat_offset()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(19, this->lat_offset(), output);
  }
  
  // optional int64 lon_offset = 20 [default = 0];
  if (has_lon_offset()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(20, this->lon_offset(), output);
  }
  
}

int PrimitiveBlock::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required .OSMPBF.StringTable stringtable = 1;
    if (has_stringtable()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->stringtable());
    }
    
    // optional int32 granularity = 17 [default = 100];
    if (has_granularity()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->granularity());
    }
    
    // optional int64 lat_offset = 19 [default = 0];
    if (has_lat_offset()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->lat_offset());
    }
    
    // optional int64 lon_offset = 20 [default = 0];
    if (has_lon_offset()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->lon_offset());
    }
    
    // optional int32 date_granularity = 18 [default = 1000];
    if (has_date_granularity()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->date_granularity());
    }
    
  }
  // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;
  total_size += 1 * this->primitivegroup_size();
  for (int i = 0; i < this->primitivegroup_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->primitivegroup(i));
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void PrimitiveBlock::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const PrimitiveBlock*>(&from));
}

void PrimitiveBlock::MergeFrom(const PrimitiveBlock& from) {
  GOOGLE_CHECK_NE(&from, this);
  primitivegroup_.MergeFrom(from.primitivegroup_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_stringtable()) {
      mutable_stringtable()->::OSMPBF::StringTable::MergeFrom(from.stringtable());
    }
    if (from.has_granularity()) {
      set_granularity(from.granularity());
    }
    if (from.has_lat_offset()) {
      set_lat_offset(from.lat_offset());
    }
    if (from.has_lon_offset()) {
      set_lon_offset(from.lon_offset());
    }
    if (from.has_date_granularity()) {
      set_date_granularity(from.date_granularity());
    }
  }
}

void PrimitiveBlock::CopyFrom(const PrimitiveBlock& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PrimitiveBlock::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
  for (int i = 0; i < primitivegroup_size(); i++) {
    if (!this->primitivegroup(i).IsInitialized()) return false;
  }
  return true;
}

void PrimitiveBlock::Swap(PrimitiveBlock* other) {
  if (other != this) {
    std::swap(stringtable_, other->stringtable_);
    primitivegroup_.Swap(&other->primitivegroup_);
    std::swap(granularity_, other->granularity_);
    std::swap(lat_offset_, other->lat_offset_);
    std::swap(lon_offset_, other->lon_offset_);
    std::swap(date_granularity_, other->date_granularity_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string PrimitiveBlock::GetTypeName() const {
  return "OSMPBF.PrimitiveBlock";
}


// ===================================================================

#ifndef _MSC_VER
const int PrimitiveGroup::kNodesFieldNumber;
const int PrimitiveGroup::kDenseFieldNumber;
const int PrimitiveGroup::kWaysFieldNumber;
const int PrimitiveGroup::kRelationsFieldNumber;
const int PrimitiveGroup::kChangesetsFieldNumber;
#endif  // !_MSC_VER

PrimitiveGroup::PrimitiveGroup()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void PrimitiveGroup::InitAsDefaultInstance() {
  dense_ = const_cast< ::OSMPBF::DenseNodes*>(&::OSMPBF::DenseNodes::default_instance());
}

PrimitiveGroup::PrimitiveGroup(const PrimitiveGroup& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void PrimitiveGroup::SharedCtor() {
  _cached_size_ = 0;
  dense_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

PrimitiveGroup::~PrimitiveGroup() {
  SharedDtor();
}

void PrimitiveGroup::SharedDtor() {
  if (this != default_instance_) {
    delete dense_;
  }
}

void PrimitiveGroup::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const PrimitiveGroup& PrimitiveGroup::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

PrimitiveGroup* PrimitiveGroup::default_instance_ = NULL;

PrimitiveGroup* PrimitiveGroup::New() const {
  return new PrimitiveGroup;
}

void PrimitiveGroup::Clear() {
  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
    if (has_dense()) {
      if (dense_ != NULL) dense_->::OSMPBF::DenseNodes::Clear();
    }
  }
  nodes_.Clear();
  ways_.Clear();
  relations_.Clear();
  changesets_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool PrimitiveGroup::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated .OSMPBF.Node nodes = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_nodes:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_nodes()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(10)) goto parse_nodes;
        if (input->ExpectTag(18)) goto parse_dense;
        break;
      }
      
      // optional .OSMPBF.DenseNodes dense = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_dense:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_dense()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_ways;
        break;
      }
      
      // repeated .OSMPBF.Way ways = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_ways:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_ways()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_ways;
        if (input->ExpectTag(34)) goto parse_relations;
        break;
      }
      
      // repeated .OSMPBF.Relation relations = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_relations:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_relations()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_relations;
        if (input->ExpectTag(42)) goto parse_changesets;
        break;
      }
      
      // repeated .OSMPBF.ChangeSet changesets = 5;
      case 5: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_changesets:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_changesets()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(42)) goto parse_changesets;
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void PrimitiveGroup::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // repeated .OSMPBF.Node nodes = 1;
  for (int i = 0; i < this->nodes_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      1, this->nodes(i), output);
  }
  
  // optional .OSMPBF.DenseNodes dense = 2;
  if (has_dense()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      2, this->dense(), output);
  }
  
  // repeated .OSMPBF.Way ways = 3;
  for (int i = 0; i < this->ways_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      3, this->ways(i), output);
  }
  
  // repeated .OSMPBF.Relation relations = 4;
  for (int i = 0; i < this->relations_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      4, this->relations(i), output);
  }
  
  // repeated .OSMPBF.ChangeSet changesets = 5;
  for (int i = 0; i < this->changesets_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      5, this->changesets(i), output);
  }
  
}

int PrimitiveGroup::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
    // optional .OSMPBF.DenseNodes dense = 2;
    if (has_dense()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->dense());
    }
    
  }
  // repeated .OSMPBF.Node nodes = 1;
  total_size += 1 * this->nodes_size();
  for (int i = 0; i < this->nodes_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->nodes(i));
  }
  
  // repeated .OSMPBF.Way ways = 3;
  total_size += 1 * this->ways_size();
  for (int i = 0; i < this->ways_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->ways(i));
  }
  
  // repeated .OSMPBF.Relation relations = 4;
  total_size += 1 * this->relations_size();
  for (int i = 0; i < this->relations_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->relations(i));
  }
  
  // repeated .OSMPBF.ChangeSet changesets = 5;
  total_size += 1 * this->changesets_size();
  for (int i = 0; i < this->changesets_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->changesets(i));
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void PrimitiveGroup::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const PrimitiveGroup*>(&from));
}

void PrimitiveGroup::MergeFrom(const PrimitiveGroup& from) {
  GOOGLE_CHECK_NE(&from, this);
  nodes_.MergeFrom(from.nodes_);
  ways_.MergeFrom(from.ways_);
  relations_.MergeFrom(from.relations_);
  changesets_.MergeFrom(from.changesets_);
  if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
    if (from.has_dense()) {
      mutable_dense()->::OSMPBF::DenseNodes::MergeFrom(from.dense());
    }
  }
}

void PrimitiveGroup::CopyFrom(const PrimitiveGroup& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PrimitiveGroup::IsInitialized() const {
  
  for (int i = 0; i < nodes_size(); i++) {
    if (!this->nodes(i).IsInitialized()) return false;
  }
  for (int i = 0; i < ways_size(); i++) {
    if (!this->ways(i).IsInitialized()) return false;
  }
  for (int i = 0; i < relations_size(); i++) {
    if (!this->relations(i).IsInitialized()) return false;
  }
  for (int i = 0; i < changesets_size(); i++) {
    if (!this->changesets(i).IsInitialized()) return false;
  }
  return true;
}

void PrimitiveGroup::Swap(PrimitiveGroup* other) {
  if (other != this) {
    nodes_.Swap(&other->nodes_);
    std::swap(dense_, other->dense_);
    ways_.Swap(&other->ways_);
    relations_.Swap(&other->relations_);
    changesets_.Swap(&other->changesets_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string PrimitiveGroup::GetTypeName() const {
  return "OSMPBF.PrimitiveGroup";
}


// ===================================================================

#ifndef _MSC_VER
const int StringTable::kSFieldNumber;
#endif  // !_MSC_VER

StringTable::StringTable()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void StringTable::InitAsDefaultInstance() {
}

StringTable::StringTable(const StringTable& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void StringTable::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

StringTable::~StringTable() {
  SharedDtor();
}

void StringTable::SharedDtor() {
  if (this != default_instance_) {
  }
}

void StringTable::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const StringTable& StringTable::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

StringTable* StringTable::default_instance_ = NULL;

StringTable* StringTable::New() const {
  return new StringTable;
}

void StringTable::Clear() {
  s_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool StringTable::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated bytes s = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_s:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->add_s()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(10)) goto parse_s;
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void StringTable::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // repeated bytes s = 1;
  for (int i = 0; i < this->s_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      1, this->s(i), output);
  }
  
}

int StringTable::ByteSize() const {
  int total_size = 0;
  
  // repeated bytes s = 1;
  total_size += 1 * this->s_size();
  for (int i = 0; i < this->s_size(); i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
      this->s(i));
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void StringTable::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const StringTable*>(&from));
}

void StringTable::MergeFrom(const StringTable& from) {
  GOOGLE_CHECK_NE(&from, this);
  s_.MergeFrom(from.s_);
}

void StringTable::CopyFrom(const StringTable& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool StringTable::IsInitialized() const {
  
  return true;
}

void StringTable::Swap(StringTable* other) {
  if (other != this) {
    s_.Swap(&other->s_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string StringTable::GetTypeName() const {
  return "OSMPBF.StringTable";
}


// ===================================================================

#ifndef _MSC_VER
const int Info::kVersionFieldNumber;
const int Info::kTimestampFieldNumber;
const int Info::kChangesetFieldNumber;
const int Info::kUidFieldNumber;
const int Info::kUserSidFieldNumber;
#endif  // !_MSC_VER

Info::Info()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void Info::InitAsDefaultInstance() {
}

Info::Info(const Info& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void Info::SharedCtor() {
  _cached_size_ = 0;
  version_ = -1;
  timestamp_ = GOOGLE_LONGLONG(0);
  changeset_ = GOOGLE_LONGLONG(0);
  uid_ = 0;
  user_sid_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Info::~Info() {
  SharedDtor();
}

void Info::SharedDtor() {
  if (this != default_instance_) {
  }
}

void Info::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const Info& Info::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

Info* Info::default_instance_ = NULL;

Info* Info::New() const {
  return new Info;
}

void Info::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    version_ = -1;
    timestamp_ = GOOGLE_LONGLONG(0);
    changeset_ = GOOGLE_LONGLONG(0);
    uid_ = 0;
    user_sid_ = 0u;
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool Info::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 version = 1 [default = -1];
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &version_)));
          set_has_version();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_timestamp;
        break;
      }
      
      // optional int64 timestamp = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_timestamp:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &timestamp_)));
          set_has_timestamp();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(24)) goto parse_changeset;
        break;
      }
      
      // optional int64 changeset = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_changeset:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &changeset_)));
          set_has_changeset();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(32)) goto parse_uid;
        break;
      }
      
      // optional int32 uid = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_uid:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &uid_)));
          set_has_uid();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(40)) goto parse_user_sid;
        break;
      }
      
      // optional uint32 user_sid = 5;
      case 5: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_user_sid:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &user_sid_)));
          set_has_user_sid();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void Info::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional int32 version = 1 [default = -1];
  if (has_version()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->version(), output);
  }
  
  // optional int64 timestamp = 2;
  if (has_timestamp()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->timestamp(), output);
  }
  
  // optional int64 changeset = 3;
  if (has_changeset()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->changeset(), output);
  }
  
  // optional int32 uid = 4;
  if (has_uid()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->uid(), output);
  }
  
  // optional uint32 user_sid = 5;
  if (has_user_sid()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->user_sid(), output);
  }
  
}

int Info::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 version = 1 [default = -1];
    if (has_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->version());
    }
    
    // optional int64 timestamp = 2;
    if (has_timestamp()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->timestamp());
    }
    
    // optional int64 changeset = 3;
    if (has_changeset()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->changeset());
    }
    
    // optional int32 uid = 4;
    if (has_uid()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->uid());
    }
    
    // optional uint32 user_sid = 5;
    if (has_user_sid()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->user_sid());
    }
    
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void Info::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const Info*>(&from));
}

void Info::MergeFrom(const Info& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_version()) {
      set_version(from.version());
    }
    if (from.has_timestamp()) {
      set_timestamp(from.timestamp());
    }
    if (from.has_changeset()) {
      set_changeset(from.changeset());
    }
    if (from.has_uid()) {
      set_uid(from.uid());
    }
    if (from.has_user_sid()) {
      set_user_sid(from.user_sid());
    }
  }
}

void Info::CopyFrom(const Info& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Info::IsInitialized() const {
  
  return true;
}

void Info::Swap(Info* other) {
  if (other != this) {
    std::swap(version_, other->version_);
    std::swap(timestamp_, other->timestamp_);
    std::swap(changeset_, other->changeset_);
    std::swap(uid_, other->uid_);
    std::swap(user_sid_, other->user_sid_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string Info::GetTypeName() const {
  return "OSMPBF.Info";
}


// ===================================================================

#ifndef _MSC_VER
const int DenseInfo::kVersionFieldNumber;
const int DenseInfo::kTimestampFieldNumber;
const int DenseInfo::kChangesetFieldNumber;
const int DenseInfo::kUidFieldNumber;
const int DenseInfo::kUserSidFieldNumber;
#endif  // !_MSC_VER

DenseInfo::DenseInfo()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void DenseInfo::InitAsDefaultInstance() {
}

DenseInfo::DenseInfo(const DenseInfo& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void DenseInfo::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

DenseInfo::~DenseInfo() {
  SharedDtor();
}

void DenseInfo::SharedDtor() {
  if (this != default_instance_) {
  }
}

void DenseInfo::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const DenseInfo& DenseInfo::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

DenseInfo* DenseInfo::default_instance_ = NULL;

DenseInfo* DenseInfo::New() const {
  return new DenseInfo;
}

void DenseInfo::Clear() {
  version_.Clear();
  timestamp_.Clear();
  changeset_.Clear();
  uid_.Clear();
  user_sid_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool DenseInfo::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated int32 version = 1 [packed = true];
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_version())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 10, input, this->mutable_version())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_timestamp;
        break;
      }
      
      // repeated sint64 timestamp = 2 [packed = true];
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_timestamp:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_timestamp())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 18, input, this->mutable_timestamp())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_changeset;
        break;
      }
      
      // repeated sint64 changeset = 3 [packed = true];
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_changeset:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_changeset())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 26, input, this->mutable_changeset())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_uid;
        break;
      }
      
      // repeated sint32 uid = 4 [packed = true];
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_uid:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
                 input, this->mutable_uid())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
                 1, 34, input, this->mutable_uid())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(42)) goto parse_user_sid;
        break;
      }
      
      // repeated sint32 user_sid = 5 [packed = true];
      case 5: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_user_sid:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
                 input, this->mutable_user_sid())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
                 1, 42, input, this->mutable_user_sid())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void DenseInfo::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // repeated int32 version = 1 [packed = true];
  if (this->version_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_version_cached_byte_size_);
  }
  for (int i = 0; i < this->version_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
      this->version(i), output);
  }
  
  // repeated sint64 timestamp = 2 [packed = true];
  if (this->timestamp_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_timestamp_cached_byte_size_);
  }
  for (int i = 0; i < this->timestamp_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->timestamp(i), output);
  }
  
  // repeated sint64 changeset = 3 [packed = true];
  if (this->changeset_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_changeset_cached_byte_size_);
  }
  for (int i = 0; i < this->changeset_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->changeset(i), output);
  }
  
  // repeated sint32 uid = 4 [packed = true];
  if (this->uid_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_uid_cached_byte_size_);
  }
  for (int i = 0; i < this->uid_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag(
      this->uid(i), output);
  }
  
  // repeated sint32 user_sid = 5 [packed = true];
  if (this->user_sid_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_user_sid_cached_byte_size_);
  }
  for (int i = 0; i < this->user_sid_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag(
      this->user_sid(i), output);
  }
  
}

int DenseInfo::ByteSize() const {
  int total_size = 0;
  
  // repeated int32 version = 1 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->version_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        Int32Size(this->version(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _version_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint64 timestamp = 2 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->timestamp_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->timestamp(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _timestamp_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint64 changeset = 3 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->changeset_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->changeset(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _changeset_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint32 uid = 4 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->uid_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt32Size(this->uid(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _uid_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint32 user_sid = 5 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->user_sid_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt32Size(this->user_sid(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _user_sid_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void DenseInfo::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const DenseInfo*>(&from));
}

void DenseInfo::MergeFrom(const DenseInfo& from) {
  GOOGLE_CHECK_NE(&from, this);
  version_.MergeFrom(from.version_);
  timestamp_.MergeFrom(from.timestamp_);
  changeset_.MergeFrom(from.changeset_);
  uid_.MergeFrom(from.uid_);
  user_sid_.MergeFrom(from.user_sid_);
}

void DenseInfo::CopyFrom(const DenseInfo& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DenseInfo::IsInitialized() const {
  
  return true;
}

void DenseInfo::Swap(DenseInfo* other) {
  if (other != this) {
    version_.Swap(&other->version_);
    timestamp_.Swap(&other->timestamp_);
    changeset_.Swap(&other->changeset_);
    uid_.Swap(&other->uid_);
    user_sid_.Swap(&other->user_sid_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string DenseInfo::GetTypeName() const {
  return "OSMPBF.DenseInfo";
}


// ===================================================================

#ifndef _MSC_VER
const int ChangeSet::kIdFieldNumber;
#endif  // !_MSC_VER

ChangeSet::ChangeSet()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void ChangeSet::InitAsDefaultInstance() {
}

ChangeSet::ChangeSet(const ChangeSet& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void ChangeSet::SharedCtor() {
  _cached_size_ = 0;
  id_ = GOOGLE_LONGLONG(0);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ChangeSet::~ChangeSet() {
  SharedDtor();
}

void ChangeSet::SharedDtor() {
  if (this != default_instance_) {
  }
}

void ChangeSet::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ChangeSet& ChangeSet::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

ChangeSet* ChangeSet::default_instance_ = NULL;

ChangeSet* ChangeSet::New() const {
  return new ChangeSet;
}

void ChangeSet::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    id_ = GOOGLE_LONGLONG(0);
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool ChangeSet::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required int64 id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &id_)));
          set_has_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void ChangeSet::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required int64 id = 1;
  if (has_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output);
  }
  
}

int ChangeSet::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required int64 id = 1;
    if (has_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->id());
    }
    
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ChangeSet::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const ChangeSet*>(&from));
}

void ChangeSet::MergeFrom(const ChangeSet& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_id()) {
      set_id(from.id());
    }
  }
}

void ChangeSet::CopyFrom(const ChangeSet& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ChangeSet::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
  return true;
}

void ChangeSet::Swap(ChangeSet* other) {
  if (other != this) {
    std::swap(id_, other->id_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string ChangeSet::GetTypeName() const {
  return "OSMPBF.ChangeSet";
}


// ===================================================================

#ifndef _MSC_VER
const int Node::kIdFieldNumber;
const int Node::kKeysFieldNumber;
const int Node::kValsFieldNumber;
const int Node::kInfoFieldNumber;
const int Node::kLatFieldNumber;
const int Node::kLonFieldNumber;
#endif  // !_MSC_VER

Node::Node()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void Node::InitAsDefaultInstance() {
  info_ = const_cast< ::OSMPBF::Info*>(&::OSMPBF::Info::default_instance());
}

Node::Node(const Node& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void Node::SharedCtor() {
  _cached_size_ = 0;
  id_ = GOOGLE_LONGLONG(0);
  info_ = NULL;
  lat_ = GOOGLE_LONGLONG(0);
  lon_ = GOOGLE_LONGLONG(0);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Node::~Node() {
  SharedDtor();
}

void Node::SharedDtor() {
  if (this != default_instance_) {
    delete info_;
  }
}

void Node::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const Node& Node::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

Node* Node::default_instance_ = NULL;

Node* Node::New() const {
  return new Node;
}

void Node::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    id_ = GOOGLE_LONGLONG(0);
    if (has_info()) {
      if (info_ != NULL) info_->::OSMPBF::Info::Clear();
    }
    lat_ = GOOGLE_LONGLONG(0);
    lon_ = GOOGLE_LONGLONG(0);
  }
  keys_.Clear();
  vals_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool Node::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required sint64 id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &id_)));
          set_has_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_keys;
        break;
      }
      
      // repeated uint32 keys = 2 [packed = true];
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_keys:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_keys())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 18, input, this->mutable_keys())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_vals;
        break;
      }
      
      // repeated uint32 vals = 3 [packed = true];
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_vals:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_vals())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 26, input, this->mutable_vals())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_info;
        break;
      }
      
      // optional .OSMPBF.Info info = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_info:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_info()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(64)) goto parse_lat;
        break;
      }
      
      // required sint64 lat = 8;
      case 8: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_lat:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &lat_)));
          set_has_lat();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(72)) goto parse_lon;
        break;
      }
      
      // required sint64 lon = 9;
      case 9: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_lon:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, &lon_)));
          set_has_lon();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void Node::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required sint64 id = 1;
  if (has_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(1, this->id(), output);
  }
  
  // repeated uint32 keys = 2 [packed = true];
  if (this->keys_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_keys_cached_byte_size_);
  }
  for (int i = 0; i < this->keys_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->keys(i), output);
  }
  
  // repeated uint32 vals = 3 [packed = true];
  if (this->vals_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_vals_cached_byte_size_);
  }
  for (int i = 0; i < this->vals_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->vals(i), output);
  }
  
  // optional .OSMPBF.Info info = 4;
  if (has_info()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      4, this->info(), output);
  }
  
  // required sint64 lat = 8;
  if (has_lat()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(8, this->lat(), output);
  }
  
  // required sint64 lon = 9;
  if (has_lon()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64(9, this->lon(), output);
  }
  
}

int Node::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required sint64 id = 1;
    if (has_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->id());
    }
    
    // optional .OSMPBF.Info info = 4;
    if (has_info()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->info());
    }
    
    // required sint64 lat = 8;
    if (has_lat()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->lat());
    }
    
    // required sint64 lon = 9;
    if (has_lon()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::SInt64Size(
          this->lon());
    }
    
  }
  // repeated uint32 keys = 2 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->keys_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->keys(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _keys_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated uint32 vals = 3 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->vals_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->vals(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _vals_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void Node::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const Node*>(&from));
}

void Node::MergeFrom(const Node& from) {
  GOOGLE_CHECK_NE(&from, this);
  keys_.MergeFrom(from.keys_);
  vals_.MergeFrom(from.vals_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_id()) {
      set_id(from.id());
    }
    if (from.has_info()) {
      mutable_info()->::OSMPBF::Info::MergeFrom(from.info());
    }
    if (from.has_lat()) {
      set_lat(from.lat());
    }
    if (from.has_lon()) {
      set_lon(from.lon());
    }
  }
}

void Node::CopyFrom(const Node& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Node::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000031) != 0x00000031) return false;
  
  return true;
}

void Node::Swap(Node* other) {
  if (other != this) {
    std::swap(id_, other->id_);
    keys_.Swap(&other->keys_);
    vals_.Swap(&other->vals_);
    std::swap(info_, other->info_);
    std::swap(lat_, other->lat_);
    std::swap(lon_, other->lon_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string Node::GetTypeName() const {
  return "OSMPBF.Node";
}


// ===================================================================

#ifndef _MSC_VER
const int DenseNodes::kIdFieldNumber;
const int DenseNodes::kDenseinfoFieldNumber;
const int DenseNodes::kLatFieldNumber;
const int DenseNodes::kLonFieldNumber;
const int DenseNodes::kKeysValsFieldNumber;
#endif  // !_MSC_VER

DenseNodes::DenseNodes()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void DenseNodes::InitAsDefaultInstance() {
  denseinfo_ = const_cast< ::OSMPBF::DenseInfo*>(&::OSMPBF::DenseInfo::default_instance());
}

DenseNodes::DenseNodes(const DenseNodes& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void DenseNodes::SharedCtor() {
  _cached_size_ = 0;
  denseinfo_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

DenseNodes::~DenseNodes() {
  SharedDtor();
}

void DenseNodes::SharedDtor() {
  if (this != default_instance_) {
    delete denseinfo_;
  }
}

void DenseNodes::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const DenseNodes& DenseNodes::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

DenseNodes* DenseNodes::default_instance_ = NULL;

DenseNodes* DenseNodes::New() const {
  return new DenseNodes;
}

void DenseNodes::Clear() {
  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
    if (has_denseinfo()) {
      if (denseinfo_ != NULL) denseinfo_->::OSMPBF::DenseInfo::Clear();
    }
  }
  id_.Clear();
  lat_.Clear();
  lon_.Clear();
  keys_vals_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool DenseNodes::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated sint64 id = 1 [packed = true];
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_id())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 10, input, this->mutable_id())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(42)) goto parse_denseinfo;
        break;
      }
      
      // optional .OSMPBF.DenseInfo denseinfo = 5;
      case 5: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_denseinfo:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_denseinfo()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(66)) goto parse_lat;
        break;
      }
      
      // repeated sint64 lat = 8 [packed = true];
      case 8: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_lat:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_lat())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 66, input, this->mutable_lat())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(74)) goto parse_lon;
        break;
      }
      
      // repeated sint64 lon = 9 [packed = true];
      case 9: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_lon:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_lon())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 74, input, this->mutable_lon())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(82)) goto parse_keys_vals;
        break;
      }
      
      // repeated int32 keys_vals = 10 [packed = true];
      case 10: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_keys_vals:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_keys_vals())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 82, input, this->mutable_keys_vals())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void DenseNodes::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // repeated sint64 id = 1 [packed = true];
  if (this->id_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_id_cached_byte_size_);
  }
  for (int i = 0; i < this->id_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->id(i), output);
  }
  
  // optional .OSMPBF.DenseInfo denseinfo = 5;
  if (has_denseinfo()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      5, this->denseinfo(), output);
  }
  
  // repeated sint64 lat = 8 [packed = true];
  if (this->lat_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_lat_cached_byte_size_);
  }
  for (int i = 0; i < this->lat_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->lat(i), output);
  }
  
  // repeated sint64 lon = 9 [packed = true];
  if (this->lon_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_lon_cached_byte_size_);
  }
  for (int i = 0; i < this->lon_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->lon(i), output);
  }
  
  // repeated int32 keys_vals = 10 [packed = true];
  if (this->keys_vals_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_keys_vals_cached_byte_size_);
  }
  for (int i = 0; i < this->keys_vals_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
      this->keys_vals(i), output);
  }
  
}

int DenseNodes::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
    // optional .OSMPBF.DenseInfo denseinfo = 5;
    if (has_denseinfo()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->denseinfo());
    }
    
  }
  // repeated sint64 id = 1 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->id_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->id(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _id_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint64 lat = 8 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->lat_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->lat(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _lat_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint64 lon = 9 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->lon_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->lon(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _lon_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated int32 keys_vals = 10 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->keys_vals_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        Int32Size(this->keys_vals(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _keys_vals_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void DenseNodes::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const DenseNodes*>(&from));
}

void DenseNodes::MergeFrom(const DenseNodes& from) {
  GOOGLE_CHECK_NE(&from, this);
  id_.MergeFrom(from.id_);
  lat_.MergeFrom(from.lat_);
  lon_.MergeFrom(from.lon_);
  keys_vals_.MergeFrom(from.keys_vals_);
  if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
    if (from.has_denseinfo()) {
      mutable_denseinfo()->::OSMPBF::DenseInfo::MergeFrom(from.denseinfo());
    }
  }
}

void DenseNodes::CopyFrom(const DenseNodes& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DenseNodes::IsInitialized() const {
  
  return true;
}

void DenseNodes::Swap(DenseNodes* other) {
  if (other != this) {
    id_.Swap(&other->id_);
    std::swap(denseinfo_, other->denseinfo_);
    lat_.Swap(&other->lat_);
    lon_.Swap(&other->lon_);
    keys_vals_.Swap(&other->keys_vals_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string DenseNodes::GetTypeName() const {
  return "OSMPBF.DenseNodes";
}


// ===================================================================

#ifndef _MSC_VER
const int Way::kIdFieldNumber;
const int Way::kKeysFieldNumber;
const int Way::kValsFieldNumber;
const int Way::kInfoFieldNumber;
const int Way::kRefsFieldNumber;
#endif  // !_MSC_VER

Way::Way()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void Way::InitAsDefaultInstance() {
  info_ = const_cast< ::OSMPBF::Info*>(&::OSMPBF::Info::default_instance());
}

Way::Way(const Way& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void Way::SharedCtor() {
  _cached_size_ = 0;
  id_ = GOOGLE_LONGLONG(0);
  info_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Way::~Way() {
  SharedDtor();
}

void Way::SharedDtor() {
  if (this != default_instance_) {
    delete info_;
  }
}

void Way::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const Way& Way::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

Way* Way::default_instance_ = NULL;

Way* Way::New() const {
  return new Way;
}

void Way::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    id_ = GOOGLE_LONGLONG(0);
    if (has_info()) {
      if (info_ != NULL) info_->::OSMPBF::Info::Clear();
    }
  }
  keys_.Clear();
  vals_.Clear();
  refs_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool Way::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required int64 id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &id_)));
          set_has_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_keys;
        break;
      }
      
      // repeated uint32 keys = 2 [packed = true];
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_keys:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_keys())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 18, input, this->mutable_keys())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_vals;
        break;
      }
      
      // repeated uint32 vals = 3 [packed = true];
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_vals:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_vals())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 26, input, this->mutable_vals())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_info;
        break;
      }
      
      // optional .OSMPBF.Info info = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_info:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_info()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(66)) goto parse_refs;
        break;
      }
      
      // repeated sint64 refs = 8 [packed = true];
      case 8: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_refs:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_refs())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 66, input, this->mutable_refs())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void Way::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required int64 id = 1;
  if (has_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output);
  }
  
  // repeated uint32 keys = 2 [packed = true];
  if (this->keys_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_keys_cached_byte_size_);
  }
  for (int i = 0; i < this->keys_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->keys(i), output);
  }
  
  // repeated uint32 vals = 3 [packed = true];
  if (this->vals_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_vals_cached_byte_size_);
  }
  for (int i = 0; i < this->vals_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->vals(i), output);
  }
  
  // optional .OSMPBF.Info info = 4;
  if (has_info()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      4, this->info(), output);
  }
  
  // repeated sint64 refs = 8 [packed = true];
  if (this->refs_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_refs_cached_byte_size_);
  }
  for (int i = 0; i < this->refs_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->refs(i), output);
  }
  
}

int Way::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required int64 id = 1;
    if (has_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->id());
    }
    
    // optional .OSMPBF.Info info = 4;
    if (has_info()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->info());
    }
    
  }
  // repeated uint32 keys = 2 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->keys_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->keys(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _keys_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated uint32 vals = 3 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->vals_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->vals(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _vals_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint64 refs = 8 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->refs_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->refs(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _refs_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void Way::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const Way*>(&from));
}

void Way::MergeFrom(const Way& from) {
  GOOGLE_CHECK_NE(&from, this);
  keys_.MergeFrom(from.keys_);
  vals_.MergeFrom(from.vals_);
  refs_.MergeFrom(from.refs_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_id()) {
      set_id(from.id());
    }
    if (from.has_info()) {
      mutable_info()->::OSMPBF::Info::MergeFrom(from.info());
    }
  }
}

void Way::CopyFrom(const Way& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Way::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
  return true;
}

void Way::Swap(Way* other) {
  if (other != this) {
    std::swap(id_, other->id_);
    keys_.Swap(&other->keys_);
    vals_.Swap(&other->vals_);
    std::swap(info_, other->info_);
    refs_.Swap(&other->refs_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string Way::GetTypeName() const {
  return "OSMPBF.Way";
}


// ===================================================================

bool Relation_MemberType_IsValid(int value) {
  switch(value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#ifndef _MSC_VER
const Relation_MemberType Relation::NODE;
const Relation_MemberType Relation::WAY;
const Relation_MemberType Relation::RELATION;
const Relation_MemberType Relation::MemberType_MIN;
const Relation_MemberType Relation::MemberType_MAX;
const int Relation::MemberType_ARRAYSIZE;
#endif  // _MSC_VER
#ifndef _MSC_VER
const int Relation::kIdFieldNumber;
const int Relation::kKeysFieldNumber;
const int Relation::kValsFieldNumber;
const int Relation::kInfoFieldNumber;
const int Relation::kRolesSidFieldNumber;
const int Relation::kMemidsFieldNumber;
const int Relation::kTypesFieldNumber;
#endif  // !_MSC_VER

Relation::Relation()
  : ::google::protobuf::MessageLite() {
  SharedCtor();
}

void Relation::InitAsDefaultInstance() {
  info_ = const_cast< ::OSMPBF::Info*>(&::OSMPBF::Info::default_instance());
}

Relation::Relation(const Relation& from)
  : ::google::protobuf::MessageLite() {
  SharedCtor();
  MergeFrom(from);
}

void Relation::SharedCtor() {
  _cached_size_ = 0;
  id_ = GOOGLE_LONGLONG(0);
  info_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Relation::~Relation() {
  SharedDtor();
}

void Relation::SharedDtor() {
  if (this != default_instance_) {
    delete info_;
  }
}

void Relation::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const Relation& Relation::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto();  return *default_instance_;
}

Relation* Relation::default_instance_ = NULL;

Relation* Relation::New() const {
  return new Relation;
}

void Relation::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    id_ = GOOGLE_LONGLONG(0);
    if (has_info()) {
      if (info_ != NULL) info_->::OSMPBF::Info::Clear();
    }
  }
  keys_.Clear();
  vals_.Clear();
  roles_sid_.Clear();
  memids_.Clear();
  types_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

bool Relation::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required int64 id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &id_)));
          set_has_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_keys;
        break;
      }
      
      // repeated uint32 keys = 2 [packed = true];
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_keys:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_keys())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 18, input, this->mutable_keys())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_vals;
        break;
      }
      
      // repeated uint32 vals = 3 [packed = true];
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_vals:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_vals())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 26, input, this->mutable_vals())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_info;
        break;
      }
      
      // optional .OSMPBF.Info info = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_info:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_info()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(66)) goto parse_roles_sid;
        break;
      }
      
      // repeated int32 roles_sid = 8 [packed = true];
      case 8: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_roles_sid:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_roles_sid())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 66, input, this->mutable_roles_sid())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(74)) goto parse_memids;
        break;
      }
      
      // repeated sint64 memids = 9 [packed = true];
      case 9: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_memids:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 input, this->mutable_memids())));
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
                 1, 74, input, this->mutable_memids())));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(82)) goto parse_types;
        break;
      }
      
      // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];
      case 10: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_types:
          ::google::protobuf::uint32 length;
          DO_(input->ReadVarint32(&length));
          ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(length);
          while (input->BytesUntilLimit() > 0) {
            int value;
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
            if (::OSMPBF::Relation_MemberType_IsValid(value)) {
              add_types(static_cast< ::OSMPBF::Relation_MemberType >(value));
            }
          }
          input->PopLimit(limit);
        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
                   == ::google::protobuf::internal::WireFormatLite::
                      WIRETYPE_VARINT) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::OSMPBF::Relation_MemberType_IsValid(value)) {
            add_types(static_cast< ::OSMPBF::Relation_MemberType >(value));
          }
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }
      
      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void Relation::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required int64 id = 1;
  if (has_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output);
  }
  
  // repeated uint32 keys = 2 [packed = true];
  if (this->keys_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_keys_cached_byte_size_);
  }
  for (int i = 0; i < this->keys_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->keys(i), output);
  }
  
  // repeated uint32 vals = 3 [packed = true];
  if (this->vals_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_vals_cached_byte_size_);
  }
  for (int i = 0; i < this->vals_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->vals(i), output);
  }
  
  // optional .OSMPBF.Info info = 4;
  if (has_info()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessage(
      4, this->info(), output);
  }
  
  // repeated int32 roles_sid = 8 [packed = true];
  if (this->roles_sid_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_roles_sid_cached_byte_size_);
  }
  for (int i = 0; i < this->roles_sid_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
      this->roles_sid(i), output);
  }
  
  // repeated sint64 memids = 9 [packed = true];
  if (this->memids_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_memids_cached_byte_size_);
  }
  for (int i = 0; i < this->memids_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag(
      this->memids(i), output);
  }
  
  // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];
  if (this->types_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(
      10,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      output);
    output->WriteVarint32(_types_cached_byte_size_);
  }
  for (int i = 0; i < this->types_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
      this->types(i), output);
  }
  
}

int Relation::ByteSize() const {
  int total_size = 0;
  
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required int64 id = 1;
    if (has_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->id());
    }
    
    // optional .OSMPBF.Info info = 4;
    if (has_info()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->info());
    }
    
  }
  // repeated uint32 keys = 2 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->keys_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->keys(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _keys_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated uint32 vals = 3 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->vals_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->vals(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _vals_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated int32 roles_sid = 8 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->roles_sid_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        Int32Size(this->roles_sid(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _roles_sid_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated sint64 memids = 9 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->memids_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        SInt64Size(this->memids(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _memids_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->types_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
        this->types(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    _types_cached_byte_size_ = data_size;
    total_size += data_size;
  }
  
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void Relation::CheckTypeAndMergeFrom(
    const ::google::protobuf::MessageLite& from) {
  MergeFrom(*::google::protobuf::down_cast<const Relation*>(&from));
}

void Relation::MergeFrom(const Relation& from) {
  GOOGLE_CHECK_NE(&from, this);
  keys_.MergeFrom(from.keys_);
  vals_.MergeFrom(from.vals_);
  roles_sid_.MergeFrom(from.roles_sid_);
  memids_.MergeFrom(from.memids_);
  types_.MergeFrom(from.types_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_id()) {
      set_id(from.id());
    }
    if (from.has_info()) {
      mutable_info()->::OSMPBF::Info::MergeFrom(from.info());
    }
  }
}

void Relation::CopyFrom(const Relation& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Relation::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
  return true;
}

void Relation::Swap(Relation* other) {
  if (other != this) {
    std::swap(id_, other->id_);
    keys_.Swap(&other->keys_);
    vals_.Swap(&other->vals_);
    std::swap(info_, other->info_);
    roles_sid_.Swap(&other->roles_sid_);
    memids_.Swap(&other->memids_);
    types_.Swap(&other->types_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::std::string Relation::GetTypeName() const {
  return "OSMPBF.Relation";
}


// @@protoc_insertion_point(namespace_scope)

}  // namespace OSMPBF

// @@protoc_insertion_point(global_scope)
